Thumbs upSolvedBase Addresses are Shit

Posts 115 of 17 · Page 1 of 2
Base Addresses are Shit
Okay I discovered a pointer which is like "AVA.exe"+012AB00 and It points to certain address every time i restart the game , so the "AVA.exe" has a base address I discovered it and it's 0x400000 and when i calculated 0x400000+0x012AB00 as an example it gives me an address which is 0x013A1500

When i try to discover it in CE I copy AVA.exe+the addres and i go to memory view then Ctrl + G then paste it and press Enter it gives me the same address which is 0x013A1500 but When i code it in C++ to know what the pointer points to and write to it it points to wrong address.

I tried another things like CreateToolhelp32Snapshot / Process32First / Process32Next to see if the AVA base address is wrong and i saw it's right.

here's my code :
Code:
 #include <iostream>
 #include <windows.h>
 #include <string>
 #include <tlhelp32.h>
#include <tchar.h> 
using namespace std;
// FindWindow();
// GetWindowsThreadProcessId();
// OpenProcess();
// WriteProcessMemory();
// CloseHandle();

int main()  
{   
    SetConsoleTitleA("Nickname Changer");
    HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
    SetConsoleTextAttribute(hConsole, FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY | COMMON_LVB_UNDERSCORE);
   HWND hWnd = FindWindow(0, _T("Alliance of Valiant Arms"));
   if(hWnd == 0)
   {
      cerr << "Unable to find the window" << endl;
   }
   else{
  clog << "Found Window" << endl;
  DWORD PId;
  DWORD processID = GetWindowThreadProcessId(hWnd, &PId);
  HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, PId);
  if (!hProcess){
  cerr << "Unable to Open Process" << endl;
  }
  else{
  clog << "Opened Process" << endl; 
  wchar_t newvalue[19];
  DWORD Game = 0x400000;
  DWORD Base = 0x000000;
  DWORD Pointer = *(DWORD*)(Game + Base);
  DWORD Pointed;
  DWORD Pointed1;
  DWORD Offset[2] = {0x90, 0x24};
  char newval[19];
  ReadProcessMemory(hProcess, (LPCVOID)Pointer, &Pointed, sizeof(wchar_t), NULL);
  ReadProcessMemory(hProcess, (LPCVOID)(Pointed+Offset), &Pointed1, sizeof(wchar_t), NULL);
  ReadProcessMemory(hProcess, (LPCVOID)Pointed1, &newval, sizeof(wchar_t), NULL);
  cout << "Your current nickname is: " << newval << endl;;
  cout << "Enter the new nickname: ";
  wcin >> newvalue;
  int isSuccessful = WriteProcessMemory(hProcess, (LPVOID)Pointed1, &newvalue , (DWORD)sizeof(newvalue), NULL);
  if(isSuccessful > 0){
  clog << "Process Memory Written" << endl;
  }else{
      cerr << "Cannot write process memory." << endl;
  }
  }
  }
 char cls;
 cout << "Wanna change the Nickname again? (y) or (n)" << endl;
 cin >> cls;
 while(cls){
 switch(cls){
 case 'y':  
 system("CLS");
 return main();
 break;
 case 'n':
 return 0;
 break;
 case 'Y':
 system("CLS");
 return main();
 break;
 case 'N':
return 0;
 default:
 return 0;
 break;
 }
 }
 system("PAUSE");
return main();
}


---------- Post added at 02:09 PM ---------- Previous post was at 01:23 PM ----------

I tried to read the pointer which is AVA.exe + 000000 to this
Code:
 DWORD address = (DWORD)GetModuleHandle(_T("AVA.exe")) + 0x00FA1500;
address = *(DWORD*)address + 0x90;
address = *(DWORD*)address + 0x24;


so my code became like this
Code:
 #include <iostream>
 #include <windows.h>
 #include <string>
 #include <tlhelp32.h>
#include <tchar.h> 
using namespace std;
// FindWindow();
// GetWindowsThreadProcessId();
// OpenProcess();
// WriteProcessMemory();
// CloseHandle();

int main()  
{   
    SetConsoleTitleA("Nickname Changer");
    HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
    SetConsoleTextAttribute(hConsole, FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY | COMMON_LVB_UNDERSCORE);
   HWND hWnd = FindWindow(0, _T("Alliance of Valiant Arms"));
   if(hWnd == 0)
   {
      cerr << "Unable to find the window" << endl;
   }
   else{
  clog << "Found Window" << endl;
  DWORD PId;
  DWORD processID = GetWindowThreadProcessId(hWnd, &PId);
  HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, PId);
  if (!hProcess){
  cerr << "Unable to Open Process" << endl;
  }
  else{
  clog << "Opened Process" << endl; 
  wchar_t newvalue[19];
 DWORD address = (DWORD)GetModuleHandle(_T("AVA.exe")) + 0x00FA1500;
address = *(DWORD*)address + 0x90;
address = *(DWORD*)address + 0x24;
  DWORD Pointed;
  DWORD Pointed1;
  DWORD Offset[2] = {0x90, 0x24};
  char newval[19];
  ReadProcessMemory(hProcess, (LPCVOID)address, &Pointed, sizeof(wchar_t), NULL);
  ReadProcessMemory(hProcess, (LPCVOID)Pointed, &newval, sizeof(wchar_t), NULL);
  cout << "Your current nickname is: " << newval << endl;;
  cout << "Enter the new nickname: ";
  wcin >> newvalue;
  int isSuccessful = WriteProcessMemory(hProcess, (LPVOID)Pointed, &newvalue , (DWORD)sizeof(newvalue), NULL);
  if(isSuccessful > 0){
  clog << "Process Memory Written" << endl;
  }else{
      cerr << "Cannot write process memory." << endl;
  }
  }
  }
 char cls;
 cout << "Wanna change the Nickname again? (y) or (n)" << endl;
 cin >> cls;
 while(cls){
 switch(cls){
 case 'y':  
 system("CLS");
 return main();
 break;
 case 'n':
 return 0;
 break;
 case 'Y':
 system("CLS");
 return main();
 break;
 case 'N':
return 0;
 default:
 return 0;
 break;
 }
 }
 system("PAUSE");
return main();
}
but when i compile it gives me access error.
> GetModuleHandle(_T("AVA.exe"))

That only works if the module is loaded into your console app.
Quote Originally Posted by master131 View Post
> GetModuleHandle(_T("AVA.exe"))

That only works if the module is loaded into your console app.
I know the game base address , but the pointer points to wrong address.
When i use the address that the pointer points to it works , so idk what is the problem (this is nick name changer and it's unicode).
Quote Originally Posted by [D]opeDog View Post

I know the game base address , but the pointer points to wrong address.
When i use the address that the pointer points to it works , so idk what is the problem (this is nick name changer and it's unicode).
Your code is wrong, you're dereferencing the address locally and whatnot. Not to mention you're reading the wrong data size, a pointer/DWORD (4 bytes) is not a sizeof(wchar_t) which 2. You should seriously read more C++ tutorials in the future. Also your code looks really messy and it's not even indented properly.

Code:
// Read the craps.
DWORD address = 0x013A1500, value;
ReadProcessMemory(hProcess, (LPCVOID)address, &value, 4, NULL);
ReadProcessMemory(hProcess, (LPCVOID)(value + 0x90), &value, 4, NULL);
value += 0x24;

// Write the craps.
WriteProcessMemory(hProcess, (LPCVOID)value, &newvalue, (wcslen(newvalue) + 1) * 2, NULL);
Also, WPM returns a BOOL which is a typedef for an int. You don't need to do a bigger than zero check, if you just do:
Code:
if(WriteProcessMemory(hProcess, (LPCVOID)value, &newvalue, (wcslen(newvalue) + 1) * 2, NULL))
it will work because C++ treats non-zero values as true. It will also save the need of having a useless variable there.
Quote Originally Posted by master131 View Post
Your code is wrong, you're dereferencing the address locally and whatnot. Not to mention you're reading the wrong data size, a pointer/DWORD (4 bytes) is not a sizeof(wchar_t) which 2. You should seriously read more C++ tutorials in the future. Also your code looks really messy and it's not even indented properly.

Code:
// Read the craps.
DWORD address = 0x013A1500, value;
ReadProcessMemory(hProcess, (LPCVOID)address, &value, 4, NULL);
ReadProcessMemory(hProcess, (LPCVOID)(value + 0x90), &value, 4, NULL);
value += 0x24;

// Write the craps.
WriteProcessMemory(hProcess, (LPCVOID)value, &newvalue, (wcslen(newvalue) + 1) * 2, NULL);
Also, WPM returns a BOOL which is a typedef for an int. You don't need to do a bigger than zero check, if you just do:
Code:
if(WriteProcessMemory(hProcess, (LPCVOID)value, &newvalue, (wcslen(newvalue) + 1) * 2, NULL))
it will work because C++ treats non-zero values as true. It will also save the need of having a useless variable there.
It tried it by using sizeof(wchar_t) or sizeof(newvalue) but i didn't work

I used another way my friend told me it and i got this error : Access violation reading location .....


---------- Post added at 02:52 PM ---------- Previous post was at 02:48 PM ----------

Here is my new code:
Code:
 #include <iostream>
 #include <windows.h>
 #include <string>
 #include <tlhelp32.h>
#include <tchar.h> 
//Defines
#define GameBase  0x400000
#define Address  0x00FA1500     
#define Offs1 90
#define Offs2 24
     
    //Code

using namespace std;


int main()  
{   
	SetConsoleTitleA("Nickname Changer");
	HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
	SetConsoleTextAttribute(hConsole, FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY | COMMON_LVB_UNDERSCORE);
   HWND hWnd = FindWindow(0, L"Alliance of Valiant Arms");
   if(hWnd == 0)
   {
	  cerr << "Unable to find the window" << endl;
   }
   else{
  clog << "Found Window" << endl;
  DWORD PId;
  DWORD processID = GetWindowThreadProcessId(hWnd, &PId);
  HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, PId);
  if (!hProcess){
  cerr << "Unable to Open Process" << endl;
  }
  else{
  clog << "Opened Process" << endl; 
 wchar_t newvalue[19];
 // Read the craps.
char Name[32];
 DWORD Pointer = *(DWORD*)GameBase + *(DWORD*)Address;
 Pointer = Pointer + *(DWORD*)Offs1;
 Pointer = Pointer + *(DWORD*)Offs2;
 DWORD Pointed;
  ReadProcessMemory(hProcess, (LPCVOID)Pointer, &Pointed, sizeof(wchar_t), NULL);
  ReadProcessMemory(hProcess, (LPCVOID)Pointed, &Name, sizeof(wchar_t), NULL);
  clog << "Your current nickname is: " << *(wchar_t*)Name << endl;
  clog << "Enter the new nickname: ";
  wcin >> newvalue;
  WriteProcessMemory(hProcess, (LPVOID)Pointed, &newvalue, sizeof(wchar_t), NULL);
  if(WriteProcessMemory(hProcess, (LPVOID)Pointed, &newvalue, sizeof(wchar_t), NULL)){
  clog << "Process Memory Written" << endl;
  }else{
  clog << "Couldn't write process memory." << endl;
  }
  }
   }
 char cls;
 cout << "Wanna change the Nickname again? (y) or (n)" << endl;
 cin >> cls;
 while(cls){
 switch(cls){
 case 'y':  
 system("CLS");
 return main();
 break;
 case 'n':
 return 0;
 break;
 case 'Y':
 system("CLS");
 return main();
 break;
 case 'N':
return 0;
 default:
 return 0;
 break;
 }
 }
 system("PAUSE");
return main();
}
But still gives me access violation error.
You're completely ignoring my advice and I even gave you a code snippet. Also, you've defined the address yet you still try to dereference it locally from the console application. Do you even know what *(DWORD*) even does? I'm starting to get very annoyed here; one of the reasons I tend to avoid the programming section these days.
Quote Originally Posted by master131 View Post
You're completely ignoring my advice and I even gave you a code snippet. Also, you've defined the address yet you still try to dereference it locally from the console application. Do you even know what *(DWORD*) even does? I'm starting to get very annoyed here; one of the reasons I tend to avoid the programming section these days.
Look , my pointer is searching about String - Unicode and not 4 bytes that's what i got from you , and yeah you're right in your code snippet but I tried this way and it didn't work.

Thanks for helping me , but please I'm here because i cannot solve this problem so what is the problem in my new code now?


---------- Post added at 03:07 PM ---------- Previous post was at 03:05 PM ----------

Quote Originally Posted by master131 View Post
You're completely ignoring my advice and I even gave you a code snippet. Also, you've defined the address yet you still try to dereference it locally from the console application. Do you even know what *(DWORD*) even does? I'm starting to get very annoyed here; one of the reasons I tend to avoid the programming section these days.
Yes , DWORD is 4 bytes size of data.
Quote Originally Posted by [D]opeDog View Post

Look , my pointer is searching about String - Unicode and not 4 bytes that's what i got from you
I give up.
Quote Originally Posted by master131 View Post
I give up.
No , don't give up please you're my only hope.
@OP Did you make any changes? Post current code plz.

Code:
 DWORD Pointer = *(DWORD*)GameBase + *(DWORD*)Address; // Accesses THIS process memory
 ...
 ReadProcessMemory(hProcess, (LPCVOID)Pointer, &Pointed, sizeof(wchar_t), NULL); // Accesses TARGET process memory

The first line is a problem, fix that first, and use clog() or cout() or whatever, to verify that it's reading the correct value. Have CheatEngine open to verify the results.

Can you do that? Then we'll move on to the rest of the code..

-Screenshots are worth a thousand words : )
Quote Originally Posted by abuckau907 View Post
@OP Did you make any changes? Post current code plz.

Code:
 DWORD Pointer = *(DWORD*)GameBase + *(DWORD*)Address; // Accesses THIS process memory
 ...
 ReadProcessMemory(hProcess, (LPCVOID)Pointer, &Pointed, sizeof(wchar_t), NULL); // Accesses TARGET process memory

The first line is a problem, fix that first, and use clog() or cout() or whatever, to verify that it's reading the correct value. Have CheatEngine open to verify the results.

Can you do that? Then we'll move on to the rest of the code..

-Screenshots are worth a thousand words : )


Here's the screen shoot , I tried what was master1331 saying and it didn't work also tried to fix that line but I couldn't .

AVA.exe + 00FA1500 = 013A1500 and maybe I'm wrong about AVA.exe base address but I saw it in CE too.

0x013A1500 must be pointer to the right Address which is in the SS 1E0BA640 then I will add those offset which they're 0x24 and 0x90

I tried
Code:
DWORD* Pointer = 0x13A1500;
DWORD Pointed;
DWORD Offset = 0x24;
DWORD Offset1 = 0x90;
wchar_t value[32];
wchar_t newvalue[19]
ReadProcessMemory(hProcess, (LPCVOID)Pointer, &Pointed , 4, NULL); //Pointing to the address 1E0BA640
ReadProcessMemory(hProcess, (LPCVOID)(Pointed+Offset), &Pointed, 4, NULL); // Add the first offset
ReadProcessMemory(hProcess, (LPCVOID)(Pointed+Offset1), &Pointed , 4 , NULL); // Add the second offset (the address is now right)
ReadProcessMemory(hProcess, (LPCVOID)Pointed, &value, 4, NULL); // Now getting the UNI Code Name
cout << "Your current name is: " << (wchar_t*)value << endl;
cout << "Enter the new name: ";
cin >> newvalue;
WriteProcessMemory(hProcess, (LPVOID)Pointed, &newvalue, sizeof(wchar_t), NULL)
cout << "Your new name is: " << (wchar_t*)newvalue << endl;
Quote Originally Posted by [D]opeDog View Post


Code:
DWORD* Pointer = 0x13A1500;
DWORD Pointed;
DWORD Offset = 0x24;
DWORD Offset1 = 0x90;
wchar_t value[32];
wchar_t newvalue[19]
ReadProcessMemory(hProcess, (LPCVOID)Pointer, &Pointed , 4, NULL); //Pointing to the address 1E0BA640
ReadProcessMemory(hProcess, (LPCVOID)(Pointed+Offset), &Pointed, 4, NULL); // Add the first offset
ReadProcessMemory(hProcess, (LPCVOID)(Pointed+Offset1), &Pointed , 4 , NULL); // Add the second offset (the address is now right)
ReadProcessMemory(hProcess, (LPCVOID)Pointed, &value, 4, NULL); // Now getting the UNI Code Name
cout << "Your current name is: " << (wchar_t*)value << endl;
cout << "Enter the new name: ";
cin >> newvalue;
WriteProcessMemory(hProcess, (LPVOID)Pointed, &newvalue, sizeof(wchar_t), NULL)
cout << "Your new name is: " << (wchar_t*)newvalue << endl;
Code:
DWORD* Pointer = 0x13A1500;
DWORD Offset = 0x24;
DWORD Offset1 = 0x90;
This is possibly the solution for you. Note that in Cheat Engine it's written like this.

Base Address: AVA.exe + 00FA1500

If you add 90 to it. You'll get to 1E950000 now if you add 24 to that again. You get to the address you want. Now, in your source you're doing the opposite.

Code:
ReadProcessMemory(hProcess, (LPCVOID)(Pointed+Offset), &Pointed, 4, NULL); // Add the first offset
ReadProcessMemory(hProcess, (LPCVOID)(Pointed+Offset1), &Pointed , 4 , NULL); // Add the second offset (the address is now right)
Here you are doing.

Base Address: AVA.exe + 00FA1500 + 0x24 + 0x90 and it'll lead you to an totally different address than shown in Cheat Engine.
Quote Originally Posted by Magnificient View Post
Code:
DWORD* Pointer = 0x13A1500;
DWORD Offset = 0x24;
DWORD Offset1 = 0x90;
This is possibly the solution for you. Note that in Cheat Engine it's written like this.

Base Address: AVA.exe + 00FA1500

If you add 90 to it. You'll get to 1E950000 now if you add 24 to that again. You get to the address you want. Now, in your source you're doing the opposite.

Code:
ReadProcessMemory(hProcess, (LPCVOID)(Pointed+Offset), &Pointed, 4, NULL); // Add the first offset
ReadProcessMemory(hProcess, (LPCVOID)(Pointed+Offset1), &Pointed , 4 , NULL); // Add the second offset (the address is now right)
Here you are doing.

Base Address: AVA.exe + 00FA1500 + 0x24 + 0x90 and it'll lead you to an totally different address than shown in Cheat Engine.



Why not doing it in ReClass. Much easier and faster that way imho.

Here is a ReClass example I did for AC.

Code:
CEnemyArray **cenemyarray = (CEnemyArray**)0x4E4E08;

_cprintf("Player Name: %s\n ", cenemyarray[0]->EnemyArray[i]->Name);
Now this is user dependent. Just pointing out that there is also a different way of achieving the thing you want to do.
Can you give me your skype? i wanna talk with you.
Sure if you want to. -
Thank you.
/10 char
Posts 115 of 17 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?