Analyse Questions needs clarification

Inscrit
11 Juillet 2017
Messages
31
Reactions
0
#1
Hey, How's everything going ?
Anyhow Um...I have some points that need some clarification
1) What are the .D2o files and why do we need them if we're just going to read packets and respond relatively
2) How's Encryption work those for the account name and password and some Other ones like the AES,
I've been using some code from open source Projects and i don't understand why the encryption is needed
Thanks :)
 
Inscrit
25 Février 2012
Messages
178
Reactions
3
#2
D2o files are "data" files.
For example, if you look (by look I mean, properly reading from a .d2o file) at Items.d2o you'll find all the informations of all the items in the game.
Why do we need them?
The server only sends you the GIDs of items (GID = Generic ID), so if you want more than just that (Name, Usable or not, effects, etc..) you'll have to look that GID in Items.d2o to get all those informations.
 

zahid98

Membre Actif
Inscrit
13 Decembre 2014
Messages
352
Reactions
2
#3
for the second question , encryption is a simple protectetopn from Ankama to protect user's credential since without any encryption anyone can intercept the packets (using your wifi as an instance) . Anakama uses an RSA encryption , wich is based on two keys , public and private one , the public on is used to encrypt to data and can be found on the binary data of the clients , the private one is used to decrypt the data so none will never be able to decrypt your credentials since the private key is private ahaha . check for RSA on google for more information , hope it helped understand why the encryption.
Edit : here is the source link of the lib used by ankama on all their encryptions http://crypto.hurlant.com/demo/srcview/ .
 
Inscrit
11 Juillet 2017
Messages
31
Reactions
0
#4
Thanks guys that was really helpful One last thing i need to know is were in he source i can find he way he client supposed to answer to each packet like the switch statement or anything of that kind that differentiate between each packet so i can know what to do in my bot Thanks again :)
 
Inscrit
25 Février 2012
Messages
178
Reactions
3
#5
They are called Frames and every type of messages is handled by one of them ^^
 
Inscrit
11 Juillet 2017
Messages
31
Reactions
0
#6
I'm not sure if you Understood me
for example :
i open an open source project and found this big Switch statement that is being called for each packet that comes after the deserialized
after the ServerListMessage i does the following code (just an example it's an old project anyway)
Code:
ServersListMessage servers = (ServersListMessage)e.Packet;
  foreach(GameServerInformations i in servers.Servers ){
    if (i.CharactersCount > 0 && i.IsSelectable && (ServerStatusEnum)i.Status == ServerStatusEnum.ONLINE)
       {
            _ServerSocket.Send(new ServerSelectionMessage(i.ObjectID));
                break;
       }
 }
So what i want to know is how the person who made this knew what/how to respond if it is in the sources can you point me to it,Thanks And sorry for being a bothersome :)
 
Inscrit
25 Février 2012
Messages
178
Reactions
3
#7
Your example doesn't come from D2 Sources ^^
You simply just use a Sniffer and see how the client responds and you mimic its behavior.
Once you find something (like a calculation) that you can't see with the Sniffer, you go and look in the sources to see how its done. (com\ankamagames\dofus\logic)

PS: Sniffer is either a software that listens and parses the messages coming for the server, or a MITM (Man in the middle) type of Bot that places itself in the middle of the client and the server and gives you all the messages that they are sending to each other (like AmaknaCore.Sniffer from BlueDream (1004))
 

zahid98

Membre Actif
Inscrit
13 Decembre 2014
Messages
352
Reactions
2
#8
Thanks guys that was really helpful One last thing i need to know is were in he source i can find he way he client supposed to answer to each packet like the switch statement or anything of that kind that differentiate between each packet so i can know what to do in my bot Thanks again :)
Apokah's first answer was right , if you want to know how the client handles each packet , you gotta check the frames . as an instance , for the identification packets , look for something like identificationFrame.as on the sources .
You can also use 'find all' option wich is available on most code editors (sublim text like ?) and look for your desired packet .
Checking for these frames may not be always helpfull , it can be for coding the identification part of your bot but not for other functionalities like fighting or crafting ...
And as Apokah said again , you gotta take your time and sniff the client's comunications to reverse it on your bot .
 
Inscrit
11 Juillet 2017
Messages
31
Reactions
0
#9
No No Really i can no get this Straight How can i possibly Sniff the packet and figure out what it sending just from the bytes it's confusing
 

zahid98

Membre Actif
Inscrit
13 Decembre 2014
Messages
352
Reactions
2
#10
Basicly , sniffing here means using an MITM bot which shows all the sent/received packet from the client , no to do with bytes . Here is an example to help you understand , so here you want to code the fighting part of your bot and you are looking for which packet you have to send for casting a spell . Looking for the packet name on the sources will be terrible (like listening that god damn song Despacito) since you really don't know where to look and there is many files to check on the sources , besides you can't find it the frames since those treat the received packets not the sent ones , so here , your best option is to sniff , nothing easier than connecting to a random account and cast a spell using your caracter and then checking on the sniffer wich packet has been sent . Here a link for the best known and public sniffer thanks to BlueDream as Apokah already mentioned it before : https://cadernis.fr/index.php?threads/amaknacore-sniffer-dofus-2-42-0.1334/
 
Inscrit
11 Juillet 2017
Messages
31
Reactions
0
#11
Well last night i used WPE Pro managed to get the id of a packet that was being sent but didn't find it in the sources
 

zahid98

Membre Actif
Inscrit
13 Decembre 2014
Messages
352
Reactions
2
#12
why don't you use the sniffer , it's easier than doing the math for each packet .
Edit : are you sure about reading the id correctly ?
 
Inscrit
11 Juillet 2017
Messages
31
Reactions
0
#13
Omg i'm so stupid i was looking for in the MessageReceiver.as I got it now
Anyway can anyone tell me a better swf decompilier currently i'm using Sothink SWF Decompiler which keep crashing when i try to extract the resources
 

zahid98

Membre Actif
Inscrit
13 Decembre 2014
Messages
352
Reactions
2
#14
do not extract all the sources , you will need for now just the com part of the sources .
 
Inscrit
11 Juillet 2017
Messages
31
Reactions
0
#15
it crashes when i try to extract it it, if there's a better tool that would be helpful
 
Inscrit
11 Juillet 2017
Messages
31
Reactions
0
#17
Oh thanks that did work, Now guys i have a weird question is there a way i can block or ignore a certain packets from reaching the client (Dofus Client)
 

zahid98

Membre Actif
Inscrit
13 Decembre 2014
Messages
352
Reactions
2
#18
your question isn't weird at all , most bot that use a MITM attack block some packets , strange thing I couldn't find any recent tutorial for the MITM attack yet there are many open source projects if you're intersted besides add me on discord if you need more help .
 
Inscrit
11 Juillet 2017
Messages
31
Reactions
0
#19
The one that BlueDeam posted Doesn't have the option for that, so if you can give one of those you said that would be helpful thanks :)
 

zahid98

Membre Actif
Inscrit
13 Decembre 2014
Messages
352
Reactions
2
#20
gotta code one dude it's very simple ahahah , the bots I spoke about are outdated projects that still can be updated but it will take you a lot of time since these are complete bots .
 
Haut Bas