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 


[Solved] Getting memory adress from c++ program

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

Joined: 19 May 2024
Posts: 2

PostPosted: Sun May 19, 2024 11:47 am    Post subject: [Solved] Getting memory adress from c++ program Reply with quote

I've made a simple program in C++ using Visual Studio, which i built and ran.
Code:

#include <iostream>
#include <windows.h>

using namespace std;

int y;

int main() {
    y = 100;  // Allowed (public)
    while (true) {
        y -= 1;
        cout << y << '\n';
        Sleep(3000);
    }
    return 0;
}


I've then used CE to hook to it and tried searching for the first of y ( 99 ) and then waiting 3 seconds and searching for the next value ( 98 ) . The first search returned many results, but the second returned none. I've seen a youtuber do this exact thing and it worked well for him, but it doesn't work for me.
I'm just trying to use CE to change the value of the y variable.


Last edited by Horix21 on Mon May 20, 2024 1:02 am; edited 1 time in total
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Sun May 19, 2024 1:52 pm    Post subject: Reply with quote

make sure you attach to the process, not the window/application as visual studio has the output in a different process

also disable optimizations.

the compiler may have optimized int y away to be local as nothing else uses it. (try volatile int y; instead)

_________________
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
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4714

PostPosted: Sun May 19, 2024 1:58 pm    Post subject: Reply with quote

You probably attached to the console and not the program being run. When attaching to something, look at "Processes," not "Windows" or "Applications."
_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Horix21
How do I cheat?
Reputation: 0

Joined: 19 May 2024
Posts: 2

PostPosted: Mon May 20, 2024 1:01 am    Post subject: Reply with quote

ParkourPenguin wrote:
You probably attached to the console and not the program being run. When attaching to something, look at "Processes," not "Windows" or "Applications."

That worked! Thank you so much!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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