• Welcome to Valhalla Legends Archive.
 

Diablo II Bot Dev

Started by Spilled, April 27, 2005, 12:54 PM

Previous topic - Next topic

iago

If you can find a way to insert inline assembly language into a VB program, and to define functions in such a way that they don't have any hidden lead-in/lead-out code, then you can do it in VB.  That's not impossible, I know somebody who's done something like that, but you wouldn't get very far.

Of course, you CAN use a .dll to do it, assuming the .dll is written in C; although VB still isn't doing it, C is :P
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Yegg

Of course that's too much work, but my point was just that it is possible. Maybe not the best way to go though.

iago

I don't know of any way of doing it without hacking VB, though.  So if you call that possible, then I guess...
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


LivedKrad

I tried in the pass to do my own implementation of the Huffman algorithm, so why can't one just "craft" packets in a third party program and send them? Is this because the D2 client creates a special version of the algorithm thus it must be sent within the actual client?

MyndFyre

Quote from: LivedKrad on April 27, 2005, 09:58 PM
I tried in the pass to do my own implementation of the Huffman algorithm, so why can't one just "craft" packets in a third party program and send them? Is this because the D2 client creates a special version of the algorithm thus it must be sent within the actual client?

If you did an accurate reversal and implementation of the Huffman algo found in D2, you'd be allright to send packets from a third party client.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Spilled

Hrmm.. i c so basically vb would not be the language to do a project like this in. Thanks for all your help everyone much appreciated.

OnlyMeat

#21
Quote from: iago on April 27, 2005, 09:37 PM
I don't know of any way of doing it without hacking VB, though.  So if you call that possible, then I guess...

You could use RealBasic. That supports threads, inline asm etc.

It's possible to write completely automated  bots without using the diablo client, i created such a program which does pindle and travincal boss runs (well the scripts do the runs and the program provides the object model).

Of course injecting code into the real client is much easier as d2 then does all the work for you. It's simply a matter of calling functions and reading the relevant memory locations.

Yegg

I wouldn't suggest RealBasic, I would suggest a scripting language. Like Python, Pascal, Perl, etc. The three P's.

MyndFyre

Quote from: Yegg on April 28, 2005, 04:01 PM
I wouldn't suggest RealBasic, I would suggest a scripting language. Like Python, Pascal, Perl, etc. The three P's.

In that same vein, I understand Python makes injection quite easy.  It might be a good route to look into.  $t0rm (Banana fanna fo fanna) would be a good resource in that realm.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

OnlyMeat

Quote from: Yegg on April 28, 2005, 04:01 PM
I wouldn't suggest RealBasic, I would suggest a scripting language. Like Python, Pascal, Perl, etc. The three P's.

Using a scripting language for injecting code into another process is just horrible. Especially when you have the option of using a natively compiled language with inline asm, threading, synchronization objects etc.

LivedKrad

OnlyMeat: Do you mind if I could have a "stripped down version" of this "clientless D2 bot" source? I've always suspected you could craft the correct packets to do what you wanted, (seeing as how that's how everything is done in game right down to clicking on an item), however I want to go more in-depth into how it's done. From iago's and MyndFyre's posts it would seem that the algorithm used deviates from its original form, thus making the Blizzard made client having to be used.

Anything you could provide me would be helpful, especially in VB6. (Other sources are welcome though).

OnlyMeat

Quote from: LivedKrad on April 30, 2005, 10:14 AM
OnlyMeat: Do you mind if I could have a "stripped down version" of this "clientless D2 bot" source? I've always suspected you could craft the correct packets to do what you wanted, (seeing as how that's how everything is done in game right down to clicking on an item), however I want to go more in-depth into how it's done. From iago's and MyndFyre's posts it would seem that the algorithm used deviates from its original form, thus making the Blizzard made client having to be used.

Anything you could provide me would be helpful, especially in VB6. (Other sources are welcome though).

First question: No, creating a fully functional clientless bot is no trivial task, it takes time to locate and reverse the core routines and implement all the event handling correctly from scratch, so im not simply going to give the code away.

However i would say, constructing outgoing packets is actually quite simple. For example sending a chat message in game:-


void CD2GameBot::ChatMessage(LPCSTR lpMessage)
{
CD2GSPacket Packet;

Packet  << (USHORT)0x00 // NULL
<< lpMessage // Msg
<< (BYTE)0x00 // Terminator
<< (USHORT)0x00; // NULL

m_xD2GameServer.SendPacket(Packet,PKT_D2GS_OUT_CHATMESSAGE);
}


So by that token, creating a bot that creates/joins a game and sends some simple messages is trivial (like the spam bots you see). Automating game play is much more complex.