Not a member yet? Register for your free account!

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

  • Please register to post and access all features, it's quick, easy and FREE!

 

HP auslesen / Read HP[C++]

Reply
 
Old   #1
 
elite*gold: 0
The Black Market: 0/0/0
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   #2
 
elite*gold: 0
The Black Market: 0/0/0
Join Date: Feb 2006
Posts: 610
Received Thanks: 192
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   #3
 
elite*gold: 0
The Black Market: 0/0/0
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   #4
 
elite*gold: 0
The Black Market: 0/0/0
Join Date: Feb 2006
Posts: 610
Received Thanks: 192
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



« Previous Thread | Next Thread »

Similar Threads
Battle Pirates **READ**READ**READ**
Be smart when using the hacks now, Kixeye is banning by ip address now!
37 Replies - Facebook
[Memory Read] Monster HP auslesen
Ich versuche im Moment herauszufinden, wie ich die HP eines Monsters auslesen kann. Wie man hier an dem Bild sehen kann, steht leider keine HP...
7 Replies - AutoIt
READ READ READ !!! LORDYK93 SCAMMER
he scammed a ecsro vip account from me ... he wanna give a lvl 90 sjsro account he change the pw of my account and said i have to wait ... now hes on...
1 Replies - Silkroad Online Trading



All times are GMT +2. The time now is 00:02.


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

Support | Contact Us | FAQ | Advertising | Privacy Policy
Copyright ©2015 elitepvpers All Rights Reserved.