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 


[HELP] How to assert a maximum address value?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
Adrien
Cheater
Reputation: 0

Joined: 01 Aug 2012
Posts: 48

PostPosted: Sat Apr 12, 2014 2:45 pm    Post subject: [HELP] How to assert a maximum address value? Reply with quote

After a few months of leaving Mercenaries 2 alone from my Cheat-Engining, I finally figured out how to give the player +Inf amount of health. However, it shows up as a decimal something like 3.(place-random-numbers-here)E36, which is practically infinity. I tested my code and it worked for falls and such, but the effect for having health below 5 was enabled and if I threw a grenade I'd die. So I'm looking for some type of code that would tell the game to remain at maximum health, like how general value-freezing works.
Back to top
View user's profile Send private message Send e-mail
Rydian
Grandmaster Cheater Supreme
Reputation: 31

Joined: 17 Sep 2012
Posts: 1358

PostPosted: Sat Apr 12, 2014 4:41 pm    Post subject: Reply with quote

http://forum.cheatengine.org/viewtopic.php?p=5510987
_________________
Back to top
View user's profile Send private message
Adrien
Cheater
Reputation: 0

Joined: 01 Aug 2012
Posts: 48

PostPosted: Sat Apr 12, 2014 5:50 pm    Post subject: Reply with quote

Rydian wrote:
http://forum.cheatengine.org/viewtopic.php?p=5510987

That doesn't help me much at all... Could you perhaps elaborate on what you're trying to tell me?
Back to top
View user's profile Send private message Send e-mail
Rydian
Grandmaster Cheater Supreme
Reputation: 31

Joined: 17 Sep 2012
Posts: 1358

PostPosted: Sun Apr 13, 2014 1:18 am    Post subject: Reply with quote

Instead of trying to freeze your health within a specific range, just get the game to stop damaging your health in the first place?
_________________
Back to top
View user's profile Send private message
Adrien
Cheater
Reputation: 0

Joined: 01 Aug 2012
Posts: 48

PostPosted: Sun Apr 13, 2014 9:08 am    Post subject: Reply with quote

Rydian wrote:
Instead of trying to freeze your health within a specific range, just get the game to stop damaging your health in the first place?

According to the code here, I don't think there's much of any NOP'ing to do unless I want to completely break everything.
(text file hosted on mediafire)
http://www.mediafire.com/download/62rd5gwxcdr9o8r/mercs2healthop1.txt
Back to top
View user's profile Send private message Send e-mail
Rydian
Grandmaster Cheater Supreme
Reputation: 31

Joined: 17 Sep 2012
Posts: 1358

PostPosted: Mon Apr 14, 2014 1:13 am    Post subject: Reply with quote

That's too much crap.

What's the line that actually EDITS the health value in RAM?
Like, the one that does the sub/add or fsub/fadd or the write, whatever.

_________________
Back to top
View user's profile Send private message
Adrien
Cheater
Reputation: 0

Joined: 01 Aug 2012
Posts: 48

PostPosted: Mon Apr 14, 2014 6:45 am    Post subject: Reply with quote

the write instruction is at:
Mercenaries2.GMatrix2D::Swap+11F84A F3 0F11 40 04

And the write instruction is:
movss [eax+04],xmm0

But I can do adding and subbing operations using just mov and movss. For example, my code;
Code:
mov [eax],100 //re-evaluate eax from the past bits of code
movss xmm0,[eax] //placement of original code to see the effects
jna Mercenaries2.GMatrix2D::Swap+11F842
//the write instruction is further on in the script


From the write instruction, the xmm0 register is used to do the writing. So if I evaluate the xmm0 using eax (I legitimately have no idea how to directly evaluate xmm0), then the game will, using the operation in the original code, write my health as an extremely large number.
Back to top
View user's profile Send private message Send e-mail
Rydian
Grandmaster Cheater Supreme
Reputation: 31

Joined: 17 Sep 2012
Posts: 1358

PostPosted: Mon Apr 14, 2014 3:53 pm    Post subject: Reply with quote

Well movss is for dealing with a float, not an int, right?
_________________
Back to top
View user's profile Send private message
Adrien
Cheater
Reputation: 0

Joined: 01 Aug 2012
Posts: 48

PostPosted: Mon Apr 14, 2014 6:27 pm    Post subject: Reply with quote

Rydian wrote:
Well movss is for dealing with a float, not an int, right?

Yes, that is correct.
Back to top
View user's profile Send private message Send e-mail
AnthonysToolbox
Newbie cheater
Reputation: 1

Joined: 07 Dec 2013
Posts: 21

PostPosted: Tue Apr 15, 2014 1:31 am    Post subject: Reply with quote

HumanAI wrote:

Code:
mov [eax],100 //re-evaluate eax from the past bits of code



Just FYI, the way how you have it there... the 100 is actually in hex, so the decimal value you are writing is 256..... Just incase you thought it was doing something else, meaning the hex value it's writing is 00 01 00 00.

------------------------------
HumanAI wrote:
Rydian wrote:
Well movss is for dealing with a float, not an int, right?

Yes, that is correct.


So wouldn't you just write a float value? I've not had to use movss before, but there are times I run into doubles with movq.

Say for example there's an opcode I run into that's:
Code:
movq [ebp-38],xmm0


I generally modify it the worst possible way LOL. Like say I wanted to push a Double value of 20, Hex Field would look like 00 00 00 00 00 00 34 40.

MOV deals with 4byte ints, so the first 4 bytes would give an integer value of 0, the next 4 bytes (00 00 34 40) would give an integer value of 1077149696. I'd put stuff in like this:

Code:

mov [ebp-38],#0  //-Writes 00 00 00 00
mov [ebp-3C],#1077149696 //-Writes 00 00 34 40
//-- Also shift 38 to 3C to write to the other 4 bytes in the double.
//movq [ebp-38],xmm0 Comment out original incase I forget what I'm doing lol.


So with that said, if it truly writes to just one area and it is in a float, why not make it do a normal mov and just convert your Float Value to an Integer and make it push an integer?
Like Float 100 is : (Integer 1120403456) Or (hex 00 00 C8 42)

I know this is the worst way to push a double however it saves me 5 extra lines LOL and I'm a lazy pandabear when it comes to being formal and correct XDD.

So I reckon for you, you could do something like:

Code:
mov [eax+04],#1120403456
//-- Which would Write 00 00 C8 42 - Float 100
//movss [eax+04],xmm0


As I said, I only do it this way because I'm too lazy to care for specifics about formalities. If it gets the job done, I'm happy. :3
Back to top
View user's profile Send private message
Adrien
Cheater
Reputation: 0

Joined: 01 Aug 2012
Posts: 48

PostPosted: Tue Apr 15, 2014 9:09 am    Post subject: Reply with quote

I'll uhh... I'll read into that... Health in Mercenaries 2 is stored as a float, but when I use my code using 100 as an INT the value becomes -214....E36 or something like that. So the value is so large, it's negative. Yeah, it's "infinite" but it's not a static 100, which is what I want. If I NOP the write instruction, the value still gets changes whenever I test it, so NOPing is not an option.

I'll definitely change my code to #1120403456, though, and report as to how it goes. Thank you!

EDIT1: the code works, it has my health at a VERY static 100, which is nice, but it requires that the player have some 1-hit kill weapons on hand, like an anti-materiel rifle or a helicopter gunship rocket. Direct hits only, I'm afraid. This code not only affects the player, but every man, vehicle, and thingy thing. Objects use different code, which is also nice. Now I have to find what code tells the game to alter only the player's health when I do things like fall. This does not work under normal circumstances.
Code:
mov [eax+04],#1120403456 //evaluate the health pointer with (float)100
movss xmm0,[eax+04] //set up the write so the effects will be seen
movss [eax+04],xmm0 //write the solution
Back to top
View user's profile Send private message Send e-mail
AnthonysToolbox
Newbie cheater
Reputation: 1

Joined: 07 Dec 2013
Posts: 21

PostPosted: Tue Apr 15, 2014 11:42 am    Post subject: Reply with quote

If my computer was capable of running the game I'd give it a shot but looking at the specs, my computer would probably crash upon alt tabbing out to CE lol. I wish you well mate.
Back to top
View user's profile Send private message
Adrien
Cheater
Reputation: 0

Joined: 01 Aug 2012
Posts: 48

PostPosted: Tue Apr 15, 2014 11:54 am    Post subject: Reply with quote

Thank you for your help, anyway!
Back to top
View user's profile Send private message Send e-mail
Rydian
Grandmaster Cheater Supreme
Reputation: 31

Joined: 17 Sep 2012
Posts: 1358

PostPosted: Tue Apr 15, 2014 3:06 pm    Post subject: Reply with quote

One shortcut I use now for writing static floats in AA is...

Code:
mov xmm0,(float)100


Replace the 100 with whatever amount the health should be.

_________________
Back to top
View user's profile Send private message
AnthonysToolbox
Newbie cheater
Reputation: 1

Joined: 07 Dec 2013
Posts: 21

PostPosted: Tue Apr 15, 2014 7:07 pm    Post subject: Reply with quote

Rydian wrote:
One shortcut I use now for writing static floats in AA is...

Code:
mov xmm0,(float)100


Replace the 100 with whatever amount the health should be.


That's useful!!, if I come across any floats, I'll use this... why can't doubles be single lines like this. XD
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
Goto page 1, 2  Next
Page 1 of 2

 
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