• Advertisement

BOT: ZX/JD/CD - VB6 Template & Source Code

The best place to learn new things.

BOT: ZX/JD/CD - VB6 Template & Source Code

Postby iNFIDEL_ on 15 Mar 2010, 04:07

A bot template for ZX/Jade Dynasty/Celestial Destroyer
I asked a friend to make me a template.
The Template was written in VB6.
There are no codes on it. Only some GUI that gives you idea of bot implementation.
This may help you as you make your projects with bots.

I've shown him "joker's bot" and the concept may be similar to it.


DL:
ZxBotProject.zip



P.S.
I do not know if this belongs to the tutorial section.
This is designed for Memory Based Bots, not packet bots (clientless).

No binary attached. Only VB Files.
Only registered users can view the files attached to this post.
Last edited by iNFIDEL_ on 29 Mar 2010, 14:37, edited 1 time in total.
iNFIDEL_
Newbie
 
Posts: 60
Joined: 23 Feb 2010, 20:49
Has thanked: 1 time
Have thanks: 3 time

Postby MrSmith on 15 Mar 2010, 16:16

This should include ReadProcessMemory/WriteProcessMemory API in a module ^^. But here are the API's you can add to a module anyway.

API
Code: Select all
Public Declare Function WriteProcessMemory Lib "kernel32" Alias "WriteProcessMemory" (ByVal hProcess As Long, lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long

Public Declare Function ReadProcessMemory Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Long, lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long

Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Public Declare Function OpenProcess Lib "kernel32" Alias "OpenProcess" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long


These are the API that you'll use to find the game client, open the process so that you're able to read/write to the process memory.

Here's a snippet of how to use the FindWindow API

Code: Select all
Dim myWin as Long

myWin& = FindWindow(<Classname Here>, <Window Title Here>)
      If (myWin& = 0) Then
            Exit Sub '// Basically stop command if no window is found.
      Else
            '//Execute function here. Usually open process. :)
      End If


Replace Classname Here with the classname of the window you'll be trying to find, If you're unable to re-produce the windows title (for example if they're chinese characters) vb6 doesn't support it so just use "vbNullstring"
Image

If my doctor told me I had only six minutes to live, I wouldn't brood. I'd type a little faster.

For this message the author MrSmith has received thanks - 5:
AllonsStar, Fwadsson, Ligfriego, Nimfgeone, royark
User avatar
MrSmith
Coder
Coder
 
Posts: 703
Joined: 04 Oct 2009, 16:10
Has thanked: 23 time
Have thanks: 142 time
Blog: View Blog (3)

Postby iNFIDEL_ on 15 Mar 2010, 19:18

There's a slight problem for me.
I do not know how to Send Key into a PID while if I use AutoHotKey I am able to.
>_<
I wanted to send all the keys to specific "process". So I can just launch, elementclient1.exe, elementclient2.exe and so on...
iNFIDEL_
Newbie
 
Posts: 60
Joined: 23 Feb 2010, 20:49
Has thanked: 1 time
Have thanks: 3 time

Postby MrSmith on 16 Mar 2010, 15:14

iNFIDEL_ wrote:There's a slight problem for me.
I do not know how to Send Key into a PID while if I use AutoHotKey I am able to.
>_<
I wanted to send all the keys to specific "process". So I can just launch, elementclient1.exe, elementclient2.exe and so on...


I'm not quite sure i understand what you mean. I think you mean make a launcher for example press X key open elementclient1 press Y key open elementclient2 ?
Image

If my doctor told me I had only six minutes to live, I wouldn't brood. I'd type a little faster.
User avatar
MrSmith
Coder
Coder
 
Posts: 703
Joined: 04 Oct 2009, 16:10
Has thanked: 23 time
Have thanks: 142 time
Blog: View Blog (3)

Postby iNFIDEL_ on 16 Mar 2010, 18:57

No no.
You see, when I am using AutoHotKey (similar to AutoIt), I can Send any keys directly to the Processname.
I only need the PID and AutoHotKey will send the keys to that PID.
However in VB6, I do not know how. :(

Ps. Seems your the only guy I can talk to about this, I need help on something about VB.
Can you spare me a code on HP / MP detection? So that My bot soon to be will "HEAL" according to the settings. Much like zBot from Joker.

Using the template above of course. :D

Edit
This is the best opportunity for me to build my own bot and learn from it. Of course I need someone that can help me in the process.

Edit 2
A Crap, I disregard my previous idea about sending keys to pid.
I succeeded sending keys to the window BUT it will not send keys if I wont press "enter". LOL.
fail.
Only registered users can view the files attached to this post.
iNFIDEL_
Newbie
 
Posts: 60
Joined: 23 Feb 2010, 20:49
Has thanked: 1 time
Have thanks: 3 time

Postby MrSmith on 16 Mar 2010, 21:20

ZX/CD/JD is the game we're talking about in particular ?

As regards to sending keys to the PID. You can get this using FindWindow & SendMessage API.
It doesn't always work with all games as some have protection against SendMessage.

Here is the function to find that ID and use that ID to change the title of the window itself.

Place this in a module
Code: Select all
Public Declare Function SendMessageByStr Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long

Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Const WM_SETTEXT = &HC



Code: Select all
'// Declare lJade& variable as a long value
Dim myWnd As Long
Dim sTitle as String
   
'//Change My Title to whichever you want
sTitle = "My Title"

'//Find "ZElementClient Window" (Classname), vbNullString (Title) and set it into our variable (lJade&)
myWnd& = FindWindow("ZElementClient Window", vbNullString)

'//If our variable returns 0 then alert user that game isn't running. Otherwise SendMessageByStr to our game
client and set the title to text in textbox1. Trim just removes any unecessary spaces.
If (myWnd& = 0) Then
MsgBox "Jade Dynasty/ZhuXian Not Found", vbExclamation + vbOkOnly, "Error"
Else
SendMessageByStr(myWnd&, WM_SETTEXT, Trim$(sTitle)
End If


This is a simple function to change the title of a windowtitle using the FindWindow & SendMessage API functions.

If you want to know the actual PID of the window you want simply add a Textbox & a Command button to the form
in Command button code type this

Code: Select all
Dim myWnd as Long

myWnd& = FindWindow("ZElementClient Window", vbNullstring)
If (myWnd& = 0) Then
Exit Sub
Else
Text1.text = "Window PID : " & myWnd
End If
Image

If my doctor told me I had only six minutes to live, I wouldn't brood. I'd type a little faster.
User avatar
MrSmith
Coder
Coder
 
Posts: 703
Joined: 04 Oct 2009, 16:10
Has thanked: 23 time
Have thanks: 142 time
Blog: View Blog (3)

Postby iNFIDEL_ on 16 Mar 2010, 21:57

Yes, particularly talking about JD/ZX/CD.
iNFIDEL_
Newbie
 
Posts: 60
Joined: 23 Feb 2010, 20:49
Has thanked: 1 time
Have thanks: 3 time

Postby MrSmith on 16 Mar 2010, 22:08

Joker found this one out, ZX/JD/CD all use protection against the common SendMessage API so he devised a plan for it to work with PostMessage. This uses commands such as WM_LBUTTONDOWN/WM_LBUTTONUP to simulate a mouseclick. Firstly if you want to make a bot to auto-heal you'll have to use ReadProcessMemory API to read the address of the game's value.
Image

If my doctor told me I had only six minutes to live, I wouldn't brood. I'd type a little faster.
User avatar
MrSmith
Coder
Coder
 
Posts: 703
Joined: 04 Oct 2009, 16:10
Has thanked: 23 time
Have thanks: 142 time
Blog: View Blog (3)

Postby iNFIDEL_ on 17 Mar 2010, 16:01

>_<
That's beyond my skills.
iNFIDEL_
Newbie
 
Posts: 60
Joined: 23 Feb 2010, 20:49
Has thanked: 1 time
Have thanks: 3 time

Postby MrSmith on 17 Mar 2010, 18:38

That's why i'm here to help :)
Image

If my doctor told me I had only six minutes to live, I wouldn't brood. I'd type a little faster.
User avatar
MrSmith
Coder
Coder
 
Posts: 703
Joined: 04 Oct 2009, 16:10
Has thanked: 23 time
Have thanks: 142 time
Blog: View Blog (3)

Next

Return to Tutorials