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 to understand the logic of bots.
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
kot1990
Expert Cheater
Reputation: 1

Joined: 06 Sep 2009
Posts: 131
Location: Greece

PostPosted: Tue Feb 09, 2010 6:32 pm    Post subject: Help to understand the logic of bots. Reply with quote

Anyone who has created a bot for mmorpg games? I want an explanation about how a bot works and what I have to learn to do it. I am not newbie. I understand C/C++ classes/pointers and all that stuff and a little winapi and how to write/read from memory. I don't ask for any hack/cheat for specific game.

What is really happening when I target something or attacking/using skill etc.? Is there a way to force the application do that?
Back to top
View user's profile Send private message
Jorg hi
I post too much
Reputation: 7

Joined: 24 Dec 2007
Posts: 2276
Location: Minnesota

PostPosted: Tue Feb 09, 2010 7:38 pm    Post subject: Reply with quote

"The logic of bots is as endless as the logic on programming." A simple way to do what you said would be to constantly read the value of your 'health' and everytime your health decreases you heal yourself by using SetCursor ex...

But a counter the first quote is "Logic is only limited by ability". So practice.

_________________
CEF will always stay alive.
Back to top
View user's profile Send private message
rooski
Master Cheater
Reputation: 0

Joined: 31 Oct 2007
Posts: 340
Location: Siberia

PostPosted: Tue Feb 09, 2010 7:51 pm    Post subject: Reply with quote

what kind of bot ? could be something like an autominer or autoattack, or something simpler like auto potter.
Back to top
View user's profile Send private message
kot1990
Expert Cheater
Reputation: 1

Joined: 06 Sep 2009
Posts: 131
Location: Greece

PostPosted: Tue Feb 09, 2010 7:59 pm    Post subject: Reply with quote

No autopot is crap, I mean like attacking,targeting etc. I thought maybe sending messages to the window, would that work?, but don't know what to send. Oh and the game I am trying to do is not packed exe or any other encryptions, it is all open! I even tried to use a debugger and it worked.

EDIT: How the game knows about my actions? I tried SendInput() and it works, but I don't want to send clicks or keyboard stuff, I want to make the action "run" like target or move without touching the input,, what I want to say is that I want the client to make the action directly.

EDIT2: I thought about that every control in the game has a unique id that would identify its action to the client, and the client keeps looping till it finds one of these actions and then runs it. If I find the location the game keeps that value and just writeprocessmemory on it, wouldn't that affect the game to start acting?
Back to top
View user's profile Send private message
AtheistCrusader
Grandmaster Cheater
Reputation: 6

Joined: 23 Sep 2006
Posts: 681

PostPosted: Wed Feb 10, 2010 7:18 am    Post subject: Reply with quote

You can hook the Attack(ID)? (or others) function, and call it yourself.
Back to top
View user's profile Send private message
tombana
Master Cheater
Reputation: 2

Joined: 14 Jun 2007
Posts: 456
Location: The Netherlands

PostPosted: Wed Feb 10, 2010 7:43 am    Post subject: Reply with quote

I have a bot for an mmorpg. What I do is basically have a thread that loops and does:

- check if it needs to use food
- check if it needs to get buffs
- attack every monster on the target list
- if the targetlist is empty (all monsters on the list died) then add new monsters
- repeat

I use packet editing. So I receive the packets from the server and parse them to get the monster info and so on. And to attack I send packets etc.
Back to top
View user's profile Send private message
kot1990
Expert Cheater
Reputation: 1

Joined: 06 Sep 2009
Posts: 131
Location: Greece

PostPosted: Wed Feb 10, 2010 12:49 pm    Post subject: Reply with quote

tombana wrote:
I have a bot for an mmorpg. What I do is basically have a thread that loops and does:

- check if it needs to use food
- check if it needs to get buffs
- attack every monster on the target list
- if the targetlist is empty (all monsters on the list died) then add new monsters
- repeat

I use packet editing. So I receive the packets from the server and parse them to get the monster info and so on. And to attack I send packets etc.


In what language did you write this? Can you help me with some code please?
Back to top
View user's profile Send private message
tombana
Master Cheater
Reputation: 2

Joined: 14 Jun 2007
Posts: 456
Location: The Netherlands

PostPosted: Wed Feb 10, 2010 5:13 pm    Post subject: Reply with quote

kot1990 wrote:
In what language did you write this? Can you help me with some code please?

I wrote it in C++. Sure, just post it or PM I guess.
Back to top
View user's profile Send private message
kot1990
Expert Cheater
Reputation: 1

Joined: 06 Sep 2009
Posts: 131
Location: Greece

PostPosted: Wed Feb 10, 2010 5:38 pm    Post subject: Reply with quote

tombana wrote:
I wrote it in C++. Sure, just post it or PM I guess.


I don't actually have some code xD, I want you to help me with providing a little code or just the idea where to look for. For example I want to use a skill on a mob. I could send an input to push the key where I have placed the skill, but I mentioned before that I don't want to use the keyboard to do that. I know it can be done in other way but don't know how. I have a similar bot to what I want to do, but it lacks of functions that are important to me and I don't want to use it. Of course I have the executable of it, no any source.

