| View previous topic :: View next topic |
| Author |
Message |
Fanatic12 How do I cheat?
Reputation: 0
Joined: 03 Feb 2011 Posts: 4
|
Posted: Thu Feb 03, 2011 11:43 am Post subject: Address of file.dll. |
|
|
Hello. I found few momory addresses, but they are not static. When I double klik on their address, it returns for example: file.dll+1D44B0. How can I read address of file.dll in c++? Thanks for any advices .
|
|
| Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Thu Feb 03, 2011 1:11 pm Post subject: |
|
|
| GetModuleHandle()
|
|
| Back to top |
|
 |
Fanatic12 How do I cheat?
Reputation: 0
Joined: 03 Feb 2011 Posts: 4
|
Posted: Thu Feb 03, 2011 1:24 pm Post subject: |
|
|
Thabks. I already tryed:
DWORD/HANDLE aaaaaa = GetModuleHandle("samp.dll");
printf("aaaaaa=%x\n", aaaaaa);
But it alwyas returns 0 . Any ideas?
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Thu Feb 03, 2011 1:36 pm Post subject: |
|
|
If you aren't injected into the process GetModuleHandle wont work. If you are doing things outside of the process in a separate exe, use:
#include <Tlhelp32.h>
- CreateToolhelp32Snapshot
- Module32First
- Module32Next
or
#include <psapi.h>
- EnumProcessModules
- GetModuleFileNameEx
_________________
- Retired. |
|
| Back to top |
|
 |
Fanatic12 How do I cheat?
Reputation: 0
Joined: 03 Feb 2011 Posts: 4
|
Posted: Thu Feb 03, 2011 2:32 pm Post subject: |
|
|
My code:
while(hWnd == 0)
{
hWnd = FindWindow(NULL, "GTA:SA:MP");
Sleep(5000);
}
printf("GTA:SA:MP runs.\n");
GetWindowThreadProcessId(hWnd, &pId);
pHandle = OpenProcess(PROCESS_ALL_ACCESS, TRUE, pId);
HANDLE aaaaaa = GetModuleHandle("samp.dll");
printf("aaaaaa=%d\n", aaaaaa);
It is wrong?
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Thu Feb 03, 2011 3:03 pm Post subject: |
|
|
Yes, that wont work because you are externally obtaining the information. You will need to use one of the methods I stated above, or inject a dll directly into the process if you wish to use GetModuleHandle.
Also be warned that using PROCESS_ALL_ACCESS isn't valid anymore unless more steps are taken. It is best practice to specify exactly what you need when calling OpenProcess for the flags.
_________________
- Retired. |
|
| Back to top |
|
 |
Fanatic12 How do I cheat?
Reputation: 0
Joined: 03 Feb 2011 Posts: 4
|
Posted: Thu Feb 03, 2011 3:51 pm Post subject: |
|
|
I feel quite noob, but I don't understand this very well .
I made this from something I found on msdn:
while(hWnd == 0)
{
hWnd = FindWindow(NULL, "GTA:SA:MP");
Sleep(5000);
}
printf("GTA:SA:MP runs.\n");
GetWindowThreadProcessId(hWnd, &pId);
pHandle = OpenProcess(PROCESS_ALL_ACCESS, TRUE, pId);
HANDLE aaaaaa = CreateToolhelp32Snapshot(0x8u, pId);
MODULEENTRY32 me32;
Module32First(aaaaaa, &me32);
me32.dwSize = sizeof( MODULEENTRY32 );
Module32First( aaaaaa, &me32 );
printf("aaaaaa=%X\n", aaaaaa);
while(Module32Next( aaaaaa, &me32 ))
{
printf("aaaaaa=%X\n", aaaaaa);
}
I don't know what I am doind now. It writes aaaaaa=68 many times. Cheat engine returns 03E90000. Sorry for my stupid questions .
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Thu Feb 03, 2011 4:16 pm Post subject: |
|
|
Go back to MSDN and read the pages about the API. You aren't using them properly and you aren't using the structures properly either. The pages on MSDN give more then enough information to use the API.
I don't want to spoon feed you code because then you wont learn anything.
_________________
- Retired. |
|
| Back to top |
|
 |
iPromise Grandmaster Cheater
Reputation: -1
Joined: 27 Jun 2009 Posts: 529 Location: Canada
|
Posted: Sun Feb 06, 2011 8:21 pm Post subject: |
|
|
| if GetModuleHandle () won't work, use LoadLibrary () instead. Or use a snapshot.
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Mon Feb 07, 2011 8:38 am Post subject: |
|
|
He's not injected, LoadLibrary wont do shit for him.
_________________
- Retired. |
|
| Back to top |
|
 |
|