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 


How can i find and change a #define value C++

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

Joined: 03 Jan 2016
Posts: 1
Location: Ing.

PostPosted: Sun Jan 03, 2016 9:12 pm    Post subject: How can i find and change a #define value C++ Reply with quote

HELLO, i need help for this
i made a executable with C++
this is the source code of the executable I made in C++ using Visual Studio
Code:

#include "stdafx.h"

#include <iostream>


using namespace std;

#define SOMEVALUE 50
#define SOMETEXT "HELLO"
#define SOMEVALUE2            (SOMEVALUE)
 
#define X_VAL   12800
float upmove[3] = {0x19, 0x32,0x18};   
float sidemove[3] = {0x18, 0x28,0x19};   

int main() {
   

    int cond1=1;
   while (cond1==1)
   {
         cout << "current values are :" << endl;
         cout << "SOMEVALUE :" <<SOMEVALUE<< endl;
         cout << "SOMEVALUE2 :" <<SOMEVALUE2<< endl;
         cout << "X_VAL :" <<X_VAL<< endl;
         cout << typeid(X_VAL).name() << '\n';
         cout << "ELTEXTO :" <<SOMETEXT<< endl;
         cout << typeid(SOMETEXT).name() << '\n';
         printf("\n\nPress 1 \n");
         cin >>cond1;
   }

    return 0;

}


with cheat engine. I could find and change the values of "upmove", "sidemove" and "sometext", with value type float and string. But I can't find the "x_val 12800"

I found multiple values 12800 with 2/4/8 bytes, but none changed the x_val

Another question, how can I make the changes permanent? Every time that I find the address with Ollydbg, I just find commands like sub [eax],al" or "add [eax],al" same with cheat engine in "browse this memory region"

Im new in this and sorry for my english.
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: Sun Jan 03, 2016 10:34 pm    Post subject: Reply with quote

#define values are handled at compile time and will be replaced at where they are used, inline. They will not appear in memory like how they are in code since they are not kept in a block.

Depending on your compiler as well, upmove/sidemove will get compiled out of the code since they are never referenced as well.

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