 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Renard10177 Newbie cheater
Reputation: 0
Joined: 19 Jun 2013 Posts: 12
|
Posted: Tue Oct 08, 2013 9:13 pm Post subject: Conditional Nop |
|
|
I wanted to make a code that nop's a certain address if the value is greater than or equal to 100, problem is, it nop's it no matter what
| Code: | [ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)
label(nopit)
newmem: //this is allocated memory, you have read,write,execute access
//place your code here
cmp [10353754],0064
jge nopit
jmp originalcode
nopit:
nop
nop
nop
nop
nop
nop
jmp exit
originalcode:
fstp dword ptr [eax+00000160]
exit:
jmp returnhere
"hl.dll"+184D5:
jmp newmem
nop
returnhere:
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
"hl.dll"+184D5:
fstp dword ptr [eax+00000160]
//Alt: db D9 98 60 01 00 00 |
I think the problem is that it's checking the 4-byte value of the address, but I need it to check the float value, how do i do this? (the code is for half-life: blue shift, btw) |
|
| Back to top |
|
 |
mgr.inz.Player I post too much
Reputation: 222
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Thu Oct 10, 2013 11:41 am Post subject: |
|
|
original code is:
fstp dword ptr [eax+00000160]
You can not just nop FPU commands, commands that changes stack state.
So, all FSTP, FISTP, FDIVP, FDIVRP, FMULP, FADDP, etc. can not be just nopped.
Another thing, this address: 10353754, will be only valid until you shutdown HL. After you launch game again, HP will be at different address.
Lastly. Half-Life game stores HP as single floating-point value (single, float). For those you have to use:
- FPU compare
- or SSE compare
- or MMX compare
Or, if values are always bigger or equal to zero, you can use this:
cmp [address],(float)100.0
or
cmp [address],42C80000
(0x42C80000 == 100.0 float) _________________
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|