|
You last visited: Today at 01:19
Advertisement
[Guide] Using edxSilkroadProxy to Create a Simple AutoIt Clientless
Discussion on [Guide] Using edxSilkroadProxy to Create a Simple AutoIt Clientless within the SRO Coding Corner forum part of the Silkroad Online category.
02/26/2011, 12:14
|
#31
|
elite*gold: 20
Join Date: Mar 2007
Posts: 4,277
Received Thanks: 2,990
|
Server IDs are received in server list packet. You should get them from there instead using constants.
This should help you build a better alternative:
Delphi(old):
Code:
type TServer=record
ServerId:integer;
Name:string;
Check:boolean;
Population:word;
MaxPopulation:word;
end;
type TServers=record
Server:Array of TServer;
procedure init();
procedure free();
end;
procedure ParseServerData(packet:TPacket);
var num:integer;
begin
with Sender.Builder do begin
num:=0;
BeginRead(packet.pData , packet.Size);
AddIndex(2);
AddIndex(Read<WORD> * 2 + 7);
SetLength(Servers.Server, 255);
while(Read<byte> =1) do begin
if(Length(Servers.Server) = num) then SetLength(Servers.Server, Length(Servers.Server)+50);
with Servers.Server[num] do begin
ServerId := Celebrity.Read<WORD>;
ReadString(Name); //this reads string length(word) and then string!
Population := Read<WORD>;
MaxPopulation := Read<WORD>;
Check := not Read<boolean>;
Read<byte>;
end;
inc(num);
end;
SetLength(Servers.Server, num);
end;
end;
C#(old)
Code:
public static void servers(byte[] data, int size)
{
int num = 0;
Celebrity.Read<byte>(); //01 - active
var id = Celebrity.Read<byte>(); //XX - serverId
int len = Celebrity.Read<UInt16>();
Celebrity.SetIndex(Celebrity.GetIndex() + (len*2) + 7);
for (var b = Celebrity.Read<byte>(); b == 1; b = Celebrity.Read<byte>())
{
ServerIds[num] = (byte) Celebrity.Read<UInt16>();
len = Celebrity.Read<UInt16>();
var namez = new byte[len];
Celebrity.ReadArray(namez, len);
Names[num] = Encoding.ASCII.GetString(namez);
Population[num] = Celebrity.Read<UInt16>();
Max[num] = Celebrity.Read<UInt16>();
empty[num] = Max[num] - Population[num];
Check[num] = Celebrity.Read<byte>();
Celebrity.Read<byte>();
num++;
}
}
Both need rewrite as they do Not parse the entire packet, however it used to work on vsro,isro,csro and so on.
|
|
|
03/05/2011, 01:41
|
#32
|
dotCom
elite*gold: 9842
Join Date: Mar 2009
Posts: 16,843
Received Thanks: 4,675
|
Have anyone the new isro packets ?
Programm doesn't work and I don't know the new packets.
|
|
|
03/05/2011, 08:38
|
#33
|
elite*gold: 0
Join Date: Dec 2007
Posts: 2,400
Received Thanks: 1,517
|
Quote:
Originally Posted by superteddy
Have anyone the new isro packets ?
Programm doesn't work and I don't know the new packets.
|
Sniff them, analyze them.
|
|
|
03/05/2011, 08:58
|
#34
|
elite*gold: 0
Join Date: Apr 2007
Posts: 449
Received Thanks: 236
|
Quote:
Originally Posted by superteddy
Have anyone the new isro packets ?
Programm doesn't work and I don't know the new packets.
|
here is the opcode table for isro v1.290
Code:
DIR | SRV | CLI
===================
S->C | 0FFC | --
S->C | 0FFD | --
S->C | 2000 | --
C->S | 2114 | --
S->C | 300A | --
S->C | 300C | --
S->C | 3011 | --
C->S | 3012 | --
S->C | 3013 | --
S->C | 3015 | --
S->C | 3016 | --
S->C | 3017 | --
S->C | 3018 | --
S<>C | 3019 | 3019
S->C | 3020 | --
S->C | 3026 | --
S->C | 3027 | --
S->C | 3028 | --
S->C | 302D | --
S->C | 3036 | --
S->C | 3038 | --
S->C | 3039 | --
S->C | 303D | --
S->C | 3040 | --
S->C | 3041 | --
S->C | 3042 | --
S->C | 3047 | --
S->C | 3048 | --
S->C | 3049 | --
S->C | 304D | --
S->C | 304E | --
S->C | 3052 | --
C->S | 3053 | --
S->C | 3054 | --
S->C | 3055 | --
S->C | 3056 | --
S->C | 3057 | --
S->C | 3058 | --
S->C | 305C | --
S->C | 3065 | --
S->C | 3068 | --
C->S | 306E | --
S->C | 3076 | --
S->C | 3077 | --
S->C | 3078 | --
S<>C | 3080 | 3080
S->C | 3085 | --
S->C | 3086 | --
S->C | 3087 | --
S->C | 3088 | --
S->C | 3089 | --
S->C | 308C | --
S<>C | 3091 | 3091
S->C | 3092 | --
S->C | 30A6 | --
S->C | 30B7 | --
S->C | 30B8 | --
S->C | 30B9 | --
S->C | 30BB | --
S->C | 30BF | --
S->C | 30C1 | --
S->C | 30C2 | --
S->C | 30C3 | --
C->S | 30C4 | --
S->C | 30C8 | --
S->C | 30C9 | --
S->C | 30CA | --
S->C | 30CD | --
S->C | 30CE | --
S->C | 30CF | --
S->C | 30D0 | --
S->C | 30D1 | --
S->C | 30D2 | --
S->C | 30D3 | --
S<>C | 30D4 | 30D4
S->C | 30D5 | --
S->C | 30D6 | --
S->C | 30D7 | --
S->C | 30DA | --
S->C | 30DC | --
S->C | 30DF | --
S->C | 30E0 | --
S<>C | 30E6 | 70E6
S->C | 30E7 | --
S->C | 30E8 | --
S->C | 30EB | --
S->C | 30EC | --
S->C | 30EF | --
S<>C | 30FF | 70FF
S->C | 3100 | --
S->C | 3101 | --
S->C | 3102 | --
S->C | 3103 | --
S->C | 3109 | --
S->C | 3120 | --
S->C | 3153 | --
S->C | 3154 | --
S->C | 3156 | --
S->C | 3159 | --
S->C | 315A | --
S->C | 315B | --
S->C | 315C | --
S->C | 315D | --
S->C | 315E | --
S->C | 3161 | --
S->C | 3200 | --
S->C | 3201 | --
S->C | 3204 | --
S->C | 3206 | --
S->C | 3207 | --
S->C | 3209 | --
S->C | 320A | --
S->C | 320B | --
S->C | 320C | --
S->C | 3253 | --
S->C | 3254 | --
S->C | 3255 | --
S->C | 3256 | --
S->C | 3257 | --
S->C | 325C | --
S->C | 325D | --
S->C | 325E | --
S->C | 325F | --
S->C | 3261 | --
C->S | 3303 | --
S->C | 3305 | --
S->C | 330F | --
S->C | 3405 | --
C->S | 347F | --
S->C | 34A5 | --
S->C | 34A6 | --
C->S | 34A9 | --
S->C | 34AA | --
S->C | 34B1 | --
S->C | 34B3 | --
S->C | 34B4 | --
S->C | 34B5 | --
C->S | 34B6 | --
S->C | 34BA | --
S->C | 34BE | --
C->S | 34C5 | --
S->C | 34D2 | --
S->C | 34D5 | --
S->C | 34E1 | --
S->C | 34F2 | --
S->C | 34F3 | --
S->C | 34F4 | --
S->C | 34FA | --
S->C | 34FB | --
S->C | 350D | --
S->C | 3514 | --
S->C | 351E | --
S->C | 3530 | --
S->C | 3531 | --
S->C | 3532 | --
S->C | 3536 | --
C->S | 3537 | --
S->C | 3545 | --
S->C | 3556 | --
S->C | 3561 | --
S->C | 3563 | --
C->S | 3564 | --
S->C | 3809 | --
S->C | 385F | --
S->C | 3864 | --
S->C | 38F5 | --
S->C | 3908 | --
S->C | 3B07 | --
S->C | 3C52 | --
S->C | 3C53 | --
S->C | 3C54 | --
S->C | 3C55 | --
S->C | 3C80 | --
S->C | 3C81 | --
S->C | 3C82 | --
S->C | 3C86 | --
S->C | 3C87 | --
S->C | 3CA2 | --
C->S | 7001 | --
C->S | 7007 | --
S->C | 7030 | --
C->S | 7061 | --
C->S | 7063 | --
S<>C | 706D | 706D
S<>C | 7110 | 7110
C->S | 7158 | --
S->C | 7302 | --
C->S | 7450 | --
S<>C | 747E | 747E
C->S | 74B2 | --
C->S | 74D3 | --
S<>C | 751A | 751A
C->S | 7565 | --
S->C | B005 | --
S<>C | B006 | 7006
S<>C | B010 | 7010
S<>C | B021 | 7021
S<>C | B023 | 7023
S<>C | B024 | 7024
S<>C | B025 | 7025
S->C | B030 | --
S<>C | B031 | 7031
C->S | B034 | --
S<>C | B03C | 703C
C->S | B03E | --
S<>C | B03F | 703F
S<>C | B045 | 7045
S<>C | B046 | 7046
S<>C | B04B | 704B
C->S | B04C | --
S<>C | B04F | 704F
S<>C | B050 | 7050
S<>C | B051 | 7051
S<>C | B059 | 7059
S<>C | B05A | 705A
S<>C | B05B | 705B
S<>C | B05D | 705D
S<>C | B05E | 705E
S<>C | B060 | 7060
S<>C | B062 | 7062
S->C | B067 | --
S<>C | B069 | 7069
S<>C | B06A | 706A
S<>C | B06B | 706B
S<>C | B06C | 706C
S->C | B06D | --
S<>C | B070 | B070
S->C | B071 | --
S->C | B072 | --
S<>C | B074 | 7074
S<>C | B081 | 7081
C->S | B082 | --
S<>C | B083 | 7083
S<>C | B084 | 7084
S<>C | B0A1 | 70A1
S<>C | B0A2 | 70A2
S<>C | B0A7 | 70A7
S<>C | B0B1 | 70B1
S<>C | B0B2 | 70B2
S<>C | B0B3 | 70B3
S<>C | B0B4 | 70B4
S<>C | B0B5 | 70B5
S<>C | B0BA | 70BA
S->C | B0BC | --
S->C | B0BD | --
S->C | B0BE | --
S<>C | B0C0 | 70C0
S<>C | B0C5 | 70C5
S<>C | B0C6 | 70C6
S<>C | B0C7 | 70C7
S<>C | B0CB | 70CB
S<>C | B0D8 | 70D8
S<>C | B0D9 | 70D9
S<>C | B0DB | 70DB
S<>C | B0E1 | 70E1
S<>C | B0E2 | 70E2
S<>C | B0E3 | 70E3
S<>C | B0E4 | 70E4
S<>C | B0E5 | 70E5
S->C | B0E6 | --
S<>C | B0EA | 70EA
S->C | B0ED | --
S<>C | B0F0 | 70F0
S<>C | B0F1 | 70F1
S<>C | B0F2 | 70F2
S<>C | B0F3 | 70F3
S<>C | B0F4 | 70F4
S<>C | B0F6 | 70F6
S->C | B0F8 | --
S<>C | B0F9 | 70F9
S<>C | B0FA | 70FA
S<>C | B0FB | 70FB
S<>C | B0FC | 70FC
S<>C | B0FD | 70FD
S->C | B0FF | --
S<>C | B103 | 7103
S->C | B104 | --
S<>C | B105 | 7105
S<>C | B106 | 7106
S<>C | B107 | 7107
S->C | B110 | --
S<>C | B112 | 7112
S<>C | B113 | 7113
S<>C | B114 | 7114
S<>C | B116 | 7116
S<>C | B117 | 7117
S<>C | B118 | 7118
S<>C | B119 | 7119
S<>C | B121 | 7121
S<>C | B150 | 7150
S<>C | B151 | 7151
S<>C | B155 | 7155
S<>C | B157 | 7157
S<>C | B15F | 715F
S<>C | B160 | 7160
S<>C | B168 | 7168
S<>C | B16A | 716A
S<>C | B202 | 7202
S<>C | B203 | 7203
S<>C | B250 | 7250
S<>C | B251 | 7251
S<>C | B252 | 7252
S<>C | B256 | 7256
S<>C | B258 | 7258
S<>C | B259 | 7259
S<>C | B25A | 725A
S<>C | B302 | 7302
S<>C | B304 | 7304
S<>C | B308 | 7308
S<>C | B309 | 7309
S<>C | B30A | 730A
S<>C | B30B | 730B
S<>C | B30C | 730C
S<>C | B30D | 730D
S<>C | B402 | 7402
S<>C | B420 | 7420
S<>C | B451 | 7451
S<>C | B461 | 7461
S<>C | B462 | 7462
S<>C | B463 | 7463
S<>C | B470 | 7470
S<>C | B471 | 7471
S<>C | B472 | 7472
S<>C | B473 | 7473
S<>C | B474 | 7474
S<>C | B475 | 7475
S<>C | B476 | 7476
S<>C | B477 | 7477
S<>C | B478 | 7478
S<>C | B47A | 747A
S<>C | B47B | 747B
S<>C | B47C | 747C
S<>C | B47D | 747D
S->C | B47E | --
S<>C | B483 | 7483
S<>C | B4D4 | 74D4
S<>C | B4DD | 74DD
S<>C | B4DF | 74DF
S<>C | B4E0 | 74E0
S->C | B4E3 | --
S<>C | B4F6 | 74F6
S->C | B4F9 | --
S<>C | B506 | 7506
S<>C | B507 | 7507
S<>C | B508 | 7508
S<>C | B509 | 7509
S<>C | B50A | 750A
S<>C | B50B | 750B
S<>C | B50C | 750C
S<>C | B50E | 750E
S<>C | B515 | 7515
S<>C | B516 | 7516
S<>C | B519 | 7519
S->C | B51A | --
S<>C | B51C | 751C
S<>C | B51D | 751D
S<>C | B557 | 7557
S<>C | B558 | 7558
S<>C | B559 | 7559
S->C | B566 | --
Server: 182
Client: 182
Both: 157
|
|
|
03/05/2011, 15:45
|
#35
|
dotCom
elite*gold: 9842
Join Date: Mar 2009
Posts: 16,843
Received Thanks: 4,675
|
Thanks , but it doesn't work.
Here the au3 file from the 1# Post but I edited the Opcodes/Packes.
I'm playing iSro.
Thanks for replays.
Update:
I'm using this Port: 22580
becuase I use nuConnector v8.1 + MultiSocket and patched the Media.pk2 to:
IP: 127.0.0.1
Port: 15778
Code:
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <string.au3>
Global $controlArray[37][5]
Global $globalParseIndex = 0
Global $globalParseSize = 0
Global $globalParseBuffer = ""
Global $globalSendBuffer = ""
Global $globalSendSize = 0
Global $mainwindow = 0
Global $serverStatsTimer = 0
Global $doRequestStats = true
;SplashImageOn("edxLabs Proudly Presents...", "beeker2.jpg", 304, 378)
;Sleep(3000)
;SplashOff()
TCPStartup()
$iIP = TCPNameToIP("127.0.0.1")
$iSocket = TCPConnect($iIP, 22580);22580 / Standart: 16000 / Kp: 15778
If $iSocket = -1 Then
MsgBox(64, "edxAutoitClientless", "Connection Failure.")
Exit
EndIf
$mainwindow = GUICreate("edxAutoItClientless", 800, 600)
GUISwitch($mainwindow)
$tab = GUICtrlCreateTab(10, 10, 800 - 20, 600 - 20)
$tab0 = GUICtrlCreateTabItem("Home")
$tab1 = GUICtrlCreateTabItem("Server Stats")
For $i = 0 to 18
$controlArray[$i][0] = GUICtrlCreateInput("000", 20, 40 + $i * 20, 25, 20)
$controlArray[$i][1] = GUICtrlCreateInput("Servername", 50, 40 + $i * 20, 90, 20)
$controlArray[$i][2] = GUICtrlCreateInput("0000", 140, 40 + $i * 20, 30, 20)
$controlArray[$i][3] = GUICtrlCreateInput("0000", 170, 40 + $i * 20, 30, 20)
$controlArray[$i][4] = GUICtrlCreateInput("00", 200, 40 + $i * 20, 20, 20)
Next
For $i = 19 to 36
$controlArray[$i][0] = GUICtrlCreateInput("000", 20 + 240, 40 + ($i - 19) * 20, 25, 20)
$controlArray[$i][1] = GUICtrlCreateInput("Servername", 50 + 240, 40 + ($i - 19) * 20, 90, 20)
$controlArray[$i][2] = GUICtrlCreateInput("0000", 140 + 240, 40 + ($i - 19) * 20, 30, 20)
$controlArray[$i][3] = GUICtrlCreateInput("0000", 170 + 240, 40 + ($i - 19) * 20, 30, 20)
$controlArray[$i][4] = GUICtrlCreateInput("00", 200 + 240, 40 + ($i - 19) * 20, 20, 20)
Next
$tab2 = GUICtrlCreateTabItem("Login")
GUICtrlCreateLabel("Account: ", 20, 43, 50)
Global $controlName = GUICtrlCreateInput("", 80, 40, 121, 20, BitOR($SS_LEFT, $ES_PASSWORD))
GUICtrlCreateLabel("Password: ", 20, 63, 50)
Global $controlPass = GUICtrlCreateInput("", 80, 60, 121, 20, BitOR($SS_LEFT, $ES_PASSWORD))
GUICtrlCreateLabel("Server: ", 20, 83, 50)
Global $controlServer = GUICtrlCreateCombo("xian", 80, 80, 121, 20)
GUICtrlSetData(-1, "aege|troy|athens|oasis|venice|greece|alps|olympus|tibet|babel|redsea|rome|sparta|********|pacific|alexander|persia|zeus|poseidon|hercules|odin|mercury|mars|saturn|venus|uranus|pluto|neptune|hera|gaia|eos|phoenix|ares|iris|titan|apollo") ; add other item snd set a new default
Global $controlLogin = GUICtrlCreateButton("Login!", 125, 105, 75)
Global $controlLog = GUICtrlCreateEdit("Welcome to edxAutoItClientless!" & @CRLF, 20, 150, 755, 420, $ES_AUTOVSCROLL + $WS_VSCROLL)
GUICtrlSetData($controlLog, "Made By: pushedx" & @CRLF, 1)
GUICtrlSetData($controlLog, "" & @CRLF, 1)
Global $controlCharacter = GUICtrlCreateCombo("Character Select", 300, 40, 121, 20)
Global $controlJoin = GUICtrlCreateButton("Let's Roll!", 430, 40, 75, 20)
GUISetState(@SW_SHOW)
$loginAttempts = 0
while 1
UpdateGui()
If @error Then
ExitLoop
Endif
if $doRequestStats and TimerDiff($serverStatsTimer) > 3000 Then
BeginPacket(0x6101)
EndPacket()
TCPSend($iSocket, GetPacket())
$doRequestStats = False ; Wait for the new packet to be received
Endif
$packetSize = TryReadWord($iSocket)
If @error == 0 Then
$packetOpcode = ReadWord($iSocket)
If @error Then
ExitLoop
Endif
$packetSecurity = ReadWord($iSocket)
If @error Then
ExitLoop
Endif
$packetData = ReadArray($iSocket, Dec($packetSize))
If @error Then
ExitLoop
Endif
;MsgBox(0, "", "$packetSize =" & $packetSize & chr(13) & "$packetOpcode =" & HexToStrWord($packetOpcode) & chr(13) & "$packetSecurity =" & $packetSecurity & chr(13) & $packetData)
Switch $packetOpcode
case "1007" ; Identify ;ps 2001
BeginParse($packetData, Dec($packetSize))
$field1 = Dec(ParseWord()) ; length
$field2 = ParseAscii($field1)
if $field2 == "GatewayServer" then
BeginPacket(0x6100)
AppendByte(18) ; ISRO locale
AppendWord(9) ; length
AppendString("SR_Client") ; identity
AppendDword(290) ; version
EndPacket()
TCPSend($iSocket, GetPacket())
elseif $field2 == "AgentServer" then
; Nothing to do here
endif
case "A107" ; Server stats ;ps A101
$doRequestStats = true
BeginParse($packetData, Dec($packetSize))
$field1 = Dec(ParseByte())
$field2 = Dec(ParseByte())
$coreNameLength = Dec(ParseWord())
$coreName = ParseAscii($coreNameLength)
$nullTerm = ParseByte() ; null terminator
$nextServer = Dec(ParseByte())
$index = 0
while $nextServer == 1
$serverId = Dec(ParseWord())
$serverNameLength = Dec(ParseWord())
$serverName = ParseAscii($serverNameLength)
$serverCur = Dec(ParseWord())
$serverMax = Dec(ParseWord())
$serverState = Dec(ParseByte())
$nextServer = Dec(ParseByte())
GUICtrlSetData($controlArray[$index][0], $serverId)
GUICtrlSetData($controlArray[$index][1], $serverName)
GUICtrlSetData($controlArray[$index][2], $serverCur)
GUICtrlSetData($controlArray[$index][3], $serverMax)
GUICtrlSetData($controlArray[$index][4], $serverState)
$index = $index + 1
WEnd
$serverStatsTimer = TimerInit()
case "0FF2" ; Login result // old: A102 oder 2 ;ps A102 oder 0FF2 - 3
BeginParse($packetData, Dec($packetSize))
$result = Dec(ParseByte())
if $result == 1 Then
$loginId = Dec(ParseDword())
$ipNameLength = Dec(ParseWord())
$ipName = ParseAscii($ipNameLength)
$ipPort = Dec(ParseWord())
AppendStatusText("You are ready to join the world server!")
AppendStatusText("Connecting to " & $ipName & ":" & $ipPort)
$iSocket = 0
$iSocket = TCPConnect($ipName, $ipPort) ; All we have to do is connect to the new IP/Port
$doRequestStats = False
Else
$result = Dec(ParseByte()) ; Some error, we need to handle them all in a real program
if $result == 5 Then
$loginAttempts = $loginAttempts + 1
AppendStatusText("Could not connect due to server traffic [" & $loginAttempts & "]")
Else
AppendStatusText("There was an error logging into this account")
EndIf
EndIf
case "0FF3" ; World server login result // A107 old ;ps A103
BeginParse($packetData, Dec($packetSize))
$result = Dec(ParseByte())
if $result == 1 Then
AppendStatusText("You are now connected to the world server!")
BeginPacket(0x749F) ; Request character listing [TODO: Update each opcode change]
AppendByte(2) ; Request list
EndPacket()
TCPSend($iSocket, GetPacket())
EndIf
case "B007" ; Char listing [TODO: Update each opcode change]
BeginParse($packetData, Dec($packetSize))
$operation = Dec(ParseByte())
if $operation == 2 then ; char listing
$result = Dec(ParseByte())
$charCount = Dec(ParseByte())
AppendStatusText("Found " & $charCount & " characters")
For $c = 1 to $charCount
$charType = Dec(ParseDword())
$charNameLength = Dec(ParseWord())
$charName = ParseAscii($charNameLength)
AppendStatusText("Found character: " & $charName)
GUICtrlSetData($controlCharacter, $charName, 1)
$charVol = Dec(ParseByte())
$charLvl = Dec(ParseByte())
AppendStatusText("Level: " & $charLvl)
$charExp = Dec(ParseQWord())
$charStr = Dec(ParseWord())
$charInt = Dec(ParseWord())
$charAttr = Dec(ParseWord())
$charHp = Dec(ParseDword())
$charMp = Dec(ParseDword())
AppendStatusText("HP/MP: " & $charHp & "/" & $charMp)
$doDelete = Dec(ParseByte())
if $doDelete == 1 then
$charMinsToDel = Dec(ParseDword())
EndIf
$unk1 = Dec(ParseWord())
$unk2 = Dec(ParseByte())
$itemCount = Dec(ParseByte())
AppendStatusText("This character has " & $itemCount & " items equipped.")
For $i = 1 to $itemCount
$itemId = Dec(ParseDword())
$itemPlus = Dec(ParseByte())
AppendStatusText("[" & $itemId & "][+ " & $itemPlus & "]")
Next
$itemCount = Dec(ParseByte())
AppendStatusText("This character has " & $itemCount & " avatar items equipped.")
For $i = 1 to $itemCount
$itemId = Dec(ParseDword())
$itemPlus = Dec(ParseByte())
AppendStatusText("[" & $itemId & "][+ " & $itemPlus & "]")
Next
AppendStatusText("")
Next
Endif
case "B001" ; Char selection (205) [TODO: Update each opcode change]
BeginParse($packetData, Dec($packetSize))
$result = Dec(ParseByte())
if $result == 1 then
AppendStatusText("Joining the game now...")
else
AppendStatusText("There was an error selecting this character. Please choose a different one.")
EndIf
case "3013" ; Char id and time (205) [TODO: Update each opcode change] ;ps 332A
BeginParse($packetData, Dec($packetSize))
$charId = ParseDword()
$time_celestialPosition = Dec(ParseWord()) ; moon/sun
$time_hrs = Dec(ParseByte())
$time_mins = Dec(ParseByte())
AppendStatusText("My Character Id: " & $charId)
AppendStatusText("Time " & $time_hrs & ":" & $time_mins)
AppendStatusText("Celestial Position: " & $time_celestialPosition)
BeginPacket(0x328A) ; Send spawn packet [TODO: Update each opcode change]
EndPacket()
TCPSend($iSocket, GetPacket())
EndSwitch
ElseIf @error <> -3 Then
ExitLoop
Endif
wend
TCPShutdown()
;----------------------------------------------------------------------------------------------------
Func ReadByte($iSocket)
$lb = TCPRecv($iSocket, 1)
while $lb == ""
UpdateGui()
If @error Then
SetError(-2)
return 0
EndIf
$lb = TCPRecv($iSocket, 1)
If @error Then
SetError(-1)
return 0
EndIf
WEnd
return Hex(Binary($lb))
EndFunc
;----------------------------------------------------------------------------------------------------
Func ReadWord($iSocket)
$hb = TCPRecv($iSocket, 1)
while $hb == ""
UpdateGui()
If @error Then
SetError(-2)
return 0
EndIf
$hb = TCPRecv($iSocket, 1)
If @error Then
SetError(-1)
return 0
EndIf
WEnd
$lb = TCPRecv($iSocket, 1)
while $lb == ""
UpdateGui()
If @error Then
SetError(-2)
return 0
EndIf
$lb = TCPRecv($iSocket, 1)
If @error Then
SetError(-1)
return 0
EndIf
WEnd
return Hex(Binary($lb) & Binary($hb))
EndFunc
;----------------------------------------------------------------------------------------------------
Func TryReadWord($iSocket)
$hb = TCPRecv($iSocket, 1)
if $hb == "" Then
SetError(-3)
return 0
EndIf
$lb = TCPRecv($iSocket, 1)
while $lb == ""
UpdateGui()
If @error Then
SetError(-2)
return 0
EndIf
$lb = TCPRecv($iSocket, 1)
If @error Then
SetError(-1)
return 0
EndIf
WEnd
SetError(0)
return Hex(Binary($lb) & Binary($hb))
EndFunc
;----------------------------------------------------------------------------------------------------
Func ReadArray($iSocket, $count)
$data = ""
For $i = 1 to $count Step 1
UpdateGui()
If @error Then
SetError(-2)
return 0
EndIf
$data = $data & ReadByte($iSocket)
If @error Then
SetError(-1)
return 0
EndIf
Next
return $data
EndFunc
;----------------------------------------------------------------------------------------------------
Func HexToStrWord($var)
$len = StringLen($var)
if $len > 4 then
return StringRight($var, 4)
elseif $len == 4 then
return $var
elseif $len == 3 then
return "0" & $var
elseif $len == 2 then
return "00" & $var
elseif $len == 1 then
return "000" & $var
endif
EndFunc
;----------------------------------------------------------------------------------------------------
Func HexToStrDword($var)
$len = StringLen($var)
if $len > 8 then
return StringRight($var, 8)
elseif $len == 8 then
return $var
elseif $len == 7 then
return "0" & $var
elseif $len == 6 then
return "00" & $var
elseif $len == 5 then
return "000" & $var
elseif $len == 4 then
return "0000" & $var
elseif $len == 3 then
return "00000" & $var
elseif $len == 2 then
return "000000" & $var
elseif $len == 1 then
return "0000000" & $var
endif
EndFunc
;----------------------------------------------------------------------------------------------------
Func HexToStrByte($var)
$len = StringLen($var)
if $len > 2 then
return StringRight($var, 2)
elseif $len == 2 then
return $var
else ; Error condition
return "00"
endif
EndFunc
;----------------------------------------------------------------------------------------------------
Func BeginParse($buffer, $size)
$globalParseIndex = 1
$globalParseSize = $size
$globalParseBuffer = $buffer
EndFunc
;----------------------------------------------------------------------------------------------------
Func ParseByte()
$result = StringMid($globalParseBuffer, $globalParseIndex, 2)
$globalParseIndex = $globalParseIndex + 2
return $result
EndFunc
;----------------------------------------------------------------------------------------------------
Func ParseWord()
$low = ParseByte()
$hi = ParseByte()
return $hi & $low
EndFunc
;----------------------------------------------------------------------------------------------------
Func ParseDword()
$low = ParseWord()
$hi = ParseWord()
return $hi & $low
EndFunc
;----------------------------------------------------------------------------------------------------
Func ParseQWord()
$low = ParseDword()
$hi = ParseDword()
return $hi & $low
EndFunc
;----------------------------------------------------------------------------------------------------
Func ParseAscii($length)
$result = StringMid($globalParseBuffer, $globalParseIndex, $length * 2)
$globalParseIndex = $globalParseIndex + ($length * 2)
$len = StringLen($result)
$strResult = ""
For $i = 1 to $len Step 2
$strResult = $strResult & Chr(Dec(StringMid($result, $i, 2)))
Next
return $strResult
EndFunc
;----------------------------------------------------------------------------------------------------
Func ParseUnicode($length)
$result = StringMid($globalParseBuffer, $globalParseIndex, $length * 4)
$globalParseIndex = $globalParseIndex + ($length * 4)
$len = StringLen($result)
$strResult = ""
For $i = 1 to $len Step 4
$strResult = $strResult & ChrW(Dec(StringMid($result, $i, 4)))
Next
return $strResult
EndFunc
;----------------------------------------------------------------------------------------------------
Func BeginPacket($opcode)
$globalSendBuffer = ""
$globalSendSize = 0
$sOpcode = HexToStrWord(Hex($opcode))
$globalSendBuffer = StringMid($sOpcode, 3, 2) & StringMid($sOpcode, 1, 2)
$globalSendBuffer = $globalSendBuffer & "0000" ; Security bytes
;MsgBox(0, "", $globalSendBuffer)
EndFunc
Func AppendByte($value)
$sValue = HexToStrByte(Hex($value))
$globalSendBuffer = $globalSendBuffer & $sValue
$globalSendSize = $globalSendSize + 1
EndFunc
Func AppendWord($value)
$sValue = HexToStrWord(Hex($value))
$globalSendBuffer = $globalSendBuffer & StringMid($sValue, 3, 2) & StringMid($sValue, 1, 2)
$globalSendSize = $globalSendSize + 2
EndFunc
Func AppendDword($value)
$sValue = HexToStrDword(Hex($value))
$globalSendBuffer = $globalSendBuffer & StringMid($sValue, 7, 2) & StringMid($sValue, 5, 2) & StringMid($sValue, 3, 2) & StringMid($sValue, 1, 2)
$globalSendSize = $globalSendSize + 4
EndFunc
Func AppendString($value)
For $i = 1 to StringLen($value) Step 1
$xh = StringMid($value, $i, 1)
$sValue = HexToStrByte(Hex(Asc($xh)))
$globalSendBuffer = $globalSendBuffer & $sValue
$globalSendSize = $globalSendSize + 1
Next
EndFunc
Func EndPacket()
$sSize = HexToStrWord(Hex($globalSendSize))
$globalSendBuffer = (StringMid($sSize, 3, 2) & StringMid($sSize, 1, 2)) & $globalSendBuffer
;MsgBox(0, "", $globalSendBuffer)
EndFunc
Func GetPacket()
return _HexToString($globalSendBuffer)
EndFunc
;----------------------------------------------------------------------------------------------------
Func UpdateGui()
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
SetError(-2)
Return
Case $msg = $controlJoin
$n = GUICtrlRead($controlCharacter, 1)
if StringLen($n) == 0 then
$n = GUICtrlRead($controlCharacter)
if StringLen($n) == 0 then
MsgBox(0, "", "Please choose a Character")
return
endif
endif
if StringCompare($n, "Character Select") == 0 then
MsgBox(0, "", "Please choose a Character")
return
endif
BeginPacket(0x77B0) ; [TODO: Update each opcode change]
AppendWord(StringLen($n))
AppendString($n)
EndPacket()
TCPSend($iSocket, GetPacket())
AppendStatusText("Attempting to login with character: " & $n)
Case $msg = $controlLogin
$n = GUICtrlRead($controlName)
if StringLen($n) == 0 then
MsgBox(0, "", "Please enter an Account")
return
endif
$p = GUICtrlRead($controlPass)
if StringLen($p) == 0 then
MsgBox(0, "", "Please enter a Password")
return
endif
$s = GUICtrlRead($controlServer)
;MsgBox(0, "", $n & " " & $p & " " & $s)
$doRequestStats = False
BeginPacket(0x6102)
AppendByte(18)
AppendWord(StringLen($n))
AppendString($n)
AppendWord(StringLen($p))
AppendString($p)
AppendWord(ServerToId($s))
EndPacket()
TCPSend($iSocket, GetPacket())
EndSelect
EndFunc
;----------------------------------------------------------------------------------------------------
Func ServerToId($server)
if StringCompare($server, "xian") == 0 Then
return 65
Endif
if StringCompare($server, "aege") == 0 Then
return 74
Endif
if StringCompare($server, "troy") == 0 Then
return 76
Endif
if StringCompare($server, "athens") == 0 Then
return 94
Endif
if StringCompare($server, "oasis") == 0 Then
return 96
Endif
if StringCompare($server, "venice") == 0 Then
return 102
Endif
if StringCompare($server, "greece") == 0 Then
return 107
Endif
if StringCompare($server, "alps") == 0 Then
return 113
Endif
if StringCompare($server, "olympus") == 0 Then
return 114
Endif
if StringCompare($server, "tibet") == 0 Then
return 132
Endif
if StringCompare($server, "babel") == 0 Then
return 134
Endif
if StringCompare($server, "redsea") == 0 Then
return 150
Endif
if StringCompare($server, "rome") == 0 Then
return 151
Endif
if StringCompare($server, "sparta") == 0 Then
return 152
Endif
if StringCompare($server, "********") == 0 Then
return 156
Endif
if StringCompare($server, "pacific") == 0 Then
return 159
Endif
if StringCompare($server, "alexander") == 0 Then
return 162
Endif
if StringCompare($server, "persia") == 0 Then
return 165
Endif
if StringCompare($server, "zeus") == 0 Then
return 166
Endif
if StringCompare($server, "poseidon") == 0 Then
return 174
Endif
if StringCompare($server, "hercules") == 0 Then
return 178
Endif
if StringCompare($server, "odin") == 0 Then
return 179
Endif
if StringCompare($server, "mercury") == 0 Then
return 180
Endif
if StringCompare($server, "mars") == 0 Then
return 181
Endif
if StringCompare($server, "saturn") == 0 Then
return 182
Endif
if StringCompare($server, "venus") == 0 Then
return 183
Endif
if StringCompare($server, "uranus") == 0 Then
return 187
Endif
if StringCompare($server, "pluto") == 0 Then
return 188
Endif
if StringCompare($server, "neptune") == 0 Then
return 190
Endif
if StringCompare($server, "hera") == 0 Then
return 191
Endif
if StringCompare($server, "gaia") == 0 Then
return 194
Endif
if StringCompare($server, "eos") == 0 Then
return 204
Endif
if StringCompare($server, "phoenix") == 0 Then
return 205
Endif
if StringCompare($server, "ares") == 0 Then
return 206
Endif
if StringCompare($server, "iris") == 0 Then
return 207
Endif
if StringCompare($server, "titan") == 0 Then
return 208
Endif
if StringCompare($server, "apollo") == 0 Then
return 209
Endif
EndFunc
;----------------------------------------------------------------------------------------------------
; Wrapper function to make life a little easier
Func AppendStatusText($text)
GUICtrlSetData($controlLog, $text & @CRLF, 1)
EndFunc
;----------------------------------------------------------------------------------------------------
|
|
|
04/16/2011, 15:12
|
#36
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8
Received Thanks: 0
|
Does this still work? I'm trying to use it with rSRO but I receive a A103 failure after I connect to gameserver. I'm not sure if I'm sending the 6103 packet correctly? Does anybody have more information about this? Thanks.
|
|
|
07/01/2011, 02:54
|
#37
|
elite*gold: 1
Join Date: May 2008
Posts: 493
Received Thanks: 184
|
Some1 can update it for eliteSRO?
Or what i need change that it work with eliteSRO ?
|
|
|
07/01/2011, 06:18
|
#38
|
elite*gold: 0
Join Date: Jan 2010
Posts: 360
Received Thanks: 249
|
wont work on esro because you will get dc caused by GG
|
|
|
11/09/2014, 01:23
|
#39
|
elite*gold: 0
Join Date: Feb 2009
Posts: 46
Received Thanks: 5
|
thanx its works , put its send unencrypted packets only
how to send encrypted packets after login to world server by auto it ?
|
|
|
 |
|
Similar Threads
|
C# Clientless using edxSilkroadProxy
05/23/2011 - SRO Hacks, Bots, Cheats & Exploits - 21 Replies
Here is a basic clientless written in C# using drew bentons edxSilkroadProxy. The code isn't complicated at all, using the basics which the .net framework provides. It doesn't provide any cool features, that's up to you to add. ;)
Source Download ( No binaries ): http://torquesro.info/download/tClientless%20C%23. rar
There will be more releases @ www.torquesro.info/forum for different sro versions, and different programming languages. ;)
|
[GUIDE] How to create Scripts/bots with AutoIT
09/22/2010 - Tutorials - 6 Replies
for all who want to learn something or create bots for browsergames, mmorpgs and other games
download Autoit here:
http://www.autoitscript.com/cgi-bin/getfile.pl?au toit3/autoit-v3-setup.exe
Now run the Scite Script Editor
this is where you type in your code, let check your code if errors are in it and compile it to executable exe file.
the first thing you need are the coordinates of your mouse to find locations on the screen, like skill buttons, status bars, or just positions which...
|
Is it possible to create a simple silkroad bot using java?
03/26/2009 - Silkroad Online - 2 Replies
anyone ?
|
(GUIDE)How to create own scripts/bots with AutoIt
11/19/2008 - Rappelz - 4 Replies
for all who want to learn something or create bots for browsergames, mmorpgs and other games
download Autoit here:
http://www.autoitscript.com/cgi-bin/getfile.pl?au toit3/autoit-v3-setup.exe
Now run the Scite Script Editor
this is where you type in your code, let check your code if errors are in it and compile it to executable exe file.
the first thing you need are the coordinates of your mouse to find locations on the screen, like skill buttons, status bars, or just positions which...
|
Ghostmouse - Create your own simple macros!
05/11/2006 - Conquer Online 2 - 8 Replies
Hi Everyone,
I recently Stumbled accross this little program, (Dont know if its been posted before) It is used for recording and playing back mouse scripts. They can also be saved and sent to others using the same program.
It is really useful to make a simple macro like a meditation leveler etc.
Here it is. Feel free to scan. (A Good online scanner is http://virusscan.jotti.org)
Edit: P.S Sorry for posting in the wrong forum. Can a mod please move this?
|
All times are GMT +1. The time now is 01:20.
|
|