2

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? Commented 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. Commented Dec 20, 2021 at 8:56
  • I already have the machine code, my aim is C. Commented 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. Commented Dec 21, 2021 at 0:15
  • What would I load it the executable as? (i.e. what processor, size and compiler?) Commented Mar 16, 2023 at 1:10

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.