| View previous topic :: View next topic |
| Author |
Message |
@pointer How do I cheat?
Reputation: 0
Joined: 10 Aug 2014 Posts: 3
|
Posted: Sun Aug 10, 2014 7:44 pm Post subject: [Help]How can determine lpBaseAddress |
|
|
Hi EveryOne ,
Q1:how can Get the Exe base address?(without using cheat engine)
Q2:is it static or dynamic(lpBaseAddress)?
Q3:how can calculate the Exe base address and add the offsets, to reach to my pointer value?
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Sun Aug 10, 2014 8:42 pm Post subject: |
|
|
You can use API to get the base address, or wrappers depending on what language you are using.
If you need to use direct API calls, you can use either:
Toolhlp32:
- CreateToolhelp32Snapshot
- Process32First
- Process32Next
- Module32First
- Module32Next
PSAPI:
- EnumProcesses
- EnumProcessModules / EnumProcessModulesEx
You can also walk the module list manually via the PEB if you understand how to obtain that information and walk it manually etc.
If you are using a language such as VB.NET or C#, you can use the Process class instead which is a wrapper around various API which will give you all this information already:
http://msdn.microsoft.com/en-us/library/system.diagnostics.process(v=vs.110).aspx
_________________
- Retired. |
|
| Back to top |
|
 |
@pointer How do I cheat?
Reputation: 0
Joined: 10 Aug 2014 Posts: 3
|
Posted: Mon Aug 11, 2014 11:02 am Post subject: |
|
|
Sorry for my late reply atom0s
but why i need ;
- EnumProcessModules / EnumProcessModulesEx
HANDLE hProc = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION | PROCESS_VM_READ, FALSE, /*NOTEPAD_PID*/);
DWORD lpBaseAddress = 0x????????; /// i need to get it programmatically
int lpBuffer;
BOOL ReadRam = ReadProcessMemory(hProc, (LPVOID*)lpBaseAddress, &lpBuffer, sizeof(lpBuffer), NULL);
if (ReadRam){
printf(("%d\n"), lpBuffer);
}
Sorry, i am a beginner with C++;
thank You atom0s
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
|
| Back to top |
|
 |
STN I post too much
Reputation: 43
Joined: 09 Nov 2005 Posts: 2676
|
Posted: Mon Aug 11, 2014 12:53 pm Post subject: Re: [Help]How can determine lpBaseAddress |
|
|
| @pointer wrote: | Hi EveryOne ,
Q1:how can Get the Exe base address?(without using cheat engine)
Q2:is it static or dynamic(lpBaseAddress)?
Q3:how can calculate the Exe base address and add the offsets, to reach to my pointer value? |
1. Using Toolhlp32 or PSAPI like atomos suggested. I prefer Toolhlp32 myself and you can find a lot more example usage in trainers with it (check out spookie's codeshifting tutorial and you can find example trainers in it).
2. If its an exe, its most likely going to be static (40000(cba to type correct zeros) if its 32bit or a big number on 64bit ) but depends on the game really. If its a dll, its going to shift to be loaded at the available address space or be loaded by the application itself at some random address (some games did that though i haven't seen it in a long time). It doesn't matter though because if you're calculating the base address, even if it shifts you get the correct address.
3. Toolhlp32 and search for the exe name instead of a dll. Adding offsets depends on your language of choice.
PS: Worth pointing out is this thread should go into general programming not GD.
_________________
|
|
| Back to top |
|
 |
@pointer How do I cheat?
Reputation: 0
Joined: 10 Aug 2014 Posts: 3
|
Posted: Mon Aug 11, 2014 2:38 pm Post subject: |
|
|
ok, thanks atom0s , STN
i need to review some lessons in c++
return thanks;
|
|
| Back to top |
|
 |
|