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++ Console Trainer help.

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

Joined: 25 Aug 2014
Posts: 3

PostPosted: Mon Aug 25, 2014 7:33 am    Post subject: C++ Console Trainer help. Reply with quote

Hey guys,

Code:
DWORD pointed;
   WORD movSpeedOffset = 0x80;
   int currMovSpeed = 0;
   int movSpeedVal;

   ReadProcessMemory(hProc, (LPCVOID)(movSpeedptr), &pointed, sizeof(pointed), NULL);
   ReadProcessMemory(hProc, (LPCVOID)(pointed + movSpeedOffset), &currMovSpeed, sizeof(currMovSpeed), NULL);

   cout << "\nYour current movSpeed = " << currMovSpeed << endl << endl;

   cout << "Enter new movSpeed: " << endl;
   cin >> movSpeedVal;

   WriteProcessMemory(hProc, (LPVOID)(pointed + movSpeedOffset), &movSpeedVal, sizeof(movSpeedVal), NULL);


this is my main code.
it works well but to to get movSpeed to work properly i have to NOP it and not only changing its value because it resets if i dont NOP it.

so my question is how do i NOP it in c++?

thx in advance =)
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 Aug 25, 2014 1:05 pm    Post subject: Reply with quote

NOP in byte value 0x90, so just write 0x90 to the address that you need to nop. Be sure to write the proper amount of nops to completely overwrite the instruction or else you will land up crashing due to an invalid instruction.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
rlzgh
How do I cheat?
Reputation: 0

Joined: 25 Aug 2014
Posts: 3

PostPosted: Mon Aug 25, 2014 7:10 pm    Post subject: Reply with quote

thanks for your answer mate.

not sure if i understood correctly but shouldnt this work?

Code:

DWORD pointed;
BYTE timeNop = 0x90;

ReadProcessMemory(hProc, (LPCVOID)(timePtr), &pointed, sizeof(pointed), NULL);

WriteProcessMemory(hProc, (LPVOID)(pointed + timeOff), &timeNop, sizeof(timeNop), NULL);


cheers!
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 Aug 25, 2014 10:45 pm    Post subject: Reply with quote

That will only write 1 nop, if the instruction you are trying to nop is longer, then you need to write more than one.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
rlzgh
How do I cheat?
Reputation: 0

Joined: 25 Aug 2014
Posts: 3

PostPosted: Tue Aug 26, 2014 3:29 am    Post subject: Reply with quote

yes i just saw i need to nop 4 bytes. but it gives me a ridiculous amount of time value when i do this -_-.

could it be because the time value isnt just 50, 49, 48.. instead it looks like this. 645482XX, where XX is the actual time value?

thx for your answers mate!
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: Tue Aug 26, 2014 2:44 pm    Post subject: Reply with quote

Are you sure the time isn't stored in seconds or milliseconds?
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
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