View previous topic :: View next topic |
Author |
Message |
torin555 How do I cheat?
Reputation: 0
Joined: 27 Apr 2015 Posts: 7
|
Posted: Mon Apr 27, 2015 9:46 pm Post subject: Make a value unable to go below a certain point. |
|
|
So basically I'm trying to create an advanced sort of god mode. I want to make it so the health value can go down and up, but can't go below 1. Is that possible? And if so how would I do it? |
|
Back to top |
|
 |
Geri Moderator
Reputation: 111
Joined: 05 Feb 2010 Posts: 5636
|
Posted: Mon Apr 27, 2015 9:57 pm Post subject: |
|
|
Yes, but it's complicated. You need to make a script to compare the value to x, then not allow to decrease it lower. But if you set the minimum value to 1, you will probably die instantly from any damage, which is why you probably have to waste more time with hooking other functions to prevent you from getting instakilled. _________________
|
|
Back to top |
|
 |
torin555 How do I cheat?
Reputation: 0
Joined: 27 Apr 2015 Posts: 7
|
Posted: Mon Apr 27, 2015 10:15 pm Post subject: |
|
|
Geri wrote: | Yes, but it's complicated. You need to make a script to compare the value to x, then not allow to decrease it lower. But if you set the minimum value to 1, you will probably die instantly from any damage, which is why you probably have to waste more time with hooking other functions to prevent you from getting instakilled. |
That would be true in most games yes, however in the specific game I'm doing this for taking lethal damage with a frozen HP value doesn't kill you. |
|
Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Mon Apr 27, 2015 10:26 pm Post subject: |
|
|
Find out what instructions access your address when taking normal damage and NOP it.
Then, find out what accesses it when taking lethal damage. NOP the new instruction that appears.
If a new instruction didn't appear, examine the found instructions that do a CMP shortly after accessing your address.
Trace that instruction and see if it is comparing it against the damage inflicted.
It is likely checking if it is greater than your health, JMP to a new block of code that causes instant death.
NOP that JMP so it never makes its way there. |
|
Back to top |
|
 |
torin555 How do I cheat?
Reputation: 0
Joined: 27 Apr 2015 Posts: 7
|
Posted: Mon Apr 27, 2015 10:47 pm Post subject: |
|
|
Zanzer wrote: | Find out what instructions access your address when taking normal damage and NOP it.
Then, find out what accesses it when taking lethal damage. NOP the new instruction that appears.
If a new instruction didn't appear, examine the found instructions that do a CMP shortly after accessing your address.
Trace that instruction and see if it is comparing it against the damage inflicted.
It is likely checking if it is greater than your health, JMP to a new block of code that causes instant death.
NOP that JMP so it never makes its way there. |
I'm not very experienced with Hex editing or anything like that, so forgive me if I didn't understand exactly what you mean, but if I do I think what you're saying is to stop the function that deals damage to you from happening, and then stop a lethal damage instant kill, in regards to the first thing, if I wanted to just stop it from dealing damage to me completely I can just freeze my HP value, but my goal is to allow the HP to move up and down but stop it from going below 1, as to stopping an instant death from lethal damage, like I said in my last post taking lethal damage with a frozen HP value doesn't cause a death. |
|
Back to top |
|
 |
Geri Moderator
Reputation: 111
Joined: 05 Feb 2010 Posts: 5636
|
Posted: Tue Apr 28, 2015 7:20 am Post subject: |
|
|
You have to make a script like this:
cmp [health_address],1
jle originalcode
change health
originalcode:
blablabla _________________
|
|
Back to top |
|
 |
Fresco Grandmaster Cheater
Reputation: 4
Joined: 07 Nov 2010 Posts: 600
|
Posted: Tue Apr 28, 2015 10:01 am Post subject: |
|
|
Probably best to compare the value that is written.
ebx+4 = health_address
original code:
mov [ebx+4],edx
instead of:
cmp [ebx+4],1
do:
Code: | cmp edx,1
jae originalcode
mov [ebx+4],#maxhpval
jmp exit
originalcode:
mov [ebx+4],edx
exit:
jmp returnhere
|
_________________
... Fresco |
|
Back to top |
|
 |
torin555 How do I cheat?
Reputation: 0
Joined: 27 Apr 2015 Posts: 7
|
Posted: Tue Apr 28, 2015 12:12 pm Post subject: |
|
|
Fresco wrote: | Probably best to compare the value that is written.
ebx+4 = health_address
original code:
mov [ebx+4],edx
instead of:
cmp [ebx+4],1
do:
Code: | cmp edx,1
jae originalcode
mov [ebx+4],#maxhpval
jmp exit
originalcode:
mov [ebx+4],edx
exit:
jmp returnhere
|
|
So what would I change in that to make it work with the adresses I have? And where would I put it? |
|
Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Tue Apr 28, 2015 2:33 pm Post subject: |
|
|
Right-click your health address and select Find out what writes to this address
Get hit in game, then select the instruction that pops up and click Show disassembler
In Memory Viewer, select Tools > Auto Assemble
In Auto assemble, select Template > Cheat Table framework code
Now select Template > AOB Injection
Accept the default prompts
Post the generated code within [code][/code] tags |
|
Back to top |
|
 |
|