rep movsd instruction does not round-trip in disassembler/assembler

Offen
#4,037 8 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
python

Rechercherichtung

Start with the Python reproducer using Architecture['x86'], get_instruction_text, and arch.assemble for the rep movsd and movsb examples. Trace why the disassembled operand form is rejected, then verify that the shown instructions round-trip through disassembly and assembly without the invalid-operand error.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Arch: x86 Component: Architecture Effort: Medium Impact: Low

x86 assembler does not seem to be working for 'rep mov' instructions...code below demonstrates the issue

from binaryninja import Architecture
arch = Architecture['x86']

instr_bytes = b'\xf3\xa5'    # rep movsd dword [edi], [esi]
txt, size = arch.get_instruction_text(instr_bytes, 0)
instr = ''.join(str(a) for a in txt).strip()

# now 'instr' holds:   "rep movsd dword [edi], [esi]"

assem = arch.assemble(instr)

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:

disassem =  bv.get_disassembly_at(addr)
bv.arch.assemble(disassem)

It also seems to fail on movsb byte [edi], [esi] type instructions.
Thanks for checking this out...

Vorherrschende Sprache
C++
Sterne
1.3k
Forks
298
Ø Merge
5 T. 5 Std.
Gemergte PRs (30 T.)
19

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus Vector35/binaryninja-api

Alle Issues in Vector35/binaryninja-api

Ähnliche Issues

Weitere Issues zu C++

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.