View previous topic :: View next topic |
Author |
Message |
andonrui Cheater Reputation: 0
Joined: 22 Apr 2008 Posts: 33
|
Posted: Thu Oct 30, 2008 10:51 am Post subject: bypassed SetCursorPos dll |
|
|
Can anyone write a dll that bypassed the setcursorpos?
Thanks alot
|
|
Back to top |
|
|
GMZorita Grandmaster Cheater Supreme Reputation: 0
Joined: 21 Mar 2007 Posts: 1361
|
Posted: Thu Oct 30, 2008 1:33 pm Post subject: |
|
|
C++ ? Source:
Code: |
static const FARPROC SCP = (FARPROC)((DWORD)GetProcAddress(GetModuleHandle("user32.dll"), "SetCursorPos" )+5);
_declspec(naked) BOOL WINAPI SetCurPos(int x, int y)
{
_asm
{
mov edi,edi
push ebp
mov ebp,esp
jmp [SCP]
}
return 0;
}
|
_________________
Gone |
|
Back to top |
|
|
HomerSexual Grandmaster Cheater Supreme Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Thu Oct 30, 2008 1:34 pm Post subject: |
|
|
there's no point to it for maple because using PostMessage you specify the point to be clicked at.
_________________
|
|
Back to top |
|
|
lurc Grandmaster Cheater Supreme Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Thu Oct 30, 2008 1:35 pm Post subject: |
|
|
Source:
Code: | #include <Windows.h>
DWORD _SCP = 0;
__declspec(dllexport) __declspec(naked) BOOL WINAPI _SetCursorPos(__in int X, __in int Y)
{
__asm
{
push ebp
mov ebp, esp
jmp dword ptr [_SCP]
}
}
BOOL WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
{
_SCP = (DWORD)GetProcAddress(LoadLibrary(_T("user32.dll")), "SetCursorPos") + 5;
return TRUE;
} |
Then make a .def file and put
LIBRARY SetPos
EXPORTS _SetCursorPos @1
(^ If i remember correctly...)
_________________
|
|
Back to top |
|
|
dnsi0 I post too much Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Thu Oct 30, 2008 4:59 pm Post subject: |
|
|
I find that C++ makes a bigger file than delphi. Cause I made a pmx in C++ and it gave me 300kb while delphi's pmx gave me around 80kb.
|
|
Back to top |
|
|
nog_lorp Grandmaster Cheater Reputation: 0
Joined: 26 Feb 2006 Posts: 743
|
Posted: Thu Oct 30, 2008 5:16 pm Post subject: |
|
|
Depends on the compiler and optimization level.
_________________
Mutilated lips give a kiss on the wrist of the worm-like tips of tentacles expanding in my mind
I'm fine accepting only fresh brine you can get another drop of this yeah you wish |
|
Back to top |
|
|
samuri25404 Grandmaster Cheater Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Thu Oct 30, 2008 9:47 pm Post subject: |
|
|
nog_lorp wrote: | Depends on the compiler and optimization level. |
And whether or not you link the CRT.
_________________
|
|
Back to top |
|
|
DeletedUser14087 I post too much Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Fri Oct 31, 2008 2:57 am Post subject: |
|
|
dnsi0 wrote: | I find that C++ makes a bigger file than delphi. Cause I made a pmx in C++ and it gave me 300kb while delphi's pmx gave me around 80kb. |
I use MSVC++ 2k8, and in C it gives me 7.0kb, in Delphi (when i remove unused imports) it can give me 25kb (or more, around that).
|
|
Back to top |
|
|
kittonkicker I post too much Reputation: 1
Joined: 19 Apr 2006 Posts: 2171
|
Posted: Fri Oct 31, 2008 11:28 am Post subject: |
|
|
dnsi0 wrote: | I find that C++ makes a bigger file than delphi. Cause I made a pmx in C++ and it gave me 300kb while delphi's pmx gave me around 80kb. |
You are compiling in DEBUG mode lol...
_________________
All gone |
|
Back to top |
|
|
dnsi0 I post too much Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Fri Oct 31, 2008 1:46 pm Post subject: |
|
|
Oh.... T.T I don;t do alot of C++...
|
|
Back to top |
|
|
andonrui Cheater Reputation: 0
Joined: 22 Apr 2008 Posts: 33
|
Posted: Sun Nov 02, 2008 4:32 am Post subject: |
|
|
GMZorita wrote: | C++ ? Source:
Code: |
static const FARPROC SCP = (FARPROC)((DWORD)GetProcAddress(GetModuleHandle("user32.dll"), "SetCursorPos" )+5);
_declspec(naked) BOOL WINAPI SetCurPos(int x, int y)
{
_asm
{
mov edi,edi
push ebp
mov ebp,esp
jmp [SCP]
}
return 0;
}
|
|
1>------ Build started: Project: dllop, Configuration: Release Win32 ------
1>Compiling...
1>dllop.cpp
1>.\dllop.cpp(7) : error C2664: 'GetModuleHandleW' : cannot convert parameter 1 from 'const char [11]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\dllop.cpp(1 : error C2490: 'return' not allowed in function with 'naked' attribute
|
|
Back to top |
|
|
rapion124 Grandmaster Cheater Supreme Reputation: 0
Joined: 25 Mar 2007 Posts: 1095
|
Posted: Sun Nov 02, 2008 6:20 am Post subject: |
|
|
remove "return 0."
|
|
Back to top |
|
|
Anden100 Grandmaster Cheater Reputation: 0
Joined: 20 Apr 2007 Posts: 668
|
Posted: Sun Nov 02, 2008 7:18 am Post subject: |
|
|
andonrui wrote: | GMZorita wrote: | C++ ? Source:
Code: |
static const FARPROC SCP = (FARPROC)((DWORD)GetProcAddress(GetModuleHandle("user32.dll"), "SetCursorPos" )+5);
_declspec(naked) BOOL WINAPI SetCurPos(int x, int y)
{
_asm
{
mov edi,edi
push ebp
mov ebp,esp
jmp [SCP]
}
return 0;
}
|
|
1>------ Build started: Project: dllop, Configuration: Release Win32 ------
1>Compiling...
1>dllop.cpp
1>.\dllop.cpp(7) : error C2664: 'GetModuleHandleW' : cannot convert parameter 1 from 'const char [11]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\dllop.cpp(1 : error C2490: 'return' not allowed in function with 'naked' attribute |
Try this, not sure, long time since i did this last...
Code: |
static const FARPROC SCP = (FARPROC)((DWORD)GetProcAddress(LoadLibrary("user32.dll"), "SetCursorPos" )+5);
_declspec(naked) BOOL WINAPI SetCurPos(int x, int y)
{
_asm
{
mov edi,edi
push ebp
mov ebp,esp
jmp [SCP]
}
}
|
Otherwise, take a look at this:
http://forum.cheatengine.org/viewtopic.php?t=231524
Last edited by Anden100 on Sun Nov 02, 2008 7:20 am; edited 1 time in total |
|
Back to top |
|
|
Snootae Grandmaster Cheater Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Sun Nov 02, 2008 7:19 am Post subject: |
|
|
Quote: | 1>------ Build started: Project: dllop, Configuration: Release Win32 ------
1>Compiling...
1>dllop.cpp
1>.\dllop.cpp(7) : error C2664: 'GetModuleHandleW' : cannot convert parameter 1 from 'const char [11]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\dllop.cpp(1Cool : error C2490: 'return' not allowed in function with 'naked' attribute |
Code: | static const FARPROC SCP = (FARPROC)((DWORD)GetProcAddress(GetModuleHandle(L"user32.dll"), "SetCursorPos" )+5);
_declspec(naked) BOOL WINAPI SetCurPos(int x, int y)
{
_asm
{
mov edi,edi
push ebp
mov ebp,esp
jmp [SCP]
}
} |
_________________
|
|
Back to top |
|
|
Anden100 Grandmaster Cheater Reputation: 0
Joined: 20 Apr 2007 Posts: 668
|
Posted: Sun Nov 02, 2008 7:21 am Post subject: |
|
|
Snootae wrote: | Quote: | 1>------ Build started: Project: dllop, Configuration: Release Win32 ------
1>Compiling...
1>dllop.cpp
1>.\dllop.cpp(7) : error C2664: 'GetModuleHandleW' : cannot convert parameter 1 from 'const char [11]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\dllop.cpp(1Cool : error C2490: 'return' not allowed in function with 'naked' attribute |
Code: | static const FARPROC SCP = (FARPROC)((DWORD)GetProcAddress(GetModuleHandle(L"user32.dll"), "SetCursorPos" )+5);
_declspec(naked) BOOL WINAPI SetCurPos(int x, int y)
{
_asm
{
mov edi,edi
push ebp
mov ebp,esp
jmp [SCP]
}
} |
|
I modified it, check it now please, at my friends comp, no compiler...
|
|
Back to top |
|
|
|