0

基本上,我使用 IDA Pro 从 SPEC2006 反汇编一些二进制文件,并进行一些修改工作以使其在 Windows 7 32 位上进行 nasm-reassmeble。

我在从 IDA Pro 生成的反汇编 asm 代码中发现了一个问题,如下所示:

            ;this is .text section
            .....
            LeadUpVec:
                dd offset LeadUp1
                dd offset LeadUp2
                dd offset LeadUp3
            LeadUp1:
            ;this is .text section

显然IDA Pro把这个跳转表放在了代码里面。

我使用 nasm 来组装这段代码并生成:

error: comma expected after operand 1  

在四行中的每一行

我这样修改它:

            ;this is .text section
            .....
            section .data         <--- I add it here
            LeadUpVec:
                dd offset LeadUp1
                dd offset LeadUp2
                dd offset LeadUp3
            section .text         <--- I add it here
            LeadUp1:
            ;this is .text section

但它仍然在四行中的每一行产生相同的错误......

   error: comma expected after operand 1  

任何人都可以给我一些帮助吗?谢谢你!

4

1 回答 1

1

好的,将其视为“答案”。

Nasm 不使用 offset 关键字。只是 dd LeadUp1 等应该这样做。如果你有很多他们,你可以 %define 偏移(什么都没有)让 Nasm 忽略它。在 .text 部分有一个跳转表应该不是问题。内存将是只读的,但您可能不希望您的跳转表可写...

于 2014-02-16T22:58:22.637 回答