Home > Software design >  How can i get opcode list file from code.il.s file?
How can i get opcode list file from code.il.s file?

Time:01-18

My problem is that I need to get a file from code.il.s in which there will be opcodes of instructions from il.s, how can I do this?

So far I've only figured out how I can create .exe, but I need to figure out how I can make a file that will have opcodes from code.il.s?

CodePudding user response:

An opcode list file, also known as a disassembly, is a representation of the assembly instructions that are generated by the compiler from a given source code file. To generate an opcode list file from a code.il.s file, you can use a disassembler tool like objdump or ida.

One way to do this using objdump is to use the following command in the command line:

objdump -d code.il.s > opcode_list.txt
This will disassemble the code.il.s file and write the output to the opcode_list.txt file.

Another way is to use IDA (Interactive Disassembler) which is a multi-architecture disassembler, a debugger and a hex editor. You could open the code.il.s file in IDA, and then use the "Decompile" feature (if your version of IDA supports it) to get a readable assembly code.

Both methods will give you a list of assembly instructions, also known as opcodes, that correspond to the machine code generated by the compiler from the original source code. The opcode list file will be in a machine-readable format, and typically will be difficult for humans to understand, but it can be useful for reverse engineering and debugging purposes.

  • Related