1

I have some assembly code as a .txt file (i.e. a list of the instructions, stuff like this):

00000003  E8D001            call 0x1d6
00000006  A08000            mov al,[0x80]
00000009  0C00              or al,0x0
0000000B  750B              jnz 0x18
0000000D  90                nop

How would I import this into ghidra? (i.e. copy the code into the code browser window). I originally started with a .COM file, but I couldn't successfully import into Ghidra. My end goal is to compile it up to C.

0

1 Answer 1

0

This approach won't work. Ghidra analyzes machine code, not ASCII text.

4
  • So I should go back and try to import the .COM file into ghidra?
    – Zopolis4
    Dec 20, 2021 at 5:09
  • @Zopolis4 you should employ an assembler to go from assembler code to machine code. Nasm and Fasm are free-of-charge and open source options.
    – 0xC0000022L
    Dec 20, 2021 at 8:56
  • I already have the machine code, my aim is C.
    – Zopolis4
    Dec 20, 2021 at 9:09
  • @Zopolis4 Analyze the binary executable the code snippet was taken from. The little piece of code shown in your post is meaningless without context.
    – julian
    Dec 21, 2021 at 0:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.