View previous topic :: View next topic |
Author |
Message |
bulhufas How do I cheat?
Reputation: 0
Joined: 06 Nov 2009 Posts: 9
|
Posted: Sun Nov 15, 2009 8:47 am Post subject: [C++ and Delphi] Help with PostMessage Unhook |
|
|
EXE:
Code: | ...
...
implementation
{$R *.dfm}
function BulhufasPostMessageA(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL; stdcall; external 'BulhufasBypass.dll' name 'BulhufasPostMessageA';
...
... |
BulhufasBypass.dll:
Code: |
#include "stdafx.h"
#include "windows.h"
#include "winable.h"
#define EXPORTFUNC __declspec(dllexport)
DWORD dwOriginalAPI = NULL;
HMODULE hUser32;
...
...
__declspec(naked) EXPORTFUNC BOOL WINAPI BulhufasPostMessageA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
dwOriginalAPI = (DWORD)GetProcAddress(hUser32, "PostMessageA");
dwOriginalAPI += 5;
__asm
{
mov edi, edi
push ebp
mov ebp, esp
jmp dword ptr ds:[dwOriginalAPI]
}
}
...
...
...
...
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD dwReason,
LPVOID lpReserved
)
{
if ( dwReason == DLL_PROCESS_ATTACH )
{
hUser32 = GetModuleHandle("user32.dll");
if ( hUser32 == INVALID_HANDLE_VALUE )
hUser32 = LoadLibrary("user32.dll");
hGDI32 = GetModuleHandle("gdi32.dll");
if ( hGDI32 == INVALID_HANDLE_VALUE )
hGDI32 = LoadLibrary("gdi32.dll");
}
return TRUE;
} |
Error: Windows says that couldn't find the entry point of BulhufasPostMessageA in BulhufasBypass.dll
Can anyone help me?
PS: I already used DLL Export Viewer and BulhufasPostMessageA is there.
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25794 Location: The netherlands
|
Posted: Sun Nov 15, 2009 9:25 am Post subject: |
|
|
Are you sure BulhufasPostMessageA is in the dll export and not something like "BulhufasPostMessageA@s4889" ?
If it does have such a name, rename from .cpp to .c or use a .def file to define the exportnames
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
bulhufas How do I cheat?
Reputation: 0
Joined: 06 Nov 2009 Posts: 9
|
Posted: Sun Nov 15, 2009 4:54 pm Post subject: |
|
|
How do I use a .DEF file?
|
|
Back to top |
|
 |
iPromise Grandmaster Cheater
Reputation: -1
Joined: 27 Jun 2009 Posts: 529 Location: Canada
|
Posted: Wed Nov 18, 2009 8:35 pm Post subject: Solution |
|
|
To write a .DEF file
Open notepad, first put:
Code: |
LIBRARY "BulhufasBypass.dll"
|
Under that put:
Code: |
EXPORTS
BulhufasPostMessageA
|
So you'll have this:
Code: |
LIBRARY "BulhufasBypass.dll"
EXPORTS
BulhufasPostMessageA
|
Go to File -> Save As:
Change "Text Documents (*.txt)" to "All Files". Name it as Bulhufas.DEF and save it in your projects main folder (Make sure its in the .dll folder and NOT in the Debug folder).
Now go to your Visual C++ Compiler, Project --> YourProject Properties --> Configuration Properties --> Linker --> Input, go to "Module Definition File: " and put Bulhufas.DEF.
About your hookhop
I think you should do this instead:
Code: |
DWORD PostMessage_Address = (DWORD) GetProcAddress(GetModuleHandleA("user32.dll"), "PostMessage") + 5;
__declspec(void) BOOL PostMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
__asm {
mov edi, edi
push ebp
push esp, ebp
jmp [PostMessage_Address]
}
}
|
Tell me if this works.
|
|
Back to top |
|
 |
|