User Tools

Site Tools


labs:disassembly

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
labs:disassembly [2016/04/06 17:04]
manuelei
labs:disassembly [2016/04/07 18:08]
manuelei
Line 22: Line 22:
   * Intel IA-32 instruction set reference: http://​www.intel.com/​content/​dam/​www/​public/​us/​en/​documents/​manuals/​64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf   * Intel IA-32 instruction set reference: http://​www.intel.com/​content/​dam/​www/​public/​us/​en/​documents/​manuals/​64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf
  
-  * We have written a tool which allows you to insert your own machine code (produced e.g. with as) into a binary. It is contained in the same zip folder as the other executables. \\ Usage: ./elf_tool <​executable_file>​ <​new_machine_code_file (inject_code.bin)>​ <​insertion_address>​. \\ The tool inserts the code into the executable, and writes a jump to the new code at the specified insertion_address (given in hexadecimal,​ e.g. 80487f0). Note that the inserted jump will **overwrite ​bytes** of the code, so if the overwritten code is still needed, you have to repeat it in your new code.+  * We have written a tool which allows you to insert your own machine code (produced e.g. with as) into a binary. It is contained in the same zip folder as the other executables. \\ Usage: ./elf_tool <​executable_file>​ <​new_machine_code_file (inject_code.bin)>​ <​insertion_address>​. \\ The tool inserts the code into the executable, and writes a jump to the new code at the specified insertion_address (given in hexadecimal,​ e.g. 80487f0). Note that the inserted jump will **overwrite ​bytes** of the code, so if the overwritten code is still needed, you have to repeat it in your new code.
   * Assembling: Write assembly in a file called inject_code.s and execute the following command to get the machine code binary file required for the elf_tool: as %%--%%32 -o inject_code.o inject_code.s && objcopy -O binary inject_code.o inject_code.bin && rm inject_code.o   * Assembling: Write assembly in a file called inject_code.s and execute the following command to get the machine code binary file required for the elf_tool: as %%--%%32 -o inject_code.o inject_code.s && objcopy -O binary inject_code.o inject_code.bin && rm inject_code.o
  
labs/disassembly.txt · Last modified: 2020/08/31 21:03 (external edit)