Health regeneration
Posted: Sat Sep 09, 2017 2:02 pm
Hello everybody!
I've been learning little assembly while I've been doing some code injections with Cheat engine,
so I'm by no means a coder. I would very much like to learn though.
Right now I'm trying to create a health regeneration cheat in a game where health does not regenerate.
The idea in this code is to assign the time we want to delay health regeneration after hit to FinishTime.
The code works with one significant issue. The whole game stops once the code gets to the delay loop and continues after the designated time.
As you can imagine this is not the result hoped for.
Anyone willing and/or able to help with this?
The final aim is to create a loop which will regenerate health little by little until health gets to max but before that I need to get this issue sorted out.
I've been learning little assembly while I've been doing some code injections with Cheat engine,
so I'm by no means a coder. I would very much like to learn though.
Right now I'm trying to create a health regeneration cheat in a game where health does not regenerate.
The idea in this code is to assign the time we want to delay health regeneration after hit to FinishTime.
The code works with one significant issue. The whole game stops once the code gets to the delay loop and continues after the designated time.
As you can imagine this is not the result hoped for.
Code: Select all
[ENABLE]
alloc(newmem,2048)
label(Wait)
label(DelayCode)
label(FinishTime)
label(returnhere)
label(originalcode)
label(exit)
newmem:
fst dword ptr [edi+00000118]
pushad
DelayCode:
call kernel32.GetTickCount
cmp [FinishTime],0
jne Wait
add eax, #15000
mov [FinishTime],eax
jmp DelayCode
Wait:
cmp eax,[FinishTime]
jb DelayCode
mov [edi+118],(float)200
mov [FinishTime],0
popad
jmp exit
FinishTime:
dd 0
originalcode:
fst dword ptr [edi+00000118]
exit:
jmp returnhere
"CLOS2.exe"+F7080:
jmp newmem
nop
returnhere:
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
"CLOS2.exe"+F7080:
fst dword ptr [edi+00000118]
//Alt: db CC 97 18 01 00 00
The final aim is to create a loop which will regenerate health little by little until health gets to max but before that I need to get this issue sorted out.