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 Previous  1, 2
 
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 3:17 pm    Post subject: Reply with quote

error in declerationsyntax
PostMessageX is no parameter
misses a ,
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:20 pm    Post subject: Reply with quote

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);
   }
}

_________________


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 3:34 pm    Post subject: Reply with quote

now i have 2 errors left...
error in decleration syntax
undefined '[' in function PostMessageX(HWND__ *,...

current source (added postmessage (sends "A" all the time o.o) (already works on private servers) to test)
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() {
   while (true) {
      HWND hWnd;
      hWnd = FindWindow(NULL,"MapleStory");

      PostMessage(hWnd,WM_CHAR,0x41,1);

      Sleep(1);
   }
}
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 5:34 pm    Post subject: Reply with quote

What compiler are you using?
_________________


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
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Sat Sep 06, 2008 7:02 pm    Post subject: Reply with quote

you can also do

Code:

mov eax, PMA
jmp eax
Back to top
View user's profile Send private message
DaNemeziz
Master Cheater
Reputation: 0

Joined: 29 Sep 2007
Posts: 430

PostPosted: Sun Sep 07, 2008 3:31 am    Post subject: Reply with quote

i found another bypass
Code:
LRESULT InjectMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
   WNDPROC WndProc;
   LRESULT lRET = 0;

   WndProc = (WNDPROC)GetWindowLong(hWnd, GWL_WNDPROC);
   if (WndProc != NULL)
      lRET = CallWindowProc(WndProc, hWnd, uMsg, wParam, lParam);
   return lRET;
}

i just need to figure out what WndProc is now :p
Back to top
View user's profile Send private message
Snootae
Grandmaster Cheater
Reputation: 0

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

PostPosted: Sun Sep 07, 2008 8:21 am    Post subject: Reply with quote

just a suggestion, dont just use sleep(1), it will use way to much memory, and there's no way programs will get all the clicks, try every tenth of a second, or twentieth

also, oib's code should work, tell us what the errors are and we'll try and help you Very Happy

_________________
Back to top
View user's profile Send private message
kathyalex
How do I cheat?
Reputation: 0

Joined: 22 Jan 2021
Posts: 2

PostPosted: Fri Jan 22, 2021 11:31 pm    Post subject: Giving error Reply with quote

Hey, thank you for the thread. I'm also learning c++ and I wanna make an auto clicker. I wanna use it for different games like Roblox and Minecraft. When I put code in compiler it says "windows.h" directory not found. Anyone can help me? I really wanna make an auto clicker but as I already told you I'm a beginner and don't know about these things.
Back to top
View user's profile Send private message
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 Previous  1, 2
Page 2 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