Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Make a value unable to go below a certain point.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
torin555
How do I cheat?
Reputation: 0

Joined: 27 Apr 2015
Posts: 7

PostPosted: Mon Apr 27, 2015 9:46 pm    Post subject: Make a value unable to go below a certain point. Reply with quote

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
View user's profile Send private message
Geri
Moderator
Reputation: 111

Joined: 05 Feb 2010
Posts: 5636

PostPosted: Mon Apr 27, 2015 9:57 pm    Post subject: Reply with quote

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.
_________________
My trainers can be found here: http://www.szemelyesintegracio.hu/cheats

If you are interested in any of my crappy articles/tutorials about CE and game hacking, you can find them here:
http://www.szemelyesintegracio.hu/cheats/41-game-hacking-articles

Don't request cheats or updates.
Back to top
View user's profile Send private message
torin555
How do I cheat?
Reputation: 0

Joined: 27 Apr 2015
Posts: 7

PostPosted: Mon Apr 27, 2015 10:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Mon Apr 27, 2015 10:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
torin555
How do I cheat?
Reputation: 0

Joined: 27 Apr 2015
Posts: 7

PostPosted: Mon Apr 27, 2015 10:47 pm    Post subject: Reply with quote

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
View user's profile Send private message
Geri
Moderator
Reputation: 111

Joined: 05 Feb 2010
Posts: 5636

PostPosted: Tue Apr 28, 2015 7:20 am    Post subject: Reply with quote

You have to make a script like this:

cmp [health_address],1
jle originalcode
change health

originalcode:
blablabla

_________________
My trainers can be found here: http://www.szemelyesintegracio.hu/cheats

If you are interested in any of my crappy articles/tutorials about CE and game hacking, you can find them here:
http://www.szemelyesintegracio.hu/cheats/41-game-hacking-articles

Don't request cheats or updates.
Back to top
View user's profile Send private message
Fresco
Grandmaster Cheater
Reputation: 4

Joined: 07 Nov 2010
Posts: 600

PostPosted: Tue Apr 28, 2015 10:01 am    Post subject: Reply with quote

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
View user's profile Send private message
torin555
How do I cheat?
Reputation: 0

Joined: 27 Apr 2015
Posts: 7

PostPosted: Tue Apr 28, 2015 12:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Tue Apr 28, 2015 2:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites