• Welcome to Valhalla Legends Archive.
 

Warcraft3 0x50 help

Started by TriCk, September 14, 2004, 10:56 PM

Previous topic - Next topic

TriCk

I need help with this packet, it keeps on disconnecting me and i dont know where ive gone wrong=/

m_Key = cdkey


Case &H50

HashCommand = Mid(Data, 38, Len(Data) - 2)
MPQName = Mid(Data, InStr(1, Data, "IX86ver"), Len(Data))
MPQName = Mid(MPQName, 1, 12)
SERVERS = Val("&h" & StrToHex(StrReverse(Mid(Data, 9, 4))))

Dim vHashes As String
vHashes = App.Path & "\WAR3\"

EXEINFO = Space(256)
Result = Z(vHashes & "War3.exe", vHashes & "Storm.dll", vHashes & "Game.dll", HashCommand, version, CHECKSUM, EXEINFO, MPQName)
If Result = Space(256) Then
   Form1.Label3.Caption = "Hashes missing!"
   Form1.sck1.Close
   Exit Sub
End If
Dim CLIENTKEY As Long
Dim lngProdID3 As Long
Dim lngValue3 As Long
Dim strKeyHash As String
Dim dblKey As Long
EXEINFO = KillNull(EXEINFO)
CLIENTKEY = GetTickCount()
Call DecodeHashCDKey(m_Key, CLIENTKEY, SERVERS, _
lngProdID3, lngValue3, strKeyHash)
 InsertDWORD CLIENTKEY
 InsertDWORD version
 InsertDWORD CHECKSUM
 InsertDWORD &H1
 InsertDWORD &H0
 InsertDWORD Len(m_Key)
 InsertDWORD lngProdID3
 InsertDWORD lngValue3
 InsertDWORD &H0
 InsertNonNTString strKeyHash
 InsertNTString EXEINFO
 InsertNTString "WAR3TEST"
 SendPacket &H51



Thanks,
PS: This is the first time i've written WAR3 hash  :-X

BaDDBLooD

#1
I Suggest that you don't ask for help relating this.

BTW: You should use Copy Memory to remove your "Servers" Variable.

EDIT:

Quote

PS: This is the first time i've written WAR3 hash  


OffTopic: Does that remind anyone else of gosugaming besides me?
There are only two kinds of people who are really fascinating: people who know absolutely everything, and people who know absolutely nothing.

TangoFour

QuoteSendPacket &H51

It would seem you need help with 0x51 rather than 0x50

LordNevar

I think a packet log is in order so you know exactly what to do ;)

A good fortune may forbode a bad luck, which may in turn disguise a good fortune.
The greatest trick the Devil ever pulled, was convincing the world he didn't exsist.

TriCk

#4
mmm so can anyone tell me why im getting ipbanned, rather than burning me and changing the subject..
PS: where do i get a decent packetlogger =/, one i have now is shit...

LordNevar

I didn't burn you, I merely pointed out that packet logging would help you. Try WPEPro, or Ethereal.

A good fortune may forbode a bad luck, which may in turn disguise a good fortune.
The greatest trick the Devil ever pulled, was convincing the world he didn't exsist.

SNiFFeR

Still dont understand why exactly you're sending packet 0x51 when you're creating the packet 0x50.

iago

Can you please show us your "Call DecodeHashCDKey" function that probably took you days of hard work to figure out?  Or are you just using the one that was stolen from the original authors?

Thanks!
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Soul Taker

Quote from: SNiFFeR on September 15, 2004, 07:49 AM
Still dont understand why exactly you're sending packet 0x51 when you're creating the packet 0x50.
0x50 has nothing to do with anything other than the topic having a typo.

LordNevar

Actually it does, he constructed packet 0x50, but he is sending 0x51. Maybe you should actually look over the code, it's not a typo. If you examine the code you will see what were talking about.

A good fortune may forbode a bad luck, which may in turn disguise a good fortune.
The greatest trick the Devil ever pulled, was convincing the world he didn't exsist.

Soul Taker

Quote from: TriCk on September 14, 2004, 10:56 PM

 InsertDWORD CLIENTKEY
 InsertDWORD version
 InsertDWORD CHECKSUM
 InsertDWORD &H1
 InsertDWORD &H0
 InsertDWORD Len(m_Key)
 InsertDWORD lngProdID3
 InsertDWORD lngValue3
 InsertDWORD &H0
 InsertNonNTString strKeyHash
 InsertNTString EXEINFO
 InsertNTString "WAR3TEST"
 SendPacket &H51


SID_AUTH_CHECK (0x51)
---------------------

(DWORD) Client session key.*
(DWORD) Version.**
(DWORD) Checksum.**
(DWORD) Amount of CD-keys. This is typically 2 for Lord of Destruction, 1 otherwise.***
(BOOL) TRUE for spawn (Starcraft, Japan Starcraft and Warcraft 2 only), FALSE for normal.
(9 DWORDs) CD-key data.*
(Optional 9 DWORDs) CD-key data for second CD-key, if using Lord of Destruction.***
(String) Version check stat string.**
(String) CD-key owner name.

I'm sure I have to be missing something here, it looks like 0x51 to me.  Help me out  :-\

Soul Taker

Quote from: LordNevar on September 15, 2004, 02:46 PM
Quote from: TriCk on September 14, 2004, 10:56 PM
I need help with this packet, it keeps on disconnecting me and i dont know where ive gone wrong=/

m_Key = cdkey


Case &H50 <~~~~~~Looks Like 0x50 to me.

HashCommand = Mid(Data, 38, Len(Data) - 2)
MPQName = Mid(Data, InStr(1, Data, "IX86ver"), Len(Data))
MPQName = Mid(MPQName, 1, 12)
SERVERS = Val("&h" & StrToHex(StrReverse(Mid(Data, 9, 4))))

Dim vHashes As String
vHashes = App.Path & "\WAR3\"

EXEINFO = Space(256)
Result = Z(vHashes & "War3.exe", vHashes & "Storm.dll", vHashes & "Game.dll", HashCommand, version, CHECKSUM, EXEINFO, MPQName)
If Result = Space(256) Then
   Form1.Label3.Caption = "Hashes missing!"
   Form1.sck1.Close
   Exit Sub
End If
Dim CLIENTKEY As Long
Dim lngProdID3 As Long
Dim lngValue3 As Long
Dim strKeyHash As String
Dim dblKey As Long
EXEINFO = KillNull(EXEINFO)
CLIENTKEY = GetTickCount()
Call DecodeHashCDKey(m_Key, CLIENTKEY, SERVERS, _
lngProdID3, lngValue3, strKeyHash)
 InsertDWORD CLIENTKEY
 InsertDWORD version
 InsertDWORD CHECKSUM
 InsertDWORD &H1
 InsertDWORD &H0
 InsertDWORD Len(m_Key)
 InsertDWORD lngProdID3
 InsertDWORD lngValue3
 InsertDWORD &H0
 InsertNonNTString strKeyHash
 InsertNTString EXEINFO
 InsertNTString "WAR3TEST"
 SendPacket &H51 <~~~But yet he's sending 0x51



Thanks,
PS: This is the first time i've written WAR3 hash  :-X

I might be wrong but I'm pretty sure I'm right. If your sending 0x51 it's usually the right thing to do to build 0x51 , not build 0x50 and try to send 0x51.
"Case &H50" is most likely checking if a recieved packet is 0x50, in which case you would likely respond with 0x51, no?

LordNevar


Case &H50 <~~~Built as 0x50

HashCommand = Mid(Data, 38, Len(Data) - 2)
MPQName = Mid(Data, InStr(1, Data, "IX86ver"), Len(Data))
MPQName = Mid(MPQName, 1, 12)
SERVERS = Val("&h" & StrToHex(StrReverse(Mid(Data, 9, 4))))

Dim vHashes As String
vHashes = App.Path & "\WAR3\"

EXEINFO = Space(256)
Result = Z(vHashes & "War3.exe", vHashes & "Storm.dll", vHashes & "Game.dll", HashCommand, version, CHECKSUM, EXEINFO, MPQName)
If Result = Space(256) Then
   Form1.Label3.Caption = "Hashes missing!"
   Form1.sck1.Close
   Exit Sub
End If
Dim CLIENTKEY As Long
Dim lngProdID3 As Long
Dim lngValue3 As Long
Dim strKeyHash As String
Dim dblKey As Long
EXEINFO = KillNull(EXEINFO)
CLIENTKEY = GetTickCount()
Call DecodeHashCDKey(m_Key, CLIENTKEY, SERVERS, _
lngProdID3, lngValue3, strKeyHash)
 InsertDWORD CLIENTKEY
 InsertDWORD version
 InsertDWORD CHECKSUM
 InsertDWORD &H1
 InsertDWORD &H0
 InsertDWORD Len(m_Key)
 InsertDWORD lngProdID3
 InsertDWORD lngValue3
 InsertDWORD &H0
 InsertNonNTString strKeyHash
 InsertNTString EXEINFO
 InsertNTString "WAR3TEST"
 SendPacket &H51 <~~~~Sent as 0x51



I'm pretty sure I'm right but if you build 0x50 your suppose to send 0x50, not build 0x50 when that's wrong in the first place, and than send 0x51.

A good fortune may forbode a bad luck, which may in turn disguise a good fortune.
The greatest trick the Devil ever pulled, was convincing the world he didn't exsist.

LordNevar

Stupid comp, screen messed up .

A good fortune may forbode a bad luck, which may in turn disguise a good fortune.
The greatest trick the Devil ever pulled, was convincing the world he didn't exsist.

dxoigmn

That "Case &H50" is probably from his packet handler which looks to handle SID_AUTH_INFO and create SID_AUTH_CHECK (the next part of the authentication sequence).  Probably would be better to create another function to create SID_AUTH_CHECK.  The packet he asked us to help him with is SID_AUTH_CHECK.