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 to find the base address using a 3 level pointer
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
mgostIH
Expert Cheater
Reputation: 3

Joined: 01 Jan 2016
Posts: 159

PostPosted: Sun Sep 18, 2016 1:07 pm    Post subject: Reply with quote

PanagiotisIatrou wrote:
-

You should put some std::cout<<std::hex<<final_addr<<std::endl in between the lines, so you can see where it's failing doing what it needs.

_________________
Do you need to ask me something? Feel free to join my discord server at: https://discord.gg/At4VZXA or ask me something in my YouTube channel: https://www.youtube.com/c/mgostIH
Back to top
View user's profile Send private message
PanagiotisIatrou
Newbie cheater
Reputation: 0

Joined: 17 Sep 2016
Posts: 13

PostPosted: Sun Sep 18, 2016 1:37 pm    Post subject: Reply with quote

mgostIH wrote:
PanagiotisIatrou wrote:
-

You should put some std::cout<<std::hex<<final_addr<<std::endl in between the lines, so you can see where it's failing doing what it needs.


I added it but now: Run-Time Check Failure #3 - The variable 'final_addr' is being used without being initialized. I am 100% sure it is initialized. I mean it is right in the previous line!
It is really becoming very strange :/
Back to top
View user's profile Send private message Send e-mail
kuntz
Cheater
Reputation: 0

Joined: 29 Aug 2016
Posts: 44
Location: Canada

PostPosted: Sun Sep 18, 2016 1:39 pm    Post subject: Reply with quote

PanagiotisIatrou wrote:
mgostIH wrote:
PanagiotisIatrou wrote:
-

You should put some std::cout<<std::hex<<final_addr<<std::endl in between the lines, so you can see where it's failing doing what it needs.


I added it but now: Run-Time Check Failure #3 - The variable 'final_addr' is being used without being initialized. I am 100% sure it is initialized. I mean it is right in the previous line!
It is really becoming very strange :/


It is not being initialized, here is your code:

Code:
DWORD final_addr;


You need to initialize the variable to some amount first or else when you use it, it will just be random.
Back to top
View user's profile Send private message
PanagiotisIatrou
Newbie cheater
Reputation: 0

Joined: 17 Sep 2016
Posts: 13

PostPosted: Sun Sep 18, 2016 1:47 pm    Post subject: Reply with quote

kuntz wrote:
PanagiotisIatrou wrote:
mgostIH wrote:
PanagiotisIatrou wrote:
-

You should put some std::cout<<std::hex<<final_addr<<std::endl in between the lines, so you can see where it's failing doing what it needs.


I added it but now: Run-Time Check Failure #3 - The variable 'final_addr' is being used without being initialized. I am 100% sure it is initialized. I mean it is right in the previous line!
It is really becoming very strange :/


It is not being initialized, here is your code:

Code:
DWORD final_addr;


You need to initialize the variable to some amount first or else when you use it, it will just be random.


Omg, please kill me....
However here it is:

Code:

DWORD final_addr = NULL;
                   DWORD temp_addr;
                   ReadProcessMemory(processHandle, (LPVOID)(0x04B20000 + 0x006E92AC), &final_addr, 4, NULL);
                   temp_addr = final_addr;
                  ReadProcessMemory(processHandle, (PVOID)(temp_addr + ammoOffsets[0]), &final_addr, 4, NULL);  // Here is when it fails: the next std::cout outputs 0 so as the second one
                  std::cout<<std::hex<<final_addr<<std::endl;
                   temp_addr = final_addr;
                  ReadProcessMemory(processHandle, (PVOID)(temp_addr + ammoOffsets[1]), &final_addr, 4, NULL);
std::cout<<std::hex<<final_addr<<std::endl;
                   //Now final_addr will be your desired address, you can write on it with WPM
                   DWORD value = 30;
                   WriteProcessMemory(processHandle, (PVOID)final_addr, &value, sizeof(value), NULL);
Back to top
View user's profile Send private message Send e-mail
kuntz
Cheater
Reputation: 0

Joined: 29 Aug 2016
Posts: 44
Location: Canada

PostPosted: Sun Sep 18, 2016 2:18 pm    Post subject: Reply with quote

Code:
DWORD final_addr = 0;
SIZE_T r = 0;
DWORD base_addr = get_base_addr("hw.dll");
int b = ReadProcessMemory(processHandle, (void*)(base_addr + 0x6E92ACUL), &final_addr, sizeof(DWORD), &r);
printf("b=%d\nr=%d\nbase_addr=%08X\nfinal_addr=%08X\n", b, r, base_addr, final_addr);


Try this code and see if the output matches what you are expecting from the 0x6E92AC memory address.
Back to top
View user's profile Send private message
PanagiotisIatrou
Newbie cheater
Reputation: 0

Joined: 17 Sep 2016
Posts: 13

PostPosted: Sun Sep 18, 2016 2:19 pm    Post subject: Reply with quote

PanagiotisIatrou wrote:
kuntz wrote:
PanagiotisIatrou wrote:
mgostIH wrote:
PanagiotisIatrou wrote:
-

You should put some std::cout<<std::hex<<final_addr<<std::endl in between the lines, so you can see where it's failing doing what it needs.


I added it but now: Run-Time Check Failure #3 - The variable 'final_addr' is being used without being initialized. I am 100% sure it is initialized. I mean it is right in the previous line!
It is really becoming very strange :/


It is not being initialized, here is your code:

Code:
DWORD final_addr;


You need to initialize the variable to some amount first or else when you use it, it will just be random.


Omg, please kill me....
However here it is:

Code:

DWORD final_addr = NULL;
                   DWORD temp_addr;
                   ReadProcessMemory(processHandle, (LPVOID)(0x04B20000 + 0x006E92AC), &final_addr, 4, NULL);
                   temp_addr = final_addr;
                  ReadProcessMemory(processHandle, (PVOID)(temp_addr + ammoOffsets[0]), &final_addr, 4, NULL);  // Here is when it fails: the next std::cout outputs 0 so as the second one
                  std::cout<<std::hex<<final_addr<<std::endl;
                   temp_addr = final_addr;
                  ReadProcessMemory(processHandle, (PVOID)(temp_addr + ammoOffsets[1]), &final_addr, 4, NULL);
std::cout<<std::hex<<final_addr<<std::endl;
                   //Now final_addr will be your desired address, you can write on it with WPM
                   DWORD value = 30;
                   WriteProcessMemory(processHandle, (PVOID)final_addr, &value, sizeof(value), NULL);


As you can see the first std::cout outputs 0 so as the second
Back to top
View user's profile Send private message Send e-mail
kuntz
Cheater
Reputation: 0

Joined: 29 Aug 2016
Posts: 44
Location: Canada

PostPosted: Sun Sep 18, 2016 3:00 pm    Post subject: Reply with quote

PanagiotisIatrou wrote:
As you can see the first std::cout outputs 0 so as the second


Just run my above code to see if that works. Your first std::cout doesn't tell us anything important.


Last edited by kuntz on Sun Sep 18, 2016 3:01 pm; edited 1 time in total
Back to top
View user's profile Send private message
PanagiotisIatrou
Newbie cheater
Reputation: 0

Joined: 17 Sep 2016
Posts: 13

PostPosted: Sun Sep 18, 2016 3:00 pm    Post subject: Reply with quote

kuntz wrote:


Try this code and see if the output matches what you are expecting from the 0x6E92AC memory address.


OMG THIS IS WORKING
Below is a screenshot that shows the output of the program you asked me to run
I got the final_addr from it, searched as HEX in Cheat Engine and now it showed me 11 results from which the 2 were static ( green ). I got the address of the first added that to my program which changes the value and now BOOM it works!!! Very Happy Very Happy
Big thanks to all that helped me find a solution for this! Very Happy
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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