LoL, I figured out that the code posted wasn't the problem -- my code was
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 MenuQuote from: Ringo on March 31, 2008, 08:01 AM
If I didnt know better, I would say replaced is aka NeSucks trying to get his load/flood bot working again
lol
I can think of better ways of fixing a loop that never exits
replaced: As said above, try reading the documentation iago posted, to gain a better understanding of the process rather than just copying the code andy posted.
Quote from: Hdx on March 30, 2008, 11:02 PM
What happens when you get to the 2nd opcode? Are you decoding it correctly?
Are you sure that your crypto states are being saved over multiple packets?
Quote from: Andy on March 30, 2008, 05:42 PM
GetNull gets all the data from the current read position on. In your example it would be the second one, without the 4 byte header. You should at least read the documentation iago posted before trying to adapt my code.
Public Function Send0x51(datA As String)
AccountHash = String(20, vbNullChar)
cWarden.Initialize Left$(AccountHash, 4)
cWarden.StrToByteArray cWarden.GetBytes(&HF), bRet()
cWarden.SimpleCrypt bRet(), wKeyOut()
cWarden.StrToByteArray cWarden.GetBytes(&HF), bRet()
cWarden.SimpleCrypt bRet(), wKeyIn()
In making the packet...
.InsertDWORD &H0
.InsertDWORD Len(CDKey)
.InsertDWORD lngProdID
.InsertDWORD lngValue1
.InsertDWORD &H0
.InsertNonNTString AccountHash
sData = Mid$(datA, 5)
cWarden.StrToByteArray sData, bData()
'problem below
cWarden.DoCrypt bData(), wKeyIn(), bRet()
MsgBox ("HI3")
Public Sub DoCrypt(ByRef bData() As Byte, ByRef bKey() As Byte, ByRef bRet() As Byte)
Dim i As Long
Dim temp As Byte
Dim Y As Long
Dim Z As Long
ReDim bRet(UBound(bData))
RtlMoveMemory bRet(0), bData(0), UBound(bData) + 1
MsgBox ("yes0")
'msg box DOES COME UP
Y = bKey(&H100)
MsgBox ("yes1")
'msg box does NOT COME UP
Z = bKey(&H101)
For i = 0 To UBound(bData)
Y = (Y + 1) And &HFF
Z = (Z + bKey(Y)) And &HFF
temp = bKey(Y)
bKey(Y) = bKey(Z)
bKey(Z) = temp
bRet(i) = bRet(i) Xor bKey((CInt(bKey(Y)) + CInt(bKey(Z))) And &HFF)
Next i
'bad
bKey(&H100) = Y
bKey(&H101) = Z
End Sub
Public Sub DoCrypt(ByRef bData() As Byte, ByRef bKey() As Byte, ByRef bRet() As Byte)
Dim Y As Long
Y = bKey(&H100)
Quote from: Andy on March 30, 2008, 04:07 PM
Use the code exactly as I gave it.
Public Function ParsePacket(ByVal datA As String)
If Len(datA) = 0 Or Asc(Left(datA, 1)) <> 255 Then Exit Function
data2 = datA
With clsI
.SetBuffer datA
.Skip 1
PacketId = .GetByte
.Skip 2
End With
Select Case PacketId
Case &H5E
SID_Recv_Warden datA
...
end function
Public Sub SID_Recv_Warden(datA As String)
Dim clsP As New clsPacket
sData = datA
cWarden.StrToByteArray sData, bData()
cWarden.DoCrypt bData(), wKeyIn(), bRet()
Select Case bRet(0)
Case &H0
clsP.Clear
ReDim bData(0)
bData(0) = &H1
cWarden.DoCrypt bData(), wKeyOut(), bRet()
With clsP
.InsertString cWarden.ByteArrayToStr(bRet())
.sendPacket frmMain.sckBot, &HE
End With
Case Else
AddChat vbRed, "Unknown Warden Packet: " & StrToHex(datA)
AddChat vbRed, "bRet(0):" & bRet(0)
End Select
Dim clsP As New clsPacket
With clsP
.SetBuffer datA
.Skip 1
.Skip 2
PackID = .GetByte
End With
bRet(0) = PackID
datA = clsP.GetNTString
msgbox("hello")
cWarden.StrToByteArray datA, bData()
MsgBox ("hi1")
cWarden.DoCrypt bData(), wKeyIn(), bRet()
MsgBox ("hi2")
Dim stringx As String
stringx = StrToHex(bData())
Open App.Path & "/debug.txt" For Append As #1
Print #1, stringx
stringx = StrToHex(wKeyIn())
Print #1, stringx
stringx = StrToHex(bRet())
Print #1, stringx
Close #1
3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 4D 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 52 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 00
FF 5E 29 00 06 FA C1 FC FB 0A DA 38 8A 2C A1 47 83 C3 31 11 E7 35 11 18 CF A8 9A 77 CD 38 42 98 34 C1 F4 DF 41 18 32 F3 B0
3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 4D 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 52 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 00
With clsP
.InsertBYTE &H1
ToSend = DoCryptWarden(Data, wKeyOut)
.InsertString ToSend
.sendPacket frmMain.sckBot, &H5E
End With
1 192.168.0.100:3539 63.240.202.126:6112 59 Send
0000 01 FF 50 3A 00 00 00 00 00 36 38 58 49 50 58 45 ..P:.....68XIPXE
0010 53 D1 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 ted States.
2 63.240.202.126:6112 192.168.0.100:3539 70 Recv
0000 FF 25 08 00 4A 61 A4 EE FF 50 3E 00 00 00 00 00 .%..Ja...P>.....
0010 6D 2F AE 03 E0 4C 13 00 00 BA F7 D9 72 FC C6 01 m/...L......r...
0020 6C 6F 63 6B 64 6F 77 6E 2D 49 58 38 36 2D 31 33 lockdown-IX86-13
0030 2E 6D 70 71 00 B5 EE 5D A9 2A E6 33 2A C4 77 3B .mpq...].*.3*.w;
0040 4C DA 53 76 F6 00 L.Sv..
3 192.168.0.100:3539 63.240.202.126:6112 8 Send
0000 FF 25 08 00 00 00 00 00 .%......
4 192.168.0.100:3539 63.240.202.126:6112 86 Send
0000 FF 51 56 00 D2 02 96 49 01 02 0F 01 D6 1E B2 89 .QV....I........
0010 01 00 00 00 00 00 00 00 0D 00 00 00 02 00 00 00 ................
0020 E1 30 1F 00 00 00 00 00 43 8F D7 37 D8 B0 80 23 .0......C..7...#
0030 95 AF D8 17 7A 79 11 17 72 D9 1D F0 E5 3B 9A FB ....zy..r....;..
0040 6E 70 92 12 96 32 95 F0 21 28 B8 92 00 4B 7A 55 np...2..!(...KzU
0050 4C 5A 70 49 56 00 LZpIV.
5 63.240.202.126:6112 192.168.0.100:3539 9 Recv
0000 FF 51 09 00 00 00 00 00 00 .Q.......
6 192.168.0.100:3539 63.240.202.126:6112 53 Send
0000 FF 14 08 00 74 65 6E 62 FF 3A 2D 00 59 49 6E 01 ....tenb.:-.YIn.
0010 6D 2F AE 03 A8 61 3A BE 7D 75 AD E8 DA 2D BA A9 m/...a:.}u...-..
0020 F4 28 4C 26 CC 9F 64 28 69 68 61 74 65 77 61 72 .(L&..d(ihatewar
0030 64 65 6E 33 00 den3.
7 63.240.202.126:6112 192.168.0.100:3539 12 Recv
0000 FF 59 04 00 FF 3A 08 00 00 00 00 00 .Y...:......
8 192.168.0.100:3539 63.240.202.126:6112 6 Send
0000 FF 0A 06 00 00 00 ......
9 63.240.202.126:6112 192.168.0.100:3539 41 Recv
0000 FF 5E 29 00 44 0D 06 0F 85 C0 E4 F3 D6 14 C1 EB .^).D...........
0010 B7 F9 82 25 74 D8 7A 2F 07 25 4A 21 4B 65 02 07 ...%t.z/.%J!Ke..
0020 EC B6 52 D0 8C CE 27 02 57 ..R...'.W
10 192.168.0.100:3539 63.240.202.126:6112 47 Send
0000 FF 5E 2F 00 01 CF 7C 29 30 78 F4 12 97 54 F5 A4 .^/...|)0x...T..
0010 36 4B 3D 39 47 EA 4E 6C DE 0D 3B 8C 0B F1 0F B1 6K=9G.Nl..;.....
0020 49 09 74 6D 88 48 CA C7 33 CB 7F B9 22 0F 00 I.tm.H..3..."..
BOOM DISCONNECT
With clsP
.SetBuffer dAta
.Skip 1
.Skip 2
PackID = .GetByte
End With
Select Case PackID
Case &H0
pMD5 = clsP.GetString '(16)
pKey = clsP.GetString '(16)
pLen = clsP.GetDWORD
with clsp
.InsertBYTE &H1
ToSend = DoCryptWarden(dAta, wKeyOut)
.InsertString ToSend
.sendPacket frmMain.sckBot, &H5E, iNdex
end with
Public Function DoCryptWarden(ByVal sData As String, ByRef sKey As String) As String
Dim bKey() As Byte
Dim dAta() As Byte
Dim i As Long
Dim temp As Byte
Dim Y As Long
Dim Z As Long
StrToByteArrayWarden sKey, bKey
Y = bKey(&H100)
Z = bKey(&H101)
StrToByteArrayWarden sData, dAta
For i = 0 To UBound(dAta)
Y = (Y + 1) And &HFF
Z = (Z + bKey(Y)) And &HFF
temp = bKey(Y)
bKey(Y) = bKey(Z)
bKey(Z) = temp
dAta(i) = dAta(i) Xor bKey((CInt(bKey(Y)) + CInt(bKey(Z))) And &HFF)
Next i
bKey(&H100) = Y
bKey(&H101) = Z
sKey = ByteArrayToStrWarden(bKey)
DoCryptWarden = ByteArrayToStrWarden(dAta)
End Function
Option Explicit
Private Declare Function StandardSHA Lib "RSHA.dll" (sVal As String) As String
Private Position As Long
Private RandomData() As Byte
Private RandomSource1() As Byte
Private RandomSource2() As Byte
dim stringforwarden as string * 20
InitializeWarden Left$(stringforwarden , 4)
wKeyOut = SimpleCryptWarden(GetBytesWarden(&HF))
wKeyIn = SimpleCryptWarden(GetBytesWarden(&HF))
Public Function GetBytesWarden(ByVal Bytes As Long) As String
Dim i As Integer
Dim Buffer() As Byte
ReDim Buffer(Bytes) As Byte
For i = 0 To Bytes
Buffer(i) = GetByteWarden
Next i
GetBytesWarden = ByteArrayToStrWarden(Buffer)
End Function
Public Function ByteArrayToStrWarden(ByRef bByt() As Byte) As String
Dim sStr As String
Dim i As Integer
For i = 1 To UBound(bByt) + 1
sStr = sStr & Chr$(bByt(i - 1))
Next i
ByteArrayToStrWarden = sStr
End Function
Quote from: Ersan on February 20, 2007, 06:40 AM
Using pure visual basic for all the algorithms used during logon is horribly inefficient, I would much prefer someone use a C++ library like bncsutil.
I'm sure there's some way to include the DLL inside your program binary and extract it to a temporary folder for usage, the license bncsutil uses permits this (LGPL).
Page created in 0.214 seconds with 16 queries.