Valhalla Legends Forums Archive | Battle.net Bot Development | How to connect bot to bnet.

AuthorMessageTime
shout
I have started to teach myself how to program, and I would like to create a bnet client, but truth is, im a programming noob. Could someone tell me how to connect?
June 20, 2004, 4:11 AM
dodge
depends on how much VB you know, if not a lot then go here http://www.valhallalegends.com/cuphead/ocx_me.txt theres a tutorial

but, one thing has changed, the accept is: 579728

you'll know what i mean when you read more into the tutorial.
June 20, 2004, 4:13 AM
shout
Im not using vb, Im using C#.Net, and Ive tried using VB and the OCX to make a bot but found it far too EZ. I kind of want a challenge.
June 20, 2004, 4:16 AM
dodge
alright then i cant help you. or if you want a challenge use VB and use winsocks to connect. then teach me! lol
June 20, 2004, 4:20 AM
KkBlazekK
You can get a cleanslatebot to connect to botnet?
June 20, 2004, 7:18 PM
UserLoser.
[quote author=Kk)Blaze(kK link=board=17;threadid=7347;start=0#msg66342 date=1087759110]
You can get a cleanslatebot to connect to botnet?
[/quote]

Nobody mentioned BotNet...
June 20, 2004, 7:56 PM
shout
I got a bot to connect to battle.net with the OCX, and I had it in the channel, but it took me like 10 minutes to make and that is kind of the noobs way out...

Here is what I know: When I connect, I have to send something like "Chr(1)", but I have no idea what that is. Then I send 0x50, and battle.net send 0x50 and 0x25 back. (I think).

Please help a failing noob!
June 20, 2004, 8:36 PM
CrAz3D
I remember seeing that Myndfyre has posted quite a bit abuot C# Battle.Net prograqmming. It has been rather recently also, try just scanning the topic names in this forum for aobut 4-5 pages.
June 20, 2004, 8:44 PM
Eli_1
[quote author=shout link=board=17;threadid=7347;start=0#msg66358 date=1087763789]
I got a bot to connect to battle.net with the OCX, and I had it in the channel, but it took me like 10 minutes to make and that is kind of the noobs way out...
[/quote]

If you want to make it a little more challenging, try doing it using the API calls instead of the OCX (there's a post about this in the Visual Basic forum, only 4-5 topics down).

[quote]
Here is what I know: When I connect, I have to send something like "Chr(1)", but I have no idea what that is.
[/quote]

Chr(1) is the "character" equivalent of 1. Exactly the same as the character equivalent of 61 is "a" ( Chr(61) ).

[quote]
Then I send 0x50, and battle.net send 0x50 and 0x25 back. (I think).
[/quote]

Yes, I think that's right too. But note, you don't literally send "0x50." 0x50 is an identifier of a packet. To figure out what that packet (0x50) contains, you could packet log a client sending it, and figure it out from there, or go on [url=bnetdocs.valhallalegends.com]bnetdocs and look it up there.
June 21, 2004, 12:39 AM
StepAside
Packet log.
June 21, 2004, 1:38 AM
shout
Now how would I packet log, assuming that packet log is a verb phrase.
June 21, 2004, 2:19 AM
GoSuGaMING
[quote author=shout link=board=17;threadid=7347;start=0#msg66434 date=1087784395]
Now how would I packet log, assuming that packet log is a verb phrase.
[/quote]

download WPE Pro?

1 Hide Hide 67 Send
0000 01 FF 50 3A 00 00 00 00 00 36 38 58 49 50 58 45 ..P:.....68XIPXE
0010 53 C9 00 00 00 00 00 00 00 00 00 00 00 00 00 00 S...............
0020 00 00 00 00 00 00 00 00 00 55 53 41 00 55 6E 69 .........USA.Uni
0030 74 65 64 20 53 74 61 74 65 73 00 FF 25 08 00 00 ted States..%...
0040 00 00 00 ...

there is 0x50 which is the first packet you send to battle.net
June 21, 2004, 2:21 AM
shout
Can I get link?
June 21, 2004, 2:24 AM
GoSuGaMING
[quote author=shout link=board=17;threadid=7347;start=0#msg66436 date=1087784683]
Can I get link?
[/quote]

www.gosugaming.net/WPEPro.zip
June 21, 2004, 2:29 AM
shadypalm88
Well, if you don't want to packetlog, there's always BnetDocs. It contains much information on the messages sent back and forth between you and Battle.Net, how they're formatted, and the correct orders to do so. If you understand network programming, or can teach yourself, you'll want to check this out.
June 21, 2004, 4:27 AM
GoSuGaMING
[quote author=shadypalm88 link=board=17;threadid=7347;start=0#msg66459 date=1087792066]
Well, if you don't want to packetlog, there's always BnetDocs. It contains much information on the messages sent back and forth between you and Battle.Net, how they're formatted, and the correct orders to do so. If you understand network programming, or can teach yourself, you'll want to check this out.
[/quote]

BnetDocs doenst give you the code... you would have to packetlog ... all it does is give u the structor of the packet
June 21, 2004, 4:44 AM
Spht
[quote author=GoSuGaMING link=board=17;threadid=7347;start=15#msg66463 date=1087793043]
[quote author=shadypalm88 link=board=17;threadid=7347;start=0#msg66459 date=1087792066]
Well, if you don't want to packetlog, there's always BnetDocs. It contains much information on the messages sent back and forth between you and Battle.Net, how they're formatted, and the correct orders to do so. If you understand network programming, or can teach yourself, you'll want to check this out.
[/quote]

BnetDocs doenst give you the code... you would have to packetlog ... all it does is give u the structor of the packet
[/quote]

BnetDocs is so you DON'T have to packet log / disassemble to figure out the structure of messages. It'd be a pain to provide generalized code for every language on how to deal with them.
June 21, 2004, 4:49 AM
shout
I understand the packet stuff...

I would kind of like to know how I would decode the CD-Key and use local hashes.

I realize that BNLS is a service that I can use, but I would rather learn how to hash locally.
June 21, 2004, 4:04 PM
shadypalm88
[quote author=shout link=board=17;threadid=7347;start=15#msg66503 date=1087833873]
I understand the packet stuff...

I would kind of like to know how I would decode the CD-Key and use local hashes.

I realize that BNLS is a service that I can use, but I would rather learn how to hash locally.
[/quote]If you want to just use hashing locally, you could just pick up a copy of BnetAuth.dll (available here) and link against that, or if you want to learn how, the C++ source for that is available online (one place being here). Both links go to my site.

Optionally, maybe you could find the source to a bot that does it. If you're looking for C-like code, maybe try zDS (one source here, also if you can use CVS there's information on the home page).

(If you know VB, there's definitely no shortage of VB bots floating around...)
June 21, 2004, 4:44 PM
shout
How would I link BnetAuth.dll to a project in C#.net?
June 21, 2004, 6:30 PM
Myndfyr
You have to use P/Invoke calls. Example:

One of the calls in BnetAuth.h is:

[code]
__declspec(dllexport)
BOOL _stdcall CheckVersion(LPCTSTR lpszFileName1, LPCTSTR lpszFileName2,
LPCTSTR lpszFileName3, LPCTSTR lpszValueString,
DWORD * lpdwVersion, DWORD * lpdwChecksum,
LPSTR lpExeInfoString, LPCTSTR lpszMpqFileName);
[/code]

Within a class, you specify:

[code]
[DllImport("BnetAuth.dll")]
public static extern bool CheckVersion(
[MarshalAs(UnmanagedType.LPTStr)] string lpszFileName1,
[MarshalAs(UnmanagedType.LPTStr)] string lpszFileName2,
[MarshalAs(UnmanagedType.LPTStr)] string lpszFileName3,
[MarshalAs(UnmanagedType.LPTStr)] string lpszValueString,
out uint lpdwVersion, out uint lpdwChecksum,
[MarshalAs(UnmanagedType.LPStr)] string lpExeInfoString,
[MarshalAs(UnmanagedType.LPTStr)] string lpszMpqFileName);
[/code]

All of the MarshalAs attribute declarations are not NECESSARY, but they are good in ensuring that code works across platforms.

Note that this only works for functions marked in the header as either "__declspec(dllexport)" or 'extern "C"'.
June 21, 2004, 6:44 PM
shout
I feel like the stupidist person in the world... but...

How exactly to I use DllImport? When I do it get a 'type or namespace not found' compiler error...
June 21, 2004, 7:53 PM
Sorc_Polgara
Where can I get this BnetAuth.dll?
June 21, 2004, 8:02 PM
Eli_1
[quote author=Sorc_Polgara link=board=17;threadid=7347;start=15#msg66547 date=1087848160]
Where can I get this BnetAuth.dll?
[/quote]

Do you ever even read people's posts? Someone already posted a link to it.
June 21, 2004, 8:04 PM
Myndfyr
[quote author=shout link=board=17;threadid=7347;start=15#msg66546 date=1087847592]
I feel like the stupidist person in the world... but...

How exactly to I use DllImport? When I do it get a 'type or namespace not found' compiler error...
[/quote]

OK, part of the requirements of getting help (at least for me) is that you also have to be able to help yourself. Look up the class DllImportAttribute in the .NET Framework SDK help documentation included with Visual Studio .NET or the .NET Platform SDK.

As it is, I believe it's in the System.Runtime.InteropServices namespace. It should be included implicitly in any project referencing mscorlib.dll (implicitly included unless you explicitly deactivated it through project settings).
June 21, 2004, 8:21 PM
shout
Ah... The index had it under System.InteropServices... without runtime...

I get no errors now.
June 21, 2004, 8:38 PM

Search