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 


finding code where temporary(stack) variable is written to

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

Joined: 16 Jun 2012
Posts: 4

PostPosted: Sat Jun 16, 2012 12:05 pm    Post subject: finding code where temporary(stack) variable is written to Reply with quote

so I'm trying to give my character in the game(Magicka) infinite health which is easy but if an enemy does damage that's over my total health it kills me. I figure that in the code that checks if I'm dead uses a temporary variable to store the player_health - damage value. if that value is negative then it kills me. I'm not sure how to find that bit of code.

also, the same code that handles the player damage also handles the enemy damage so when I replace fld [...] with fldz(code that pushes the damage onto the float stack) I can't kill them unless I do more damage to them than they have health Razz I need a way around that too(open to any ideas here). I figure there is some bit of distinguishing data that I can access. It's written in C# but the code is JIT compiled so code injection still works. is anyone familiar with the C# object model? where is the v-table stored(so that I can conditionally check for the player class's v-table)?
Back to top
View user's profile Send private message
Fresco
Grandmaster Cheater
Reputation: 4

Joined: 07 Nov 2010
Posts: 600

PostPosted: Sat Jun 16, 2012 12:49 pm    Post subject: Reply with quote

why don't you give us the instruction that decreases yours and you enemy's health ?

in the last step of cheat engine 6.2 you can find a tutorial about that.

if you have found the address that, if it's with -, you die, then check what code writes to it and nop it, that should do the trick.

_________________
... Fresco
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25835
Location: The netherlands

PostPosted: Sat Jun 16, 2012 12:55 pm    Post subject: Reply with quote

Usually in object oriented programs the vtable pointer is stored as the first or second element of the class. Often ECX contains a pointer to the class
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
ishkabible
How do I cheat?
Reputation: 0

Joined: 16 Jun 2012
Posts: 4

PostPosted: Sat Jun 16, 2012 1:49 pm    Post subject: Reply with quote

ok I figured a way to stop the game from resetting my health to 1000. so now I can raise my health high enough that no enemy can kill me in 1 hit. not what I wanted but it seems like it should do the job. unfortunately about 1/3rd the time a certain enemy casts a certain spell that hits me it kills me anyway. I have no clue how to begin to tackle that :/

Quote:
why don't you give us the instruction that decreases yours and you enemy's health ?

I would but I'm not quite sure how to copy a significant amount of the code to my clipboard. also, the function this is in seems very long. I can't find the prolog(push ebp, etc...) or epiloge(pop ebp, ret, etc...) it's several hundred instructions long.

Quote:
Usually in object oriented programs the vtable pointer is stored as the first or second element of the class. Often ECX contains a pointer to the class


how do I view the value ECX at a certain point in the code? and how can I identify which value is the vtable? perhaps I could see what access the address and if an element of it is called then I can be pretty sure it's a vtable.
Back to top
View user's profile Send private message
Fresco
Grandmaster Cheater
Reputation: 4

Joined: 07 Nov 2010
Posts: 600

PostPosted: Mon Jun 18, 2012 2:56 am    Post subject: Reply with quote

ishkabible wrote:
[...]how do I view the value ECX at a certain point in the code?[...]

go in memory viewer right click the instruction before the instruction you want to know: what ecx is equal to: and click break and trace, give 3 instructions to track, go in game, make it execute the instructions, go back in ce and you'll see a window with 3 instructions, the one before yours and one after, in the right of that window after you click an instruction you'll see the registers and their respective values.

Fresco wrote:
why don't you give us the instruction that decreases yours and you enemy's health ?

usually you find the health address, then find the one code that decreases it, i was wondering why don't you give us that piece of code, some instructions 3/4 before and after it.

_________________
... Fresco
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