如何将变量保存到堆栈或内存中

时间:2019-07-17 12:33:30

标签: assembly x86-64

我正在努力通过按一下按钮来启用和禁用某些游戏的作弊功能,并使其在某些时候起作用。

面临的问题是,按住该按钮时,作弊功能正常,但是一旦我放开该按钮,该作弊功能就不再有效。

问题是一旦按下按钮,如何使其保存0x02的值。

  Code Cave address 0x015F3800

015F3800 push r8
015F3802 movabs r8, 0x20219d1c4 <-- Buttons Address, (movabs) move absolute memory address value into r8
015F380C mov r8,[r8]       
015F380F cmp r8, 0x02 <-- r8 = 0 if nothing is pressed and when L3 is pressed r8 = 2
015F3813 jnz 0x015F3823 <-- ZF is set to 1 if L3 is pressed and ones i get hit HP gos to full, otherwise its clear (0)
015F3815 mov [rbx+0x1e68], ax <-- AX has max HP, modified code
015F381C pop r8
015F381E jmp 0xA161BB <-- return address, if L3 is preesed the rest of the code below will be ignored
015F3823 mov [rbx+0x1e68], cx <-- Original code, if L3 is not preesed the code continue as normal
015F382A pop r8
015F382C jmp 0xA161BB <-- return address

我不确定这是否是发布我的问题的正确地方,所以如果它违反了您的论坛规则,请随时删除它 在过去的几个月里,我一直在学习amd64汇编语言,直到被卡住为止。

0 个答案:

没有答案