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.

6
  • 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
  • What would I load it the executable as? (i.e. what processor, size and compiler?)
    – Zopolis4
    Mar 16 at 1:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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