Trirop How do I cheat?
Reputation: 0
Joined: 16 May 2015 Posts: 1 Location: Germany
|
Posted: Sat May 16, 2015 6:01 pm Post subject: Get VU of VSXu artiste with C++ |
|
|
Hello everybody!
this is my code so far:
| Code: | #include <iostream>
#include <Windows.h>
#include <stdio.h>
using namespace std;
int main() {
HWND hWnd = FindWindow(NULL,TEXT("Vovoid VSXu Artiste 0.4.0 [Windows 64-bit]"));
if (hWnd == 0) {
cerr << "Cannot find window "<< endl;
}
else {
DWORD pId;
GetWindowThreadProcessId(hWnd, &pId);
cout << "Found Window at "<<pId << endl;
HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pId);
HMODULE hModule = GetModuleHandle(TEXT("sound.rtaudio.dll"));
if (hProc == 0) {
cerr << "Cannot open process." << endl;
}else if(hModule==0){
DWORD error = GetLastError();
cerr << "could not find Module -> error: " <<error<< endl;
}
else {
float val = 0;
int addr = 0x04D40000 + 0x19098;//should be sound.rtaudio.dll+ 0x19098
while(TRUE){
int suc = ReadProcessMemory(hProc, (LPVOID)addr, &val, (DWORD)sizeof(val), NULL);
if (suc > 0) {
cout << "Success reading " << val << " of " << hex << addr << endl;
system("cls");
}
else {
DWORD error = GetLastError();
cerr << "fail " << error << endl;
}
}
}
CloseHandle(hProc);
}
cin.get();
return 0;
} |
I want to read the VU (sound card volume) value of the VSXu Artiste sound visualisation programm with C++ and with the help of Cheat Engine. It works perfectly fine with | Code: | | ReadProcessMemory(hProc, (LPVOID)addr, &val, (DWORD)sizeof(val), NULL); | until you re-open VSXu. This is pretty obvious, because the address of my value in Cheat Engine is "sound.rtaudio.dll+19098" and the DLL loads to a "random" address.
In Cheat Engine you can simply press Ctrl+G in the memory viewer and type the name of the DLL to find its base address. I have already tried the GetModuleHandle method in C++ without success:
| Code: | | HMODULE hModule = GetModuleHandle(TEXT("sound.rtaudio.dll")); |
Has anyone an idea how to get the base address of the dll with C++?
Kind regards,
Robert
|
|