EDIT: Oh, and for the packet editing, I also tried to capture some of the client's packets like chatting/moving, but when I send them, they seem to be illegal and nothing happens. I did use an external program to capture and send packets, but TCP uses packet numbering, and the packet I'm just resending doesn't have the corrent number, I think I have to attach the packet sending thing to the client, so it sends the correct packet to the server.
Back to top
View user's profile Send private message
AtheistCrusader
Grandmaster Cheater
Reputation: 6

Joined: 23 Sep 2006
Posts: 681

PostPosted: Thu Feb 11, 2010 7:30 am    Post subject: Reply with quote

The packets are encrypted, you could however try decrypting them.
Back to top
View user's profile Send private message
kot1990
Expert Cheater
Reputation: 1

Joined: 06 Sep 2009
Posts: 131
Location: Greece

PostPosted: Thu Feb 11, 2010 9:08 am    Post subject: Reply with quote

I don't think so, I compared 2 of the sent packets doing the same action and the only difference is on the TCP header, the Sequence number and the checksum, these always change. The data and all other remain the same. So how can I send the next valid packet? I tried on many applications that use UDP and not TCP, and it worked because UDP is not using sequence numbers for its packets.

EDIT: I even tried to customize the packet so the next packet number will be the correct, and also corrected the checksum(tried that on mIRC channel) and it failed Confused

EDIT2: I think I should start doing some winsock programming Smile
Back to top
View user's profile Send private message
SBAOM
Newbie cheater
Reputation: 0

Joined: 10 Feb 2010
Posts: 19

PostPosted: Sun Feb 14, 2010 12:51 pm    Post subject: Reply with quote

Artificial intelligence, man, A.I. You have to create a code that imitates as much as possible H.I (Human intelligence or whatever). For instance, when you see an enemy in a MMORPG, you attack them with the proper attack, maybe, cause you want to kill'im, right? So you have to make a code that acts like a "Human Mind". If you are developing a MMORPG, you probably have some kind of "Class" (OOP) for a character, right? Each character has got an index. An array of characters, that is it. You should create some kind of NPC class which is a clone of the other one, but is used in a different way. That is without receiving orders from any I.P but the server I.P in itself.
Hope that helped, I didn't really ever created a bot or npc, but I'm very sure about what I told you above.
Back to top
View user's profile Send private message
kot1990
Expert Cheater
Reputation: 1

Joined: 06 Sep 2009
Posts: 131
Location: Greece

PostPosted: Sun Feb 14, 2010 3:38 pm    Post subject: Reply with quote

SBAOM wrote:
Artificial intelligence, man, A.I. You have to create a code that imitates as much as possible H.I (Human intelligence or whatever). For instance, when you see an enemy in a MMORPG, you attack them with the proper attack, maybe, cause you want to kill'im, right? So you have to make a code that acts like a "Human Mind". If you are developing a MMORPG, you probably have some kind of "Class" (OOP) for a character, right? Each character has got an index. An array of characters, that is it. You should create some kind of NPC class which is a clone of the other one, but is used in a different way. That is without receiving orders from any I.P but the server I.P in itself.
Hope that helped, I didn't really ever created a bot or npc, but I'm very sure about what I told you above.


Artificial intelligence part is not that hard. I'm stuck at the hacking part. Now that I have learned some networking with TCP/IP winsock I've got specific questions generated.

Creating a new socket connecting, is not the solution I think. I have to manipulate the existing connection created by the game client, so I have to send to the clients socket the data. How can I do that?

EDIT1: The sniffing part is just copy paste to the buffer just a crap and a little editing, that's not hard.
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Sun Feb 14, 2010 4:59 pm    Post subject: Reply with quote

during the sniffing part, assuming you are hooking send()/recv(), a socket descriptor is specified
Back to top
View user's profile Send private message
kot1990
Expert Cheater
Reputation: 1

Joined: 06 Sep 2009
Posts: 131
Location: Greece

PostPosted: Sun Feb 14, 2010 5:28 pm    Post subject: Reply with quote

Slugsnack wrote:
during the sniffing part, assuming you are hooking send()/recv(), a socket descriptor is specified


The socket descriptor is unique? I tried to run 2 instances of a client and they both generated the same socket descriptor. I don't know If I reffer to the correct meaning of it. I think the socket descriptor is this

SOCKET descriptor = socket();

and is defined as u_long

EDIT: I tried to do the following:
Created a little application that listens on a socket and accepts only 1 connection. The client does connect to that application and it generates the socket with id 104. I then tried to use send(104,buffer,sizeof(buffer),0); (from another application)
but that failed as there are more that 1 sockets with the value 104, so I'm not reffering to the correct thing. Confused Confused Confused

What hooking exactly is? I think I understand that if I hook these functions I will be able to use my own send/recv functions, but how this is done, I know I need the address of the function send/recv by getting it with GetProcAddress();, and then what am I gonna do with this address? Question Will that work only for the game client or will generally work on all send/recv calls to ws2_32.dll module?
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
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