• Welcome to Valhalla Legends Archive.
 
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - MindArchon

#1
Battle.net Bot Development / Re: D2GS Packets
October 13, 2005, 08:46 PM
Ugh.

So I assume I send 0x66 right when I connect to the server and it replies with 0xAE? Do you have any idea where I can find the format for 0x66? Nobody seems to know for sure.

Do I have to do anything with 0xAE? (is 0xAF 0xAE compressed or something? Because I still dont have decompression down)
#2
Battle.net Bot Development / Re: D2GS Packets
October 13, 2005, 08:06 PM
I thought it is empty.

0000: 6D 12 E8 E9 2E 00 00 00 00 00 00 00 00           mèé............

6D is the packet ID
12 E8 E9 2E is the long I send (get tick count)
00 00 00 00 00 00 00 00 are the 2 empty dwords
#3
Battle.net Bot Development / Re: D2GS Packets
October 13, 2005, 07:35 PM
Alright, I did a search and I guess I will use D2GS.dll. However, I have no idea how any of the parameters work. I found some stuff on the search, but all of it doesn't seem to work. This code that came with the zip containing D2GS doesn't work, and I cannot figure out how to use it effectively.

On Error Resume Next
Dim offset As Long
Dim Size As Long
Dim a As Integer
Dim H1 As String
Dim H2 As Integer
Dim outdata As String
Dim maxsize As Long
Dim outsize As Long

a = 5 '<-- extra packet space (only tryed it in testing to try fix bad packet returns)

'D2GS_DATA = Data from server >

H1 = GamePacketSize(D2GS_DATA, Size, offset)
outdata = String(Size + (a + 1), vbNullChar)
H2 = GamePacketDecode(Mid(D2GS_DATA, 1 + offset), Size + a, outdata, Size + a, outsize)

'outdata = decompressed data.


Also, Ive sent 0x68, and recieved 0x7A and 0x5C. I then guessed I would send 0x6B, but it says I dropped due to timeout in-game. I have been sending 0x6D every 6-7 seconds. Here is the packet log of my data being sent:

0x68
0000: 68 B9 44 67 38 62 00 01 0B 00 00 00 50 CC 5D ED  h¹Dg8b. ...PÌ]í
0010: B6 19 A5 91 00 46 69 72 65 64 41 78 65 00 81 B3  ¶¥'.FiredAxe.?³
0020: 6F 4B 00 00 00 00                                oK..............


I recieve 0x7A and 0x5C, and send out 0x6B, and I drop due to timeout, and here is 0x6D I am sending every 6 seconds.

0000: 6D 12 E8 E9 2E 00 00 00 00 00 00 00 00           mèé............



#4
Battle.net Bot Development / D2GS Packets
October 12, 2005, 10:35 PM
I am having troubles with D2GS packets. I'd be nice if you guys could help me out here. There are two issues I am having a problem with:

Most importantly, how do you decompress the packets recieved. I've seen some source on how to do it, but I don't understand it. How are the packets compressed? And when you send packets back to the d2gs, do you have to compress them yourself? I have absolutely no idea how to start here.

When I first connect to D2GS, do I send 0x68 immediantly after connecting, or after they send data to me? Do I have to send stuff before or after it to officially get into the game?
#5
Battle.net Bot Development / Re: Realms
October 06, 2005, 11:06 PM
Actually the problem WAS with the CD-key. I changed that and it gave me 0x00

Strangely, that cd-key seemed to be banned across all servers

Thanks guys, I got it working
#6
Battle.net Bot Development / Re: Realms
October 06, 2005, 08:30 PM
I still recieve the error. It does not matter what server I connect to.

Does anyone know what response 7E is?

EDIT:

Strange, upon changing the account I was connecting with, the status changed to 0, meaning it was a success.
#7
Battle.net Bot Development / Re: Realms
October 06, 2005, 07:45 PM
Ok. Here is the code I am sending when the winsock realm connects.

MCPsck.SendData Chr(1)

buffer.Clear
buffer.InsertNonNTString MCP1
buffer.InsertNonNTString MCP2
buffer.InsertNTString BNCSu
buffer.SendPacketRealm &H1


Here is part of the code I use to parse 0x3E

MCP1 = Mid(data, 5, 16)
MCP2 = Mid(data, 29, 48)
BNCSu = KillNull(Mid(data, 77))


And here is the response to 0x3E

0000: FF 3E 58 00 BF E1 D0 78 70 6F 1B B6 D3 E9 00 35  ÿ>X.¿áÐxpo¶Óé.5
0010: 02 25 28 00 D3 E9 30 09 17 E0 00 00 00 00 00 00  %(.Óé0.à......
0020: FE 69 90 06 EB 82 6D A7 50 58 32 44 36 38 58 49  þi?ë,m§PX2D68XI
0030: D3 E9 00 35 00 00 00 00 66 E9 F9 3D D3 2E 7F FF  Óé.5....féù=Ó.ÿ
0040: 03 25 26 AB F3 99 F1 33 F4 79 24 EF 74 65 73 74  %&«ó™ñ3ôy$ïtest
0050: 61 63 63 35 35 00 63 35                          acc55.c5........
#8
Battle.net Bot Development / Re: Realms
October 06, 2005, 05:49 PM
Connection works fine, but im my response to 0x01 I am recieving an unknown result according to bnetdocs

Here I am sending 0x01

0000: 4D 00 01 70 5A 64 78 8D FA 07 DC D3 E9 00 35 3B  M.pZdx?úÜÓé.5;
0010: 1A 28 00 00 00 00 00 FE 69 90 06 EB 82 6D A7 50  (.....þi?ë,m§P
0020: 58 32 44 36 38 58 49 D3 E9 00 35 00 00 00 00 61  X2D68XIÓé.5....a
0030: 03 0A 77 51 30 EB 6E 9E 88 3B C5 AB F3 42 5F F0  .wQ0ënžˆ;Å«óB_ð
0040: 17 EE 48 74 65 73 74 61 63 63 35 35 00           îHtestacc55....


And here is the response.

0000: 07 00 01 7E 00 00 00                             .~............

Sorry guys, its just that I've never even looked at realms before.

I am sending the full 16 dwords of the data returned in 0x3E.
#9
Battle.net Bot Development / Re: Realms
October 06, 2005, 04:54 PM
Thanks Ringo!

Your response helped me to get it to work. Now a few questions.

So do I just do something like

rPort = GetDWORD(Mid(data, 25, 4))

rIP = Asc(Mid(data, 21, 1)) & "." & Asc(Mid(data, 22, 1)) & "." & Asc(Mid(data, 23, 1)) & "." & Asc(Mid(data, 24, 1))

winsock.Connect rIP, rPort


Because its not connecting.
#10
Battle.net Bot Development / Re: Realms
October 06, 2005, 12:02 AM
EDIT: l2k-Shadow - I tried 0x01 as I cookie and I still recieve that error

Nope not working. I have no idea where you want me to post my code from, So I'll guess I'll post it from right after I pass 0x3A.

Select Case Asc(Mid(data, 5, 1))
    Case &H0 '// Login Information Correct

        buffer.InsertNTString GetFromINI("Connection", "Username", "", App.Path & "\config.ini")
        buffer.InsertBYTE &H0
        buffer.SendPacket &HA
...
(code continues on to deal with invalid login information)


That code executes after it recieves 0x3A

.. This code executes when 0x0A is recieved.


UsernameLogged = KillNull(Mid(data, 5))
MainFRM.bnet.SendData Chr(&HFF)
MainFRM.bnet.SendData Chr(&H40)
MainFRM.bnet.SendData MakeWORD(4)
'//Sends packet 0x40, its empty.


And when 0x40 is recieved.


'//RealmToConnect is a private vairable in the module.
If GetDWORD(Mid(data, 9, 4)) = 1 Then
RealmToConnect = KillNull(Mid(data, 17))
Else
RealmToConnect = GetFromIni("Connection", "Realm", "", App.Path & "\config.ini")
End if

OntoRealms = True '//Private module boolean

buffer.Clear
buffer.InsertDWORD Len("password")
buffer.InsertDWORD &H2
buffer.InsertNonNTString "password"
buffer.InsertDWORD GetTickCount
buffer.InsertDWORD sessionkey '//obtained from 0x50
buffer.SendBNLSPacket &HB


And my code for when 0x0B is recieved..


HashedData =  Mid(Data, 4)

If OntoRealms = True Then

      buffer.Clear
      buffer.InsertDWORD sessionkey '//cookie
      buffer.InsertNonNTString HashedData
      buffer.InsertNTString RealmToConnect
      buffer.SendPacket &H3E

Else
...


0x3E returns with realm logon failed.
#11
Battle.net Bot Development / Re: Realms
October 05, 2005, 11:23 PM
I tried, it still gives me failed realm login.

Wouldn't BNET disconnect me if I submitted the wrong hash data? Am I doing something else wrong?
#12
Battle.net Bot Development / Re: Realms
October 05, 2005, 10:59 PM
I am now sending 0x0A before I send 0x40.

I was sending Server Key correctly, but I changed Client key to GetTickCount, and I am still getting realm logon failed.
#13
Battle.net Bot Development / Realms
October 05, 2005, 08:44 PM
I am having trouble adding realm support to my bot.

From looking at http://forum.valhallalegends.com/phpbbs/index.php?topic=11383.0 I assume I start by sending 0x40 after logging in with 0x3A.

I have no idea what the difference between 0x40 and 0x34 are because they seem to do almost the same thing, but I used 0x40 because it was used in that sequence information. I recieved the realm name to send in 0x3E (Europe).

Because I am using BNLS, I hash "password" by sending 0x0B, I didn't know what to put as the client and server key. Leaving them blank disconnects me from BNLS, so I just put the information I put for hashing the login password. Here is the packet I am sending to BNLS.

0000: 1B 00 0B 08 00 00 00 02 00 00 00 70 61 73 73 77  . ......passw
0010: 6F 72 64 4E E8 CB 73 E7 D2 5C 3C                 ordNèËsçÒ\<.....


After that I recieve the response and stick it into packet 0x3E to get the server to connect to. Here is the packet I am sending.

0000: FF 3E 23 00 00 00 00 00 C9 2C 83 9D 1B E2 E8 36  ÿ>#.....É,ƒ?âè6
0010: 66 87 76 5D 14 6D 98 C5 AC 24 6D 96 45 75 72 6F  f‡v]m˜Å¬$m–Euro
0020: 70 65 00                                         pe..............


I get a response but I recieve the status is 0x80000002 (Realm logon failed). I think its an error in hashing "password" but I don't know what I'm doing wrong.

Also, I noticed that the ip address returns in a dword. Isnt an ip address xx.xx.xxx, how do I connect to that ip address?
#14
Quote from: Blaze on March 19, 2005, 10:08 PM
You need to put your username after the hash in 0x53.

Thanks a lot Blaze! I got it working.
#15
OK So I sent 0x0D right after the 0x51 response, and I get this response

0000: 07 00 0D 01 00 00 00                             ..............

Then I sent 0x02 and all the other packets and I still recieve Incorrect Password