I'm trying to make a super damage / one hit kill script but I've not been able to identify any structure values that allow me to distinguish between the player and enemies.
However I do know the pointer location of the player health.
Can I compare the address against that, and do nothing if it's the player?
My current Super Damage script, which affects the player as well:
push ecx
lea ecx,[fallen.exe+2B5DC8]
mov ecx,[ecx+24]
cmp eax,ecx
pop ecx
jne @f
cmp [health],1
jne code
sub [eax+C],0
mov eax,[esp+40]
jmp code
@@:
cmp [ohk],1
jne @f
sub [eax+0C],#199
mov eax,[esp+40]
jmp return
code:
sub [eax+0C],??? // Leave the original register that is being subtracted here
mov eax,[esp+40]
jmp return
There's a way to simplify the code but since you didn't provide much of the script information I cannot do it.
Also if you didn't want to have the health part for player then you can just remove the code starting with "cmp [health]..." And just before the "@@:"
push ecx
lea ecx,[fallen.exe+2B5DC8]
mov ecx,[ecx+24]
cmp eax,ecx
pop ecx
jne @f
cmp [health],1
jne code
sub [eax+C],0
mov eax,[esp+40]
jmp code
@@:
cmp [ohk],1
jne @f
sub [eax+0C],#199
mov eax,[esp+40]
jmp return
code:
sub [eax+0C],??? // Leave the original register that is being subtracted here
mov eax,[esp+40]
jmp return
There's a way to simplify the code but since you didn't provide much of the script information I cannot do it.
Also if you didn't want to have the health part for player then you can just remove the code starting with "cmp [health]..." And just before the "@@:"
[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,2048)
label(returnhere)
label(code)
label(newmem)
newmem: //this is allocated memory, you have read,write,execute access
//place your code here
push ecx
lea ecx,[fallen.exe+2B5DC8]
mov ecx,[ecx+24]
cmp eax,ecx
pop ecx
jne @f
cmp [health],1
jne code
sub [eax+C],0
mov eax,[esp+40]
jmp code
@@:
cmp [ohk],1
jne @f
sub [eax+0C],#200
mov eax,[esp+40]
jmp returnhere
code:
sub [eax+0C],dx // Leave the original register that is being subtracted here
mov eax,[esp+40]
jmp returnhere
"fallen.exe"+111B7:
jmp newmem
nop 3
returnhere:
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
"fallen.exe"+111B7:
sub [eax+0C],dx
mov eax,[esp+40]
[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,2048)
label(returnhere)
label(code)
label(newmem)
label(health) // health label
label(ohk) // ohk label
registersymbol(health) // health symbol registered
registersymbol(ohk) // ohk symbol registered
newmem: //this is allocated memory, you have read,write,execute access
//place your code here
push ecx
lea ecx,[fallen.exe+2B5DC8]
mov ecx,[ecx+24]
cmp eax,ecx
pop ecx
jne @f
cmp [health],1
jne code
sub [eax+C],0
mov eax,[esp+40]
jmp code
@@:
cmp [ohk],1
jne @f
sub [eax+0C],#200
mov eax,[esp+40]
jmp returnhere
code:
sub [eax+0C],dx // Leave the original register that is being subtracted here
mov eax,[esp+40]
jmp returnhere
health: // defining health symbol
dd 0
ohk: // defining ohk symbol
dd 0
"fallen.exe"+111B7:
jmp newmem
nop 3
returnhere:
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
"fallen.exe"+111B7:
sub [eax+0C],dx
mov eax,[esp+40]
dealloc(newmem)
unregistersymbol(health) // unregister health symbol
unregistersymbol(ohk) // unregister ohk symbol
Then you would have two separate extra scripts that go like this:
Hmm, not sure what's wrong but it says "Not all instructions could be injected"
Do an AOB Injection template, they're easier and more reliable. If you paste the template here (without any modified code) I can edit it for you to show you how it should be.
Ok that now activates, but the infinite health doesn't work. The one hit kill works - but also kills the player. And the player infinite health doesn't work with or without the one hit kill.
Ok that now activates, but the infinite health doesn't work. The one hit kill works - but also kills the player. And the player infinite health doesn't work with or without the one hit kill.
Try changing "lea" to "mov" and seeing if that works.