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 


my first c++ tool (hotkeyed auto clicker + source)
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming -> Binaries
View previous topic :: View next topic  
Author Message
DaNemeziz
Master Cheater
Reputation: 0

Joined: 29 Sep 2007
Posts: 430

PostPosted: Sat Sep 06, 2008 10:58 am    Post subject: my first c++ tool (hotkeyed auto clicker + source) Reply with quote

this is my first c++ tool, an auto clicker
i started learn a bit c++ yesterday
made it with hotkeys; f1 = start, f2 = stop

its patched by game guard =( maybe somebody find a way to get it to working for maplestory?


http://rapidshare.com/files/143137421/AutoClicker.exe.html

source
Code:
#include "windows.h"

int main() {
   int autoclicker;

   while (true) {
      if ((GetAsyncKeyState(0x70)<0)) {
         autoclicker = 1;
      }

      if ((GetAsyncKeyState(0x71)<0)) {
         autoclicker = 0;
      }

      if (autoclicker == 1) {
         mouse_event(0x2,0,0,0,0);
         mouse_event(0x4,0,0,0,0);
      }

      Sleep(1);
   }
}
Back to top
View user's profile Send private message
Robotex
Master Cheater
Reputation: 0

Joined: 05 Sep 2006
Posts: 378
Location: The pizza country!

PostPosted: Sat Sep 06, 2008 12:30 pm    Post subject: Reply with quote

a small tip: if you need to check something is enabled or not, use booleans (bool)
_________________

ASM/C++ Coder
Project Speranza lead developer
Back to top
View user's profile Send private message
DaNemeziz
Master Cheater
Reputation: 0

Joined: 29 Sep 2007
Posts: 430

PostPosted: Sat Sep 06, 2008 12:36 pm    Post subject: Reply with quote

where's the difference? Surprised
Back to top
View user's profile Send private message
Hieroglyphics
I post too much
Reputation: 0

Joined: 06 Dec 2007
Posts: 2007
Location: Your bedroom

PostPosted: Sat Sep 06, 2008 12:41 pm    Post subject: Reply with quote

You gotta use PostMessage for MS I think I have never tried for MS, but yeah just a tip since you know mouse events know use keybd_event and you can spam keys
_________________

Back to top
View user's profile Send private message AIM Address MSN Messenger
DaNemeziz
Master Cheater
Reputation: 0

Joined: 29 Sep 2007
Posts: 430

PostPosted: Sat Sep 06, 2008 12:52 pm    Post subject: Reply with quote

yea i know about key spamming, already made an AutoEnter xP
i know about PostMessage, never gave a look to it but as far as i know you also need to bypass PostMessage!?
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Sat Sep 06, 2008 1:20 pm    Post subject: Reply with quote

PostMessage bypass.

Code:

DWORD PMA = (DWORD)GetProcAddress(LoadLibrary("USER32.DLL"), "PostMessageA");

declspec(naked) BOOL PostMessageX(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) {
   _asm {
      mov edi, edi
      push ebp
      mov ebp, esp
      jmp[PMA]
   }
}

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
DaNemeziz
Master Cheater
Reputation: 0

Joined: 29 Sep 2007
Posts: 430

PostPosted: Sat Sep 06, 2008 1:52 pm    Post subject: Reply with quote

hm thanks but where do i have to add it? Surprised sorry, like i said i started c++ yesterday
i think before int main()...?
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Sat Sep 06, 2008 1:54 pm    Post subject: Reply with quote

Yes.
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
DaNemeziz
Master Cheater
Reputation: 0

Joined: 29 Sep 2007
Posts: 430

PostPosted: Sat Sep 06, 2008 1:55 pm    Post subject: Reply with quote

ok then i try to find something about post message now =) thanks

edit : do i need any new includes?
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Sat Sep 06, 2008 2:14 pm    Post subject: Reply with quote

You don't need any new includes. Here's the MSDN page for PostMessage.
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
DaNemeziz
Master Cheater
Reputation: 0

Joined: 29 Sep 2007
Posts: 430

PostPosted: Sat Sep 06, 2008 2:21 pm    Post subject: Reply with quote

i get 2 errors with this postmessage bypass
Code:
DWORD PMA = (DWORD)GetProcAddress(LoadLibrary("USER32.DLL"), "PostMessageA");

declspec(naked) BOOL PostMessageX(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) {
   _asm {
      mov edi, edi
      push ebp
      mov ebp, esp
      jmp[PMA]
   }
}


it says that postmessagex is no parameter and that it miss a , anywhere
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Sat Sep 06, 2008 2:26 pm    Post subject: Reply with quote

I forgot to end an ending parentheses. Change it to this:

Code:

DWORD PMA = (DWORD)GetProcAddress(LoadLibrary("USER32.DLL"), "PostMessageA"));

declspec(naked) BOOL PostMessageX(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) {
   _asm {
      mov edi, edi
      push ebp
      mov ebp, esp
      jmp[PMA]
   }
}

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
DaNemeziz
Master Cheater
Reputation: 0

Joined: 29 Sep 2007
Posts: 430

PostPosted: Sat Sep 06, 2008 2:36 pm    Post subject: Reply with quote

now it gives me 3 errors

here's my current code if you want to try out on your own

Code:
#include "windows.h"
#include <iostream>
using namespace std;

DWORD PMA = (DWORD)GetProcAddress(LoadLibrary("USER32.DLL"), "PostMessageA"));

declspec(naked) BOOL PostMessageX(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) {
   _asm {
      mov edi, edi
      push ebp
      mov ebp, esp
      jmp[PMA]
   }
}

int main() {
   int autoclicker;

   while (true) {
      if ((GetAsyncKeyState(0x71)<0)) {
         autoclicker = 1;
         cout << "started\n";
      }

      if ((GetAsyncKeyState(0x72)<0)) {
         autoclicker = 0;
         cout << "stopped\n";
      }

      if (autoclicker == 1) {
         //left mouse click
      }

      Sleep(1);
   }
}
Back to top
View user's profile Send private message
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Sat Sep 06, 2008 2:41 pm    Post subject: Reply with quote

Please learn the basics of C++ before continuing, also WIN32 APIs.
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Sat Sep 06, 2008 3:10 pm    Post subject: Reply with quote

How about giving us the errors?
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming -> Binaries 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