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 


[help] Auto-Login bot

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
ShurikeN
Advanced Cheater
Reputation: 0

Joined: 09 Jan 2008
Posts: 84

PostPosted: Sat Mar 29, 2008 2:47 am    Post subject: [help] Auto-Login bot Reply with quote

i'm planning to make an auto-login bot for my online game.
all i know is how to send input to notepad using this code

Code:

HWND notepad_window = FindWindow("Notepad", NULL);
        HWND textbox_window = FindWindowEx(notepad_window, NULL, "Edit", NULL);

        string my_string;

        cout << "Enter a word to send to Notepad: ";
        cin >> my_string;

        for (int i = 0; i < my_string.size(); i++)
            SendMessage(textbox_window, WM_CHAR, (int)my_string[i], 1);


now, in my online game im having a problem on locating the class of the dialog box or the login box which the user inputs his Username and Password. i tried using Winspector and Spy++ but they failed.

is there other method that i can use??

_________________
Code:
XXXXXX      XXXXXX
   XXXXX  XXXXX
     XXXXXXXX
    D I R E C T
     XXXXXXXX
   XXXXX  XXXXX
XXXXXX      XXXXXX
      GameDev
Back to top
View user's profile Send private message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Sat Mar 29, 2008 2:52 am    Post subject: Reply with quote

i'm guessing it's MS, anyways.

the boxes don't have a class name but they have cords (x,y)

SetCursorPos() (which is probably hooked) then use MakeLong(x,y) (MakelParam())

on lParam @ PostMessage.
Back to top
View user's profile Send private message
ShurikeN
Advanced Cheater
Reputation: 0

Joined: 09 Jan 2008
Posts: 84

PostPosted: Sat Mar 29, 2008 3:05 am    Post subject: Reply with quote

ok, tnx for the quick reply. anyway, do you have a source that i can look? don't know how to start with it, am not really good at win32. by the way, it's Tantra Online not MS.
_________________
Code:
XXXXXX      XXXXXX
   XXXXX  XXXXX
     XXXXXXXX
    D I R E C T
     XXXXXXXX
   XXXXX  XXXXX
XXXXXX      XXXXXX
      GameDev
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: Sat Mar 29, 2008 10:03 am    Post subject: Reply with quote

Look for any bot that sets the Mouse coordinates, it's not to hard to understand.

You could even check out some APIs on MSDN.

Simply move the mouse to the coordinate of the UN box, click, type in the UN, move the mouse to the PW box, click, type i the PW, then hit enter.

Simple bot, really.

_________________
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
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sat Mar 29, 2008 10:28 am    Post subject: Reply with quote

You also might wanna get the Dialog Addy and Logged In Addy's so it works for all computers.

there not that hard to find Wink

_________________
Back to top
View user's profile Send private message
Reak
I post too much
Reputation: 0

Joined: 15 May 2007
Posts: 3496

PostPosted: Sat Mar 29, 2008 12:48 pm    Post subject: Reply with quote

FYI, For the way Groot posted you can't click on buttons. (probably not even on the Edit-boxes)
Back to top
View user's profile Send private message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Sun Mar 30, 2008 1:28 am    Post subject: Reply with quote

my bot has auto login, but it's harder with GG since the cords are fuckwed up

here's my latest src of kBot with AutoLogin(it'll just enter the id and pw and click enter since the pin needs PUrandom)

Code:
unit MUnit;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, jpeg, StdCtrls, ComCtrls,IniFiles;

const
F1 = VK_F1;
F2 = VK_F2;
F3 = VK_F3;
F4 = VK_F4;
F5 = VK_F5;
F6 = VK_F6;
F7 = VK_F7;
F8 = VK_F8;
F9 = VK_F9;
F10 = VK_F10;

type
  TMForm = class(TForm)
    TheTimer: TTimer;
    RotemA: TImage;
    aTxt: TEdit;
    hpTxt: TEdit;
    mpTxt: TEdit;
    IdText: TEdit;
    PwText: TEdit;
    hL: TLabel;
    procedure TheTimerTimer(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  MForm: TMForm;
  AlB,AjB,AaB,AsB,AchtB,hpB,mpB:boolean;

Procedure SaveSettings; 

{PMX.dll and kBot made by Groot @ CEF}

implementation

{$R *.dfm}

function PMX(
hWnd:HWND;
MSG:UINT;
WPARAM:wParam;
LPARAM:lParam):BOOL;stdcall;
var DblWord:DWORD;
    hHandle:THandle;
begin
hHandle:=LoadLibrary('user32.dll');
DblWord:=DWORD(GetProcAddress(hHandle,'PostMessageA'))+5;
 asm
 mov edi,edi
 push ebp
 mov esp,ebp
 jmp [DblWord]
 end;
end;

function Key(vKey:integer):boolean;
begin
result:=odd(GetAsyncKeyState(vKey));
end;

procedure SleepX(dwMilliseconds: Longint); //Took this procedure from Torry's to avoid application freeze
var
  iStart, iStop: DWORD;
begin
  iStart := GetTickCount;
  repeat

  if Key(F8) then
   Begin
   AlB:=False;
   AjB:=False;
   AaB:=False;
   AsB:=False;
   AchtB:=False;
   hpB:=False;
   mpB:=False;
   End;


if Key(F7) then mpB:=False;
if Key(F6) then hpB:=False;
if Key(F5) then AchtB:=False;
if Key(F4) then AsB:=False;
if Key(F3) then AaB:=False;
if Key(F2) then AjB:=False;
if Key(F1) then AlB:=False;


    iStop := GetTickCount;
    Application.ProcessMessages;
    Sleep(3); //to avoid high CPU last
  until (iStop - iStart) >= dwMilliseconds;
end;

//Note that you'll see shl 16 is to shift the bit 16 times <-- Left
//we allocate using MapVirtualKey(); the key we want to use
//For those who don't understand what are those Hex ($) symbols
//they are to define the key instead of typing VK_XX
//for more Virtual Keys visit:
//http://delphi.about.com/od/objectpascalide/l/blvkc.htm

Procedure AutoLoot;
var
h:hWnd;
A,B:DWORD;
M,S,C:String;
begin
M:=PChar('Maple');
S:=PChar('Story');
C:=PChar('Class');

 h:=FindWindowA(PAnsiChar(M+S+C),nil);

 A:=MapVirtualKey($5A,0);
 A:=A shl 16;

 B:=MapVirtualKey($60,0);
 B:=B shl 16;

  if h<>0 then
   begin

    PMX(h,WM_KEYDOWN,$5A,A);
    SleepX(10);
    PMX(h,WM_KEYUP,$5A,A);

    PMX(h,WM_KEYDOWN,$60,B);
    SleepX(10);
    PMX(h,WM_KEYUP,$60,B);
   
    Application.ProcessMessages;
   end;
end;

Procedure AutoJump;
var
h:hWnd;
A:DWORD;
M,S,C:String;
begin
M:=PChar('Maple');
S:=PChar('Story');
C:=PChar('Class');

 h:=FindWindowA(PAnsiChar(M+S+C),nil);
 
 A:=MapVirtualKey($12,0);
 A:=A shl 16;

  if h<>0 then
   begin
    PMX(h,WM_KEYDOWN,$12,A);
    SleepX(10);
    PMX(h,WM_KEYUP,$12,A);
    Application.ProcessMessages;
   end;
end;

Procedure AutoAtk;
var
h:hWnd;
A:DWORD;
M,S,C:String;
begin
M:=PChar('Maple');
S:=PChar('Story');
C:=PChar('Class');

 h:=FindWindowA(PAnsiChar(M+S+C),nil);

 A:=MapVirtualKey($11,0);
 A:=A shl 16;

  if h<>0 then
   begin
    PMX(h,WM_KEYDOWN,$11,A);
    SleepX(10);
    PMX(h,WM_KEYUP,$11,A);
    Application.ProcessMessages;
   end;
end;

Procedure AutoSkill;
var
h:hWnd;
A:DWORD;
M,S,C:String;
begin
M:=PChar('Maple');
S:=PChar('Story');
C:=PChar('Class');

 h:=FindWindowA(PAnsiChar(M+S+C),nil);

 A:=MapVirtualKey($42,0);
 A:=A shl 16;

  if h<>0 then
   begin
    PMX(h,WM_KEYDOWN,$42,A);
    SleepX(10);
    PMX(h,WM_KEYUP,$42,A);
    Application.ProcessMessages;
   end;
end;

Procedure AutoChat(Text:String);
var
h:hWnd;
A:integer;
B:DWORD;
M,S,C:String;
begin
M:=PChar('Maple');
S:=PChar('Story');
C:=PChar('Class');

 h:=FindWindowA(PAnsiChar(M+S+C),nil);

 B:=MapVirtualKey($0D,0);
 B:=B shl 16;

  if h<>0 then
  for A:=1 to Length(Text) do
    PMX(h,WM_CHAR,Ord(Text[A]),0);


  PMX(h,WM_KEYDOWN,$0D,B);
  SleepX(10);
  PMX(h,WM_KEYUP,$0D,B);
  Application.ProcessMessages;

end;

Procedure AutoHP;
var
h:hWnd;
A:DWORD;
M,S,C:String;
begin
M:=PChar('Maple');
S:=PChar('Story');
C:=PChar('Class');

 h:=FindWindowA(PAnsiChar(M+S+C),nil);

 A:=MapVirtualKey($30,0);
 A:=A shl 16;

  if h<>0 then
   begin
    PMX(h,WM_KEYDOWN,0,A);
    SleepX(10);
    PMX(h,WM_KEYUP,0,A);
    Application.ProcessMessages;
   end;
end;

Procedure AutoMP;
var
h:hWnd;
A:DWORD;
M,S,C:String;
begin
M:=PChar('Maple');
S:=PChar('Story');
C:=PChar('Class');

 h:=FindWindowA(PAnsiChar(M+S+C),nil);
 A:=MapVirtualKey($39,0);
 A:=A shl 16;

  if h<>0 then
   begin
    PMX(h,WM_KEYDOWN,0,A);
    SleepX(10);
    PMX(h,WM_KEYUP,0,A);
    Application.ProcessMessages;
   end;
end;

Procedure SndMsg(Text:String);
var
h:hWnd;
A:integer;
M,S,C:String;
begin
M:=PChar('Maple');
S:=PChar('Story');
C:=PChar('Class');

 h:=FindWindowA(PAnsiChar(M+S+C),nil);

  if h<>0 then
  for A:=1 to Length(Text) do
    PMX(h,WM_CHAR,Ord(Text[A]),0);
end;

Procedure AutoLogin;
Procedure PrsTAB;
var
TAB:DWORD;
h:HWND;
M,S,C:string;
begin
M:=PChar('Maple');
S:=PChar('Story');
C:=PChar('Class');

 h:=FindWindowA(PAnsiChar(M+S+C),nil);
 
 TAB:=MapVirtualKey($09,0);
 TAB:=TAB shl 16;
 
    PMX(h,WM_KEYDOWN,$09,TAB);
    Sleep(5);
    PMX(h,WM_KEYUP,$09,TAB);
end;
var
h:hWnd;
A,B:DWORD;
M,S,C:String;
l:integer;
begin
M:=PChar('Maple');
S:=PChar('Story');
C:=PChar('Class');

 h:=FindWindowA(PAnsiChar(M+S+C),nil);
 
 A:=MapVirtualKey($0D,0);
 A:=A shl 16;

 B:=MapVirtualKey($08,0);
 B:=B shl 16;

  if h<>0 then
   begin
     Setforegroundwindow(h);

     PMX(h,WM_LBUTTONDOWN,0,MakeLong(567,276-30));
     PMX(h,WM_LBUTTONUP,0,MakeLong(567,276-30));

    for l:=1 to 30 do
     begin
      PMX(h,WM_KEYDOWN,$08,B);
      Sleep(5);
      PMX(h,WM_KEYUP,$08,B);
     end;

      PrsTAB;

     for l:=1 to 30 do
     begin
      PMX(h,WM_KEYDOWN,$08,B);
      Sleep(5);
      PMX(h,WM_KEYUP,$08,B);
     end;

      PMX(h,WM_LBUTTONDOWN,0,MakeLong(567,276-30));
      PMX(h,WM_LBUTTONUP,0,MakeLong(567,276-30));

      SndMsg(MForm.IdText.Text);

      PrsTAB;

      SndMsg(MForm.PwText.Text);

      Sleep(5);   

      PMX(h,WM_KEYDOWN,$0D,A);
      PMX(h,WM_KEYUP,$0D,A);

   end;
end;


procedure TMForm.TheTimerTimer(Sender: TObject);
var
MyH:hWnd;
M,S,C:String;
begin
M:=PChar('Maple');
S:=PChar('Story');
C:=PChar('Class');

 MyH:=FindWindow(PAnsiChar(M+S+C),nil);
 
 if MyH<>0 then
  begin
  hL.Font.Color:=clBlue;
  hL.Caption:='HWND ''MapleStoryClass'' Is Present';
  End
  Else
   Begin
   hL.Font.Color:=clRed;
   hL.Caption:='HWND ''MapleStoryClass'' Not Present';
   End;

 //Auto Loot
 if Key(F1) then
 Begin
 AlB:=True;
 Setforegroundwindow(MyH);
 while AlB = True do
  Begin
 if Key(F1) then AlB:=False;
 AutoLoot;
 Application.ProcessMessages;
  End;
 End;

 //Auto Jump
 if Key(F2) then
 Begin
 AjB:=True;
 Setforegroundwindow(MyH);
 while AjB = True do
  Begin
 if Key(F2) then AjB:=False;
 AutoJump;
 Application.ProcessMessages;
  End;
 End;

 //Auto Attack
 if Key(F3) then
 Begin
 AaB:=True;
 Setforegroundwindow(MyH);
 while AaB = True do
  Begin
 if Key(F3) then AaB:=False;
 AutoAtk;
 Application.ProcessMessages;
  End;
 End;

 //Auto Skill
 if Key(F4) then
 Begin
 AsB:=True;
 Setforegroundwindow(MyH);
 while AsB = True do
  Begin
 if Key(F4) then AsB:=False;
 AutoSkill;
 Application.ProcessMessages;
  End;
 End;

 //Auto Chat
 if Key(F5) then //AutoChat('This is Groot @ CEF');
 Begin
 AchtB:=True;
 Setforegroundwindow(MyH);
 while AchtB = True do
  Begin
 if Key(F5) then AchtB:=False;

 SleepX(1000);
 AutoChat(aTxt.Text);

 if Key(F5) then AchtB:=False;

 SleepX(500);
 AutoChat(aTxt.Text+'.');

 if Key(F5) then AchtB:=False;
 Application.ProcessMessages;
  End;
 End;

 if Key(F6) then
  Begin
  hpB:=True;
  Setforegroundwindow(MyH);
  While hpB = True do
   Begin
   if Key(F6) then hpB:=False;
   AutoHP;
   SleepX(StrToInt(hpTxt.Text+'000'));
   Application.ProcessMessages;
   End;
  End;

 if Key(F7) then
  Begin
  mpB:=True;
  Setforegroundwindow(MyH);
  While mpB = True do
   Begin
   if Key(F7) then mpB:=False;
   AutoMP;
   SleepX(StrToInt(mpTxt.Text+'000'));
   Application.ProcessMessages;
   End;
  End;

  if Key(F9) then AutoLogIn;

  if Key(F10) then
  MessageBox(0,
  'Auto Loot -   F1 (Z,NUM0)'
  +#10+#13+
  ''
  +#10+#13+
  'Auto Jump - F2 (ALT)'
  +#10+#13+
  ''
  +#10+#13+
  'Auto Attack - F3 (CTRL)'
  +#10+#13+
  ''
  +#10+#13+
  'Auto Skill - F4 (B)'
  +#10+#13+
  ''
  +#10+#13+
  'Auto Chat - F5'
  +#10+#13+
  ''
  +#10+#13+
  'Auto HP - F6'
  +#10+#13+
  ''
  +#10+#13+
  'Auto MP - F7'
  +#10+#13+
  ''
  +#10+#13+
  'Stop All - F8'
  ,'HotKeys',0);

end;

Procedure SaveSettings;
var
  IniFile:TIniFile;
begin
    IniFile:=TIniFile.Create(GetCurrentDir + '\Data.ini');
    IniFile.WriteString('Settings','ID',MForm.IdText.Text);
    IniFile.WriteString('Settings','PW',MForm.PwText.Text);
    IniFile.WriteString('Settings','ChatText',MForm.aTxt.Text);
end;

procedure TMForm.FormDestroy(Sender: TObject);
begin
SaveSettings;

{MessageBox(0
,'Made by Groot @ CEF'
+#10+#13+
'Thanks to assaf127,Renko,x0r and sphere90'
,'Note!'
,0); }

end;

Procedure LoadSettings;
var
  IniFile:TIniFile;
  ID,PW,Chat:string;
begin
   if not FileExists(GetCurrentDir + '\Data.ini') then
   SaveSettings
   else
   begin
    IniFile:=TIniFile.Create(GetCurrentDir + '\Data.ini');
    ID:=IniFile.ReadString('Settings','ID',MForm.IdText.Text);
    PW:=IniFile.ReadString('Settings','PW',MForm.PwText.Text);
    Chat:=IniFile.ReadString('Settings','ChatText',MForm.aTxt.Text);

    MForm.IdText.Text := ID;
    MForm.PwText.Text := PW;
    MForm.aTxt.Text := Chat;
  end;
end;

procedure TMForm.FormCreate(Sender: TObject);
begin
LoadSettings;
end;

end.
Back to top
View user's profile Send private message
ShurikeN
Advanced Cheater
Reputation: 0

Joined: 09 Jan 2008
Posts: 84

PostPosted: Sun Mar 30, 2008 6:11 pm    Post subject: Reply with quote

tnx for the source Groot.

i have another question, how do i implement hooking into a hidden process?? in cheat engine i can find it in the process list by searching all processes with "??????" names one-by-one.

btw, C++.

_________________
Code:
XXXXXX      XXXXXX
   XXXXX  XXXXX
     XXXXXXXX
    D I R E C T
     XXXXXXXX
   XXXXX  XXXXX
XXXXXX      XXXXXX
      GameDev
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sun Mar 30, 2008 6:31 pm    Post subject: Reply with quote

You could get the pID and Handle of the process at the Ad in the beggining and just store them.

You could build a driver to check the Process's if u want, but its probly easier for now to just get the info at the ad.

_________________
Back to top
View user's profile Send private message
ShurikeN
Advanced Cheater
Reputation: 0

Joined: 09 Jan 2008
Posts: 84

PostPosted: Sun Mar 30, 2008 9:38 pm    Post subject: Reply with quote

ok i made it, but there's still problem and it's so annoying. the gameguard keeps hiding the PROCESSENTRY32 name of the game which in result i can't find it in the process list. and the only way i found is to use Kaspersky Anti-Virus' Pro-active Defense to block that gameguard from hiding it. in that way i can attach my bot successfully.

how can i search for a hidden process??

_________________
Code:
XXXXXX      XXXXXX
   XXXXX  XXXXX
     XXXXXXXX
    D I R E C T
     XXXXXXXX
   XXXXX  XXXXX
XXXXXX      XXXXXX
      GameDev
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Wed Apr 02, 2008 9:35 am    Post subject: Reply with quote

Make a driver for it that scans low-level/hidden processes?
Or attach it at the ad-screen, its still MapleStory.exe

_________________
Back to top
View user's profile Send private message
Anden100
Grandmaster Cheater
Reputation: 0

Joined: 20 Apr 2007
Posts: 668

PostPosted: Thu Apr 03, 2008 7:13 am    Post subject: Reply with quote

Groot, do MS detect 'MapleStoryClass'? last i checked the only detected ('MapleStoryClass', 'MapleStory'), atleast, thats what they detected last time i checked..., did anything change? cas' then ill need to edit my source a bit...
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 All times are GMT - 6 Hours
Page 1 of 1

 
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