How can I add assembler instructions between disassembled code in IDA/Olly?

StackOverflow https://stackoverflow.com/questions/23670590

  •  23-07-2023
  •  | 
  •  

문제

I disassembled file into IDA/OllyDbg. How can I add some instructions in disassembled code? If I double-click on instruction, I can change it, but I want add instruction between exists instructions. Can anybody help me?

도움이 되었습니까?

해결책

it is not possible to add new instructions in the middle without destroying old instruction

the only proper way to add instruction is to detour to an empty place from existing instruction and jump back.

existing instruction

401023 xxxxxxx
401028 xxxxxxx

new instuctions placed at an empty area

404023  yyyyy 
.......zzzzz
..........cccccccccc
restore old instruction destroyed by detoru jmp
...... jmp 401028

now at 401023 you assemble jmp 404023 destroying one instruction
at 404023 you add all other instruction you want to add
at the end you restore the destroyed instruction at 401023 and jmp back to 401028

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top