|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
mgostIH Expert Cheater Reputation: 3
Joined: 01 Jan 2016 Posts: 159
|
Posted: Sun Sep 18, 2016 1:07 pm Post subject: |
|
|
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. _________________
|
|
Back to top |
|
|
PanagiotisIatrou Newbie cheater Reputation: 0
Joined: 17 Sep 2016 Posts: 13
|
Posted: Sun Sep 18, 2016 1:37 pm Post subject: |
|
|
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 |
|
|
kuntz Cheater Reputation: 0
Joined: 29 Aug 2016 Posts: 44 Location: Canada
|
Posted: Sun Sep 18, 2016 1:39 pm Post subject: |
|
|
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:
You need to initialize the variable to some amount first or else when you use it, it will just be random. |
|
Back to top |
|
|
PanagiotisIatrou Newbie cheater Reputation: 0
Joined: 17 Sep 2016 Posts: 13
|
Posted: Sun Sep 18, 2016 1:47 pm Post subject: |
|
|
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:
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 |
|
|
kuntz Cheater Reputation: 0
Joined: 29 Aug 2016 Posts: 44 Location: Canada
|
Posted: Sun Sep 18, 2016 2:18 pm Post subject: |
|
|
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 |
|
|
PanagiotisIatrou Newbie cheater Reputation: 0
Joined: 17 Sep 2016 Posts: 13
|
Posted: Sun Sep 18, 2016 2:19 pm Post subject: |
|
|
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:
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 |
|
|
kuntz Cheater Reputation: 0
Joined: 29 Aug 2016 Posts: 44 Location: Canada
|
Posted: Sun Sep 18, 2016 3:00 pm Post subject: |
|
|
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 |
|
|
PanagiotisIatrou Newbie cheater Reputation: 0
Joined: 17 Sep 2016 Posts: 13
|
Posted: Sun Sep 18, 2016 3:00 pm Post subject: |
|
|
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!!!
Big thanks to all that helped me find a solution for this! |
|
Back to top |
|
|
|
|
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
|
|