Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


bypassed SetCursorPos dll
Goto page 1, 2  Next
 
Post new topic   This topic is locked: you cannot edit posts or make replies.    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
andonrui
Cheater
Reputation: 0

Joined: 22 Apr 2008
Posts: 33

PostPosted: Thu Oct 30, 2008 10:51 am    Post subject: bypassed SetCursorPos dll Reply with quote

Can anyone write a dll that bypassed the setcursorpos?


Thanks alot
Back to top
View user's profile Send private message
GMZorita
Grandmaster Cheater Supreme
Reputation: 0

Joined: 21 Mar 2007
Posts: 1361

PostPosted: Thu Oct 30, 2008 1:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Thu Oct 30, 2008 1:34 pm    Post subject: Reply with quote

there's no point to it for maple because using PostMessage you specify the point to be clicked at.
_________________
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Thu Oct 30, 2008 1:35 pm    Post subject: Reply with quote

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
View user's profile Send private message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Thu Oct 30, 2008 4:59 pm    Post subject: Reply with quote

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
View user's profile Send private message
nog_lorp
Grandmaster Cheater
Reputation: 0

Joined: 26 Feb 2006
Posts: 743

PostPosted: Thu Oct 30, 2008 5:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Thu Oct 30, 2008 9:47 pm    Post subject: Reply with quote

nog_lorp wrote:
Depends on the compiler and optimization level.


And whether or not you link the CRT.

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Fri Oct 31, 2008 2:57 am    Post subject: Reply with quote

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
View user's profile Send private message
kittonkicker
I post too much
Reputation: 1

Joined: 19 Apr 2006
Posts: 2171

PostPosted: Fri Oct 31, 2008 11:28 am    Post subject: Reply with quote

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 Sad
Back to top
View user's profile Send private message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Fri Oct 31, 2008 1:46 pm    Post subject: Reply with quote

Oh.... T.T I don;t do alot of C++...
Back to top
View user's profile Send private message
andonrui
Cheater
Reputation: 0

Joined: 22 Apr 2008
Posts: 33

PostPosted: Sun Nov 02, 2008 4:32 am    Post subject: Reply with quote

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(1Cool : error C2490: 'return' not allowed in function with 'naked' attribute
Back to top
View user's profile Send private message
rapion124
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Mar 2007
Posts: 1095

PostPosted: Sun Nov 02, 2008 6:20 am    Post subject: Reply with quote

remove "return 0."
Back to top
View user's profile Send private message
Anden100
Grandmaster Cheater
Reputation: 0

Joined: 20 Apr 2007
Posts: 668

PostPosted: Sun Nov 02, 2008 7:18 am    Post subject: Reply with quote

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(1Cool : 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
View user's profile Send private message
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Sun Nov 02, 2008 7:19 am    Post subject: Reply with quote

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
View user's profile Send private message
Anden100
Grandmaster Cheater
Reputation: 0

Joined: 20 Apr 2007
Posts: 668

PostPosted: Sun Nov 02, 2008 7:21 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites