 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Tue Apr 29, 2008 9:32 am Post subject: |
|
|
| 1qaz wrote: | ok i deleted my .h files and .def file
after that my cpp file was compileable
then i added a new header file and called it myHeader.h
i wrote in it:
| Code: |
#ifdef __cplusplus
extern "C"
{
#endif
__declspec( dllexport ) bool PostMessage2(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
#ifdef __cplusplus
}
#endif
|
now when i compile it i get warning message at the bottom
frame pointer register ebp modified by inline assembly code (but i dont think it matter).
now i #include "myHeader.h" in dllmain.cpp
compiled it and succeeded
in my application i imported the function from my dll and when i run it i get
"attempted to read or write protected memory. this is often an indication that other memory is corrupt" |
just do this !!
dllmain.cpp
| Code: | #include "windows.h"
DWORD hPMA = (DWORD)GetProcAddress(LoadLibraryA("user32.dll"),"PostMessageA")+5;
DWORD hGPA = (DWORD)GetProcAddress(LoadLibraryA("gdi32.dll"),"GetPixel")+5;
__declspec(naked) void PMA(void)
{
__asm
{
mov edi,edi
push ebp
mov ebp,esp
jmp [hPMA]
}
}
__declspec(naked) void GP(void)
{
__asm
{
mov edi,edi
push ebp
mov ebp,esp
jmp [hGPA]
}
} |
Exports.def
| Code: | LIBRARY PMX2
EXPORTS
PMA @1
GP @2 |
|
|
| Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Tue Apr 29, 2008 9:52 am Post subject: |
|
|
finally !! =D
thx +rep :]]]]]
_________________
Stylo |
|
| Back to top |
|
 |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Tue Apr 29, 2008 9:54 am Post subject: |
|
|
| 1qaz wrote: | finally !! =D
thx +rep :]]]]] |
i hope you now understand how to export, if you wanna export more from this .dll, just add @+1
@1
@2
@3
@4
@5
@etc.. (
|
|
| 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
|
|