[AutoIT] Sending Packets Help

08/04/2011 15:52 DeXeee#1
With edxloader i got this :

(Sit - Stand recorded)

Code:
[C -> S][704F]
04
Now, in AutoIt, i think that it need to look like this, but i dont know what to
write in "?????" to send packet for sit - stand command .

Code:
$Data = ??????
$IP = "127.0.0.1"
TCPStartUp()
$socket = TCPConnect( $IP, 16000)
If $socket = -1 Then MsgBox (0,"TCP","Can't make a connection")
TCPSend($socket,$Data)

Thanks in advance :)
08/04/2011 16:21 Kape7#2
Quote:
Originally Posted by DeXeee View Post
With edxloader i got this :

(Sit - Stand recorded)

Code:
[C -> S][704F]
04
Now, in AutoIt, i think that it need to look like this, but i dont know what to
write in "?????" to send packet for sit - stand command .

Code:
$Data = ??????
$IP = "127.0.0.1"
TCPStartUp()
$socket = TCPConnect( $IP, 16000)
If $socket = -1 Then MsgBox (0,"TCP","Can't make a connection")
TCPSend($socket,$Data)

Thanks in advance :)
Code:
	Local $sPacket
	AppendOpCode(0x704F)
	AppendSecurity(2)
	AppendByte(4)
	$sPacket = GetPacketInjector($sBuffer)
	TCPSend($Socket, $sPacket)
Use the injection functions from pushedx's autoit clientless.
08/04/2011 16:37 DeXeee#3
ZeraPain gave me this :

Code:
#include <string.au3>
Global $sBuffer, $rBuffer
Global $iSize, $iIndex

NewPacket(0x7074, 2)
AppendByte(1)
AppendByte(4)
AppendDWord(1300)
AppendByte(0)
MsgBox(0,0,GetPacket())

#region PacketWriter
Func NewPacket($sValue, $iValue)
	Local $sTemp = Hex($sValue)
	$sBuffer = ""
	$iSize = 0
	$sBuffer &= StringLeft(ReverseHex(Hex($sValue)), 4)
	$sBuffer &= StringLeft(ReverseHex(Hex($iValue)), 4)
EndFunc   ;==>NewPacket

Func AppendByte($sValue)
	$sBuffer &= StringRight(Hex($sValue), 2)
	$iSize += 1
EndFunc   ;==>AppendByte

Func AppendWord($sValue)
	$sBuffer &= StringLeft(ReverseHex(Hex($sValue)), 4)
	$iSize += 2
EndFunc   ;==>AppendWord

Func AppendDWord($sValue)
	$sBuffer &= StringLeft(ReverseHex(Hex($sValue)), 8)
	$iSize += 4
EndFunc   ;==>AppendDWord

Func AppendString($sString, $Unicode = false)
	Local $iLength = StringLen($sString)
	If $Unicode Then
		$sBuffer &= _StringToHexExt($sString, True)
		$iSize += $iLength * 4
	Else
		$sBuffer &= _StringToHexExt($sString)
		$iSize += $iLength * 2
	EndIf
EndFunc   ;==>AppendString

Func GetPacket()
	Local $sTemp = "0x"
	$sTemp &= StringLeft(ReverseHex(Hex($iSize)), 4)
	$sTemp &= $sBuffer
	Return $sTemp
EndFunc   ;==>GetPacket
#endregion

#region PacketReader
Func BeginParse($sString)
	$iIndex = 1
	$rBuffer = StringMid($sString, 13)
	Return Dec(StringMid($sString, 3, 2) & StringMid($sString, 1, 2))
EndFunc   ;==>BeginParse

Func ReadByte()
	Local $result = Dec(StringMid($rBuffer, $iIndex, 2))
	$iIndex += 2
	Return $result
EndFunc   ;==>ReadByte

Func ReadWord()
	Local $result = Dec(ReverseHex(StringMid($rBuffer, $iIndex, 4)))
	$iIndex += 4
	Return $result
EndFunc   ;==>ReadWord

Func ReadDWord()
	Local $result = Dec(ReverseHex(StringMid($rBuffer, $iIndex, 8)))
	$iIndex += 8
	Return $result
EndFunc   ;==>ReadDWord

Func ReadString($iLength, $Unicode = False)
	Local $result, $string = ""
	If $Unicode Then
		For $i = 0 To $iLength - 1
			$string &= StringMid($rBuffer, $iIndex + $i * 4, 2)
		Next
		$iIndex += $iLength * 4
	Else
		$string = StringMid($rBuffer, $iIndex, $iLength * 2)
		$iIndex += $iLength * 2
	EndIf
	$result = _HexToString($string)
	Return $result
EndFunc   ;==>ReadString
#endregion

Func ReverseHex($sString)
	Local $sTemp, $len
	For $i = StringLen($sString) + 1 To 1 Step -2
		$sTemp &= StringMid($sString, $i, 2)
	Next
	Return $sTemp
EndFunc   ;==>ReverseHex

Func _StringToHexExt($sString, $Unicode = False)
	Local $string
	If $Unicode Then
		For $i = 1 To StringLen($sString)
			$string &= _StringToHex(StringMid($sString, $i, 1)) & "00"
		Next
	Else
		For $i = 1 To StringLen($sString)
			$string &= _StringToHex(StringMid($sString, $i, 1))
		Next
	EndIf

	Return $string
EndFunc   ;==>_StringToHexExt
But i dont know what to input at :

Code:
NewPacket( ??? , 2)
AppendByte(?)
AppendByte(?)
AppendDWord( ???)
AppendByte(?)
MsgBox(0,0,GetPacket())
08/04/2011 16:52 ÑõÑ_Ŝŧóp#4
Quote:
Originally Posted by DeXeee View Post
ZeraPain gave me this :

Code:
#include <string.au3>
Global $sBuffer, $rBuffer
Global $iSize, $iIndex

NewPacket(0x7074, 2)
AppendByte(1)
AppendByte(4)
AppendDWord(1300)
AppendByte(0)
MsgBox(0,0,GetPacket())

#region PacketWriter
Func NewPacket($sValue, $iValue)
	Local $sTemp = Hex($sValue)
	$sBuffer = ""
	$iSize = 0
	$sBuffer &= StringLeft(ReverseHex(Hex($sValue)), 4)
	$sBuffer &= StringLeft(ReverseHex(Hex($iValue)), 4)
EndFunc   ;==>NewPacket

Func AppendByte($sValue)
	$sBuffer &= StringRight(Hex($sValue), 2)
	$iSize += 1
EndFunc   ;==>AppendByte

Func AppendWord($sValue)
	$sBuffer &= StringLeft(ReverseHex(Hex($sValue)), 4)
	$iSize += 2
EndFunc   ;==>AppendWord

Func AppendDWord($sValue)
	$sBuffer &= StringLeft(ReverseHex(Hex($sValue)), 8)
	$iSize += 4
EndFunc   ;==>AppendDWord

Func AppendString($sString, $Unicode = false)
	Local $iLength = StringLen($sString)
	If $Unicode Then
		$sBuffer &= _StringToHexExt($sString, True)
		$iSize += $iLength * 4
	Else
		$sBuffer &= _StringToHexExt($sString)
		$iSize += $iLength * 2
	EndIf
EndFunc   ;==>AppendString

Func GetPacket()
	Local $sTemp = "0x"
	$sTemp &= StringLeft(ReverseHex(Hex($iSize)), 4)
	$sTemp &= $sBuffer
	Return $sTemp
EndFunc   ;==>GetPacket
#endregion

#region PacketReader
Func BeginParse($sString)
	$iIndex = 1
	$rBuffer = StringMid($sString, 13)
	Return Dec(StringMid($sString, 3, 2) & StringMid($sString, 1, 2))
EndFunc   ;==>BeginParse

Func ReadByte()
	Local $result = Dec(StringMid($rBuffer, $iIndex, 2))
	$iIndex += 2
	Return $result
EndFunc   ;==>ReadByte

Func ReadWord()
	Local $result = Dec(ReverseHex(StringMid($rBuffer, $iIndex, 4)))
	$iIndex += 4
	Return $result
EndFunc   ;==>ReadWord

Func ReadDWord()
	Local $result = Dec(ReverseHex(StringMid($rBuffer, $iIndex, 8)))
	$iIndex += 8
	Return $result
EndFunc   ;==>ReadDWord

Func ReadString($iLength, $Unicode = False)
	Local $result, $string = ""
	If $Unicode Then
		For $i = 0 To $iLength - 1
			$string &= StringMid($rBuffer, $iIndex + $i * 4, 2)
		Next
		$iIndex += $iLength * 4
	Else
		$string = StringMid($rBuffer, $iIndex, $iLength * 2)
		$iIndex += $iLength * 2
	EndIf
	$result = _HexToString($string)
	Return $result
EndFunc   ;==>ReadString
#endregion

Func ReverseHex($sString)
	Local $sTemp, $len
	For $i = StringLen($sString) + 1 To 1 Step -2
		$sTemp &= StringMid($sString, $i, 2)
	Next
	Return $sTemp
EndFunc   ;==>ReverseHex

Func _StringToHexExt($sString, $Unicode = False)
	Local $string
	If $Unicode Then
		For $i = 1 To StringLen($sString)
			$string &= _StringToHex(StringMid($sString, $i, 1)) & "00"
		Next
	Else
		For $i = 1 To StringLen($sString)
			$string &= _StringToHex(StringMid($sString, $i, 1))
		Next
	EndIf

	Return $string
EndFunc   ;==>_StringToHexExt
But i dont know what to input at :

Code:
NewPacket( ??? , 2)
AppendByte(?)
AppendByte(?)
AppendDWord( ???)
AppendByte(?)
MsgBox(0,0,GetPacket())
If you want to send sit down packet :
NewPacket(0x704F,2) ; dunno what is iValue :D
AppendByte(4)
TCPSend($socket,GetPacket())
08/04/2011 17:02 DeXeee#5
Ok, i try it like this but i got dc ...

Code:
#include <string.au3>
Global $sBuffer, $rBuffer
Global $iSize, $iIndex

$IP = "127.0.0.1"
TCPStartUp()
$socket = TCPConnect( $IP, 16000)
If $socket = -1 Then MsgBox (0,"TCP","Can't make a connection")


NewPacket(0x704F,2)
AppendByte(4)
TCPSend($socket,GetPacket())


Func NewPacket($sValue, $iValue)
	Local $sTemp = Hex($sValue)
	$sBuffer = ""
	$iSize = 0
	$sBuffer &= StringLeft(ReverseHex(Hex($sValue)), 4)
	$sBuffer &= StringLeft(ReverseHex(Hex($iValue)), 4)
EndFunc   ;==>NewPacket

Func ReverseHex($sString)
	Local $sTemp, $len
	For $i = StringLen($sString) + 1 To 1 Step -2
		$sTemp &= StringMid($sString, $i, 2)
	Next
	Return $sTemp
EndFunc   ;==>ReverseHex

Func AppendByte($sValue)
	$sBuffer &= StringRight(Hex($sValue), 2)
	$iSize += 1
EndFunc   ;==>AppendByte

Func GetPacket()
	Local $sTemp = "0x"
	$sTemp &= StringLeft(ReverseHex(Hex($iSize)), 4)
	$sTemp &= $sBuffer
	Return $sTemp
EndFunc   ;==>GetPacket
Is there anything wrong ?
08/04/2011 17:43 ÑõÑ_Ŝŧóp#6
Quote:
Originally Posted by DeXeee View Post
Ok, i try it like this but i got dc ...

Code:
#include <string.au3>
Global $sBuffer, $rBuffer
Global $iSize, $iIndex

$IP = "127.0.0.1"
TCPStartUp()
$socket = TCPConnect( $IP, 16000)
If $socket = -1 Then MsgBox (0,"TCP","Can't make a connection")


NewPacket(0x704F,2)
AppendByte(4)
TCPSend($socket,GetPacket())


Func NewPacket($sValue, $iValue)
	Local $sTemp = Hex($sValue)
	$sBuffer = ""
	$iSize = 0
	$sBuffer &= StringLeft(ReverseHex(Hex($sValue)), 4)
	$sBuffer &= StringLeft(ReverseHex(Hex($iValue)), 4)
EndFunc   ;==>NewPacket

Func ReverseHex($sString)
	Local $sTemp, $len
	For $i = StringLen($sString) + 1 To 1 Step -2
		$sTemp &= StringMid($sString, $i, 2)
	Next
	Return $sTemp
EndFunc   ;==>ReverseHex

Func AppendByte($sValue)
	$sBuffer &= StringRight(Hex($sValue), 2)
	$iSize += 1
EndFunc   ;==>AppendByte

Func GetPacket()
	Local $sTemp = "0x"
	$sTemp &= StringLeft(ReverseHex(Hex($iSize)), 4)
	$sTemp &= $sBuffer
	Return $sTemp
EndFunc   ;==>GetPacket
Is there anything wrong ?
Hmm maybe this iValue is the security byte
try
NewPacket(0x704F,1)
AppendByte(4)
TCPSend($socket,GetPacket())
08/04/2011 17:50 DeXeee#7
Quote:
Originally Posted by ÑõÑ_Ŝŧóp View Post
Hmm maybe this iValue is the security byte
try
NewPacket(0x704F,1)
AppendByte(4)
TCPSend($socket,GetPacket())
Dc again =/

I try to add
Code:
TCPCloseSocket($socket)
TCPShutdown()
at the end, but its not helping :D

Maybe is the problem becouse i am using HackShield, iBot and edx loader to start up Silkroad ?

----------------------------------------------------

Maybe i am not sending packets to SRO, maybe to ibot ha ?

I am using iBot

Then with edxloader i am redirecting Getway server to : 127.0.0.1 Port : 16000 ( Like in iBot )

In AutoIT i am using the same

Code:
$IP = "127.0.0.1"
TCPStartUp()
$socket = TCPConnect( $IP, 16000)
Maybe is that the problem, ha ? =/
08/04/2011 21:24 ZeraPain#8
it always depends on the proxy you use.
i used srproxy.

iValue are the security bytes.
(for srproxy 0100 = P->C , 0200 P->S)

try to use it with srproxy w/o revbot compability (should be connected to port 9000)
08/04/2011 21:54 DeXeee#9
Thanks a lot mates !

Synx7
ÑõÑ_Ŝŧóp
ZeraPain

I'll try everything you told me, i will tell you tomorow did i make it to work :)


GUUUUUYSSSSSSSS I LOVE YOU SOOOOOOOO MUUUUUCHH !!!!

I MAKE A SIT XDDD OH YEA BEYBEEE ! :)

I will post codes tomorow and make a little tutorial :)

Again thanks a lot , with regards, Dex !
08/04/2011 22:49 Kape7#10
Glad you got it working =3
08/04/2011 22:56 sarkoplata#11
Quote:
Originally Posted by DeXeee View Post
Thanks a lot mates !

Synx7
ÑõÑ_Ŝŧóp
ZeraPain

I'll try everything you told me, i will tell you tomorow did i make it to work :)


GUUUUUYSSSSSSSS I LOVE YOU SOOOOOOOO MUUUUUCHH !!!!

I MAKE A SIT XDDD OH YEA BEYBEEE ! :)

I will post codes tomorow and make a little tutorial :)

Again thanks a lot , with regards, Dex !
its the greatest pleasure you would ever have in packet injection thingy. have fun :D
08/04/2011 23:02 DeXeee#12
Just 1 more question guys ...

I got this from analayzer :

Code:
[C -> S][7074]
01                     
04                                   
14 05 00 00         
00
Now, in AutoIT i dont know how to convert this "14 05 00 00" :

Code:
AppendOpCode2(0x7074)
AppendSecurity2(2)
AppendByte2(1)
AppendByte2(4)
AppendWord2(????)
AppendByte2(0)
Can some1 tell me how to calculate that, or what ever i need to do with this :D
08/04/2011 23:07 ZeraPain#13
MsgBox(0,0, Dec(ReverseHex("14050000")))
-> 1300 -> your value
08/04/2011 23:24 Kape7#14
[Only registered and activated users can see links. Click Here To Register...]

This tool is really helpful for that. Remember byte's max value its 255.
08/04/2011 23:57 DeXeee#15
Huh, buffs dont want to work ... :S

Code:
[C -> S][7074]
01                                      
04                                     
14 05 00 00                                 
00
I use this method to get "AppendWord2()" :

Code:
#include <string.au3>
Global $sBuffer, $rBuffer
Global $iSize, $iIndex

MsgBox(0,"",Dec(ReverseHex("14050000")))

Func ReverseHex($sString)
	Local $sTemp, $i
	For $i = StringLen($sString) +1 To 1 Step -2
		$sTemp &= StringMid($sString, $i, 2)
	Next
	Return $sTemp
EndFunc   ;==>ReverseHex
For 14050000 i got 1300 and put it in AppendWord2()


So, this is the final :

Code:
AppendOpCode2(0x7074)
AppendSecurity2(2)
AppendByte2(1)
AppendByte2(4)
AppendWord2(1300)
AppendByte2(0)
Was I wrong somewhere ? :confused: