Open ejm9 opened 4 years ago
Fix typo: Note: it also fails if I do:
disassem = bv.get_disassembly(addr)
bv.arch.assemble(disassem)
I will look into this.
OK, I see now that the proper syntax expected by bv.arch.assemble() is "rep movsd", even though bv.get_disassembly(addr) produces the output: "rep movsd dword [edi], [esi]".
I guess its not really a bug if the expected syntax of the disassembly instruction is different between bv.arch.assemble() and bv.get_disassembly()....but it would be nice if the api docs describing bv.arch.assemble() said that it expects Keystone disassembly syntax (I believe keystone is what Binja is using for assembling) which is different than the disassembly format displayed in the binja binary view....
It's still a bug, just a small one. We prefer our disassembly to be round-tripable unless we are explicitly not happy with the assembler's syntax. (For x86/x64, we use Yasm if you have future questions about syntax)
Not entirely sure about this. I like the current disassembly output rep movsd dword [edi], [esi]
. So we might wish to tweak the assembly input before sending it to Yasm?
Another example: f30f1efa nop edx, edi
That encoding (endbr64) is properly handled if you're on the latest dev already @enedil.
Oh, I should clarify -- the disassembler has support for endbr64
but yasm doesn't yet.
x86 assembler does not seem to be working for 'rep mov' instructions...code below demonstrates the issue
arch.assemble
fails with:ValueError: Could not assemble: b': error: warnings being treated as errors\ninput:1: error: invalid combination of opcode and operands'
Note: it also fails if I do:
It also seems to fail on
movsb byte [edi], [esi]
type instructions. Thanks for checking this out...