Not a member yet? Register for your free account!


Go Back   elitepvpers > Aion > Aion Main - Discussions / Questions
You last visited: Today at 06:32

  • Did you know? elitepvpers has its own image host, epvpimg.com.

 

HP auslesen / Read HP[C++]

This is a discussion on HP auslesen / Read HP[C++] within the Aion Main - Discussions / Questions forum part of the Aion category; Hi! Ich versuche momentan nur zum Spaß in Aion meine Max-HP auszulesen. Sieht bis jetzt so aus (Ausschnitt): Code: if(hGameWindow) ...

Reply
 
Thread Tools
Old 09-18-2012, 15:15   #1
E*PVP 4 - EVER
 
Join Date: Jan 2009
Posts: 125
Received Thanks: 15
HP auslesen / Read HP[C++]


Hi!
Ich versuche momentan nur zum Spaß in Aion meine Max-HP auszulesen.
Sieht bis jetzt so aus (Ausschnitt):
Code:
if(hGameWindow)
{
GetWindowThreadProcessId(hGameWindow, &dwProcId);
				if(dwProcId != 0)
				{
					hProcHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwProcId);
					if(hProcHandle == INVALID_HANDLE_VALUE || hProcHandle == NULL)
					{
						GameStatus = "Failed to open Process!";
						std::cout << GameStatus << std::endl;
						std::cout << GetLastError();
					}
				} else {
					GameStatus = "Failed to get Process ID!";
					std::cout << GameStatus << std::endl;
					std::cout << GetLastError();
				}
			}


....
....
ReadProcessMemory(hProcHandle, (LPCVOID)health/*DWORD health=0xA2771C;*/, &iHealth, sizeof(int), NULL);
Funktioniert aber so nicht. Nach ein bisschen googlen habe ich herrausgefunden dass es da noch etwas mit der Game.dll auf sich hat, aber was genau muss ich noch tun damit es funktioniert? BTW: ReadProcessMemory gibt 0 zurück, GetLastError 299.

-------------------------

Hi!
At the moment I'm trying to read my Max-HP via ReadProcessMemory.
Looks like this(excerpt):
Code:
if(hGameWindow)
			{
				GetWindowThreadProcessId(hGameWindow, &dwProcId);
				if(dwProcId != 0)
				{
					hProcHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwProcId);
					if(hProcHandle == INVALID_HANDLE_VALUE || hProcHandle == NULL)
					{
						GameStatus = "Failed to open Process!";
						std::cout << GameStatus << std::endl;
						std::cout << GetLastError();
					}
				} else {
					GameStatus = "Failed to get Process ID!";
					std::cout << GameStatus << std::endl;
					std::cout << GetLastError();
				}
			}


....
....
ReadProcessMemory(hProcHandle, (LPCVOID)health/*DWORD health=0xA2771C;*/, &iHealth, sizeof(int), NULL);
But it doesn't work like this. I found out that I have to do something with Game.dll, but what? BTW: ReadProcessMemory returns 0, GetLastError 299.


Greets!
jackicola is offline  
 
Old 09-18-2012, 19:51   #2
Senior Member
 
Join Date: Feb 2006
Posts: 565
Received Thanks: 180
For the base address ("Game.dll"), look into WINAPI's GetModuleBase. You must add that to the offset -- currently 0xCCAE74 on retail.
lucid is offline  
Old 09-20-2012, 20:06   #3
E*PVP 4 - EVER
 
Join Date: Jan 2009
Posts: 125
Received Thanks: 15
I didn't find a function called GetModuleBase, ich just found GetModuleHandle.. is that ok?
jackicola is offline  
Old 09-21-2012, 20:00   #4
Senior Member
 
Join Date: Feb 2006
Posts: 565
Received Thanks: 180
Quote:
Originally Posted by jackicola View Post
I didn't find a function called GetModuleBase, ich just found GetModuleHandle.. is that ok?
You want the Base Address, not a Handle; it is NOT the same and NOT ok. It looks like C++ doesn't support GetModuleBase but you can easily iterate over the modules and create it:

Code:
    DWORD GetModuleBase(LPSTR lpModuleName, DWORD dwProcessId)
    {
    MODULEENTRY32 lpModuleEntry = {0};
    HANDLE hSnapShot = CreateToolhelp32Snapshot( TH32CS_SNAPMODULE, dwProcessId );
    if(!hSnapShot)
    return NULL;
    lpModuleEntry.dwSize = sizeof(lpModuleEntry);
    BOOL bModule = Module32First( hSnapShot, &lpModuleEntry );
    while(bModule)
    {
    if(!strcmp( lpModuleEntry.szModule, lpModuleName ) )
    {
    CloseHandle( hSnapShot );
    return (DWORD)lpModuleEntry.modBaseAddr;
    }
    bModule = Module32Next( hSnapShot, &lpModuleEntry );
    }
    CloseHandle( hSnapShot );
    return NULL;
    }
lucid is offline  
Reply

 

Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Battle Pirates **READ**READ**READ** tr71270 Facebook 37 05-02-2012 06:00
[Memory Read] Monster HP auslesen Skatefreaky AutoIt 7 04-02-2012 13:42
READ READ READ !!! LORDYK93 SCAMMER Havester Silkroad Online Trading 1 10-11-2009 19:53



All times are GMT +2. The time now is 06:32.


Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.