您能帮忙编写这段汇编语言代码吗?
我一直在查看我试图“改进”的电脑游戏的一段代码。 (好吧,也许我不喜欢这个游戏,但我仍然想玩它)。请您查看以下代码:
fld dword ptr[ebp+00007B1C]
fsub dword ptr[esp+64]
fst dword ptr[ebp+00007B1C]
call 004A2E48
此代码每秒被调用一次,用于关卡倒计时器。我需要在特定的水平上停留几分钟。如果我可以修改上面的代码,使推入地址 [ebp+00007B1C] 的值为 0,那么游戏关卡将始终超时,这样我就可以免去玩那些疯狂的“生存”迷你游戏了。
我将解释我从这段代码中理解的内容。 别担心,您不必深入了解这一点。 在第一行中,我们获取计时器值。例如,如果还剩 97 秒,则在此加载该值。
在第二行中,从 97 中减去一个值(1 秒)。
在第三行中,96 再次被移入内存。 最后,我们有一个函数调用,它将根据剩余时间进行其他处理。
现在我需要做的就是以某种方式修补这段代码,以便推送的值为 0(在第三步中)。
你能帮我解决这个问题吗?
I've been looking through a piece of code of a pc game that I'm trying to "improve". (ok so maybe I suck at the game but I still want to play it). Could you please look into the following code:
fld dword ptr[ebp+00007B1C]
fsub dword ptr[esp+64]
fst dword ptr[ebp+00007B1C]
call 004A2E48
This code is called every second for the level countdown timer. I need to stay on a particular level for a few minutes. If I can modify the above code so that the value pushed into the address [ebp+00007B1C] is 0 then the game level will always time out and it will save me playing those crazy "survival" minigames.
I'll explain what I understand from this code. Dont worry, you dont have to go deep into this.
In the first line we get the timer value. For example if 97 seconds are remaining then it is here that this value is loaded.
In the second line a value (1 second) is subtracted from 97.
In the third line 96 is again moved to memory.
And finally we have the function call that will do other processing based on the time remaining.
Now all I need to do is patch this piece of code somehow so that the value that is pushed is 0 (in the third step).
Can you please help me out with this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
替换
为
Replace
with
另一个补丁:
替换
为
Another patch:
replace
with
只需 no 出第二个命令即可。也就是说,找出 fsub 命令占用了多少字节,并用那么多无操作字节码(0x90)覆盖它。
Just nop out the second command. That is, find out how many bytes the fsub command takes and overwrite it with that many no-operation bytecodes (0x90).