|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
ZenX Grandmaster Cheater Supreme Reputation: 1
Joined: 26 May 2007 Posts: 1021 Location: ">>Pointer<<" : Address 00400560 Offset :1FE
|
Posted: Tue Aug 14, 2007 11:41 am Post subject: {Mini-Tut} Dynamic DLL Loading |
|
|
Complete Functionality - Implementation in the TDLLMODULE function.
There Are 2 Virtual Functions to this implementation.
Code: |
{
Returns True when the DLL has been loaded SUCCESFULY!!
}
Create()
|
and
Code: |
{
Simply unload the DLL's process from the memory
}
Destroy()
|
Example:
If something needed PSAPI(Process Status API)
Then you would need to Enumerate all running processes and display Executable process, you would need to create a TProcessStateusModule from TDllModule
Don't Forget your TypeDefs
Code: |
//Create()
//It needs first to call the base class that loads the DLL into the process //memory and obtains a handle
//and second, to obtain pointers to functions in a DLL that are needed for //the current application. If this function returns FALSE, then the DLL is not //loaded correctly and cannot be used. Its implementation is the following:
typedef BOOL (WINAPI *TFEnumProcesses)(
DWORD * lpidProcess, DWORD cb, DWORD * cbNeeded
);
typedef BOOL (WINAPI *TFEnumProcessModules)(
HANDLE hProcess, HMODULE *lphModule, DWORD cb, LPDWORD lpcbNeeded
);
typedef DWORD (WINAPI *TFGetModuleBaseName)(
HANDLE hProcess, HMODULE hModule, LPSTR lpBaseName, DWORD nSize
);
typedef DWORD (WINAPI *TFGetModuleFileNameEx)(
HANDLE hProcess, HMODULE hModule, LPSTR lpFilename, DWORD nSize
);
typedef BOOL (WINAPI *TFGetModuleInformation)(
HANDLE hProcess, HMODULE hModule, LPMODULEINFO lpmodinfo, DWORD cb
);
class TProcessStatusModule : public TDllModule {
private:
TFEnumProcesses FEnumProcesses;
TFEnumProcessModules FEnumProcessModules;
TFGetModuleBaseName FGetModuleBaseName;
TFGetModuleFileNameEx FGetModuleFileNameEx;
TFGetModuleInformation FGetModuleInformation;
public:
TProcessStatusModule();
virtual ~TProcessStatusModule();
virtual BOOL Create(void);
virtual void Destroy(void);
BOOL EnumProcesses(DWORD * lpidProcess, DWORD cb, DWORD * cbNeeded);
BOOL EnumProcessModules(HANDLE hProcess,HMODULE *lphModule,DWORD cb,
LPDWORD lpcbNeeded);
DWORD GetModuleBaseName(HANDLE hProcess,HMODULE hModule,LPSTR lpBaseName,
DWORD nSize);
DWORD GetModuleFileNameEx(HANDLE hProcess,HMODULE hModule,
LPSTR lpFilename,DWORD nSize);
BOOL GetModuleInformation(HANDLE hProcess,HMODULE hModule,
LPMODULEINFO lpmodinfo,DWORD cb);
};
|
Code: |
BOOL TProcessStatusModule::Create(void)
{
if (TDllModule::Create()) {
// DLL handle is valid (DLL is loaded)
FEnumProcesses = (TFEnumProcesses)::GetProcAddress(m_hHandle,
_T("EnumProcesses"));
FEnumProcessModules = (TFEnumProcessModules)::GetProcAddress(m_hHandle,
_T("EnumProcessModules"));
// Load all other needed functions
...
// Can also check if all pointers to functions are different from NULL.
return TRUE;
}
return FALSE;
}
|
Now all that is left is the function execution of the DLL
Note:Each method has the same arguement as the DLL
The Returning code:
Code: |
BOOL TProcessStatusModule::EnumProcesses(DWORD *lpidProcess, DWORD cb, DWORD *cbNeeded)
{
ASSERT(FEnumProcesses != NULL);
if (FEnumProcesses)
return FEnumProcesses(lpidProcess,cb,cbNeeded);
return FALSE;
}
|
Credits~
CODE WASNT DEVELOPED BY ME ONLY THE TUT!
_________________
CEF Moderator since 2007 ^_^
ZenX-Engine |
|
Back to top |
|
|
wizardolu Newbie cheater Reputation: 0
Joined: 01 Jun 2007 Posts: 23
|
Posted: Sat Sep 22, 2007 8:26 am Post subject: |
|
|
nice tut, but how do u make a dll? in C++?
|
|
Back to top |
|
|
h4ckz0r's twisted soul Grandmaster Cheater Supreme Reputation: 1
Joined: 24 Oct 2007 Posts: 1181 Location: Paradise city, where the grass is green and the girls are somwhat pretty~
|
Posted: Mon Oct 29, 2007 10:42 am Post subject: |
|
|
Nice tut and thx
|
|
Back to top |
|
|
lolhaha Newbie cheater Reputation: 0
Joined: 06 Nov 2007 Posts: 10
|
Posted: Tue Nov 06, 2007 7:28 am Post subject: lol |
|
|
lol nice
|
|
Back to top |
|
|
atom0s Moderator Reputation: 198
Joined: 25 Jan 2006 Posts: 8516 Location: 127.0.0.1
|
|
Back to top |
|
|
Noz3001 I'm a spammer Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Tue Nov 06, 2007 12:55 pm Post subject: |
|
|
Ok, now see if you can explain it all.
|
|
Back to top |
|
|
DeletedUser14087 I post too much Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Wed Nov 14, 2007 8:30 am Post subject: |
|
|
noz3001 wrote: | Ok, now see if you can explain it all. |
Ahaha i love you man
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|