Question

Basically I use IDA Pro to disassemble some binaries from SPEC2006, and do some modification work to make it nasm-reassmeble on Windows 7 32bit.

I find one problem in the disassembled asm code generated from IDA Pro like this:

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

Obviously IDA Pro put this jump table inside the code.

I use nasm to assemble this code and it generate this:

error: comma expected after operand 1  

in each of the four lines

I modify it like this:

            ;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

But it still generate the same errors at each of the four lines...

   error: comma expected after operand 1  

Could any one give me some help? THank you!

Était-ce utile?

La solution

Okay, consider it an "answer".

Nasm doesn't use the offset keyword. Just dd LeadUp1 etc should do it. If you've got a lot of 'em, you can %define offset (as nothing) to make Nasm ignore it. Having a jump table in section .text shouldn't be a problem. The memory will be readonly, but you probably don't want your jump table writable anyway...

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top