nazo_dude How do I cheat?
Reputation: 0
Joined: 03 Jan 2016 Posts: 1 Location: Ing.
|
Posted: Sun Jan 03, 2016 9:12 pm Post subject: How can i find and change a #define value C++ |
|
|
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.
|
|
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Sun Jan 03, 2016 10:34 pm Post subject: |
|
|
#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. |
|