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 


[C++] How do I change the EAX in C++?

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

Joined: 12 Oct 2015
Posts: 1

PostPosted: Mon Oct 12, 2015 9:53 am    Post subject: [C++] How do I change the EAX in C++? Reply with quote

Hey, trying to make a hack, but I need to change the EAX of an address. How do I accomplish that? I'm pretty new to C++ so I have no idea how. Embarassed
_________________
~Ice
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Mon Oct 12, 2015 12:21 pm    Post subject: Reply with quote

GetThreadContext
SetThreadContext

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
STN
I post too much
Reputation: 43

Joined: 09 Nov 2005
Posts: 2676

PostPosted: Mon Oct 12, 2015 1:10 pm    Post subject: Reply with quote

Whats the obsession with debugging from C++ lol

Write an AA script that will change eax, its as simple as

mov eax, #99999

get the bytes for that instruction, call WriteProcessMemory with those bytes and address. DONE

If you don't understand this, read code injection tutorials and get my c++ trainer template (very basic and newb friendly)

http://deviatedhacking.com/topic/832-c-trainer-templates/

_________________
Cheat Requests/Tables- Fearless Cheat Engine
https://fearlessrevolution.com
Back to top
View user's profile Send private message
ThereIsNoSpoon
How do I cheat?
Reputation: 0

Joined: 27 Oct 2015
Posts: 8
Location: DWORD PTR

PostPosted: Sun Nov 01, 2015 3:25 pm    Post subject: Reply with quote

This is not an obsession, its all about the beauty of hacking and reverse engeenering craft Smile
Back to top
View user's profile Send private message
n0psl3d
How do I cheat?
Reputation: 0

Joined: 30 Sep 2015
Posts: 6
Location: Twin Cities, MN

PostPosted: Mon Nov 09, 2015 4:45 pm    Post subject: Re: [C++] How do I change the EAX in C++? Reply with quote

Iceworthy wrote:
Hey, trying to make a hack, but I need to change the EAX of an address. How do I accomplish that? I'm pretty new to C++ so I have no idea how. Embarassed


My understanding is that what you are actually asking doesn't make sense, and atm0s just gave you the correct answer to the question you should've been asking.

I'll give you a small Operating Systems lesson for funsies.

EAX is a register that is held by the context of each thread (process) your OS is running. While threads are suspended you can get the current context of that thread via the WINAPI function that atm0s stated above. Then you can modify the EAX value in the Context datastructure it returns then shove it back in with the modified value. The documentation I looked at specified that the thread must be suspended, and regardless I would have told you to suspend the thread beforehand anyways. If the thread was running between your context get/set (which I'm not sure how that would even be retrieved anyways) then potentially other values such as your instruction pointer would be changed back when you set the context which would completely futz with the threads intended behavior.
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 programming 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