如何在IDA中使用JMP?

问题描述 投票:-2回答:1
.text:004430FE                 jz      short loc_44311B
.text:00443100                 push    30h             ; uType
.text:00443102                 push    offset Athingy; "Hello"
.text:00443107                 push    offset AnotherThingy; "Works"
.text:0044310C                 call    sub_438090
.text:00443111                 add     esp, 0Ch
.text:00443114                 push    0
.text:00443116                 call    sub_44C424
.text:0044311B
.text:0044311B loc_44311B:                             ; CODE XREF: sub_442C70+48Ej
.text:0044311B                 mov     ecx, 0FAh
.text:00443120                 mov     esi, offset buf
.text:00443125                 lea     edi, [ebp+var_3FC]
.text:0044312B                 rep movsd
.text:0044312D                 push    offset aTest; "test"
.text:00443132                 lea     eax, [ebp+var_3FC]
.text:00443138                 push    eax
.text:00443139                 call    sub_465450
.text:0044313E                 add     esp, 8

如果我想将jz(在顶部)更改为jmp并将其设置为add esp, 8。我怎么能这样做?

我知道如何修补程序并去组装,但我会输入什么关于jmp?

assembly x86 ida
1个回答
1
投票

您可以在英特尔手册中查找操作码以获得简短的jmp。我没有它的方便,但如果内存服务它是0xEB。

用于计算jmp偏移量的公式是(目标地址 - jmp指令的地址 - 2)。 (2是因为这是短跳转指令的长度,包括其参数 - CPU将偏移量添加到指令指针值跟随跳转指令之后)。

© www.soinside.com 2019 - 2024. All rights reserved.