Not a member yet? Register for your free account!

Go Back   elitepvpers > Silkroad Online > SRO Coding Corner
You last visited: Today at 18:33

  • Please register to post and access all features, it's quick, easy and FREE!

 

[Autoit]using opcodes

Discussion on [Autoit]using opcodes within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Thread Tools
Old   #1
 
Join Date: Jul 2008
Posts: 100
Received Thanks: 8
[Autoit]using opcodes

I don't know how to send packet like this I copied some codes from "acer2000" but i don't know how to convert packet like this
[C -> S][704F]
04
To binary like he did


btw sorry for bad English.
that's code
PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
local $edit
$g_IP 
"127.0.0.1"
$stan "0x704F04"
;$ss "0x04004570010004020000"  ;start talk
;$s1 "0x0500467001000402000003"   deposite
;$s2 "0x070034700100020D0004020000"   put item #1 at inventory to storage
TCPStartUp()
$socket TCPConnect($g_IP16000)
$Form1 GUICreate("Form1"624449191114)
$Button1 GUICtrlCreateButton("start"20837619357)
$Button2 GUICtrlCreateButton("Button2"40032814549)
 
$edit GUICtrlCreateEdit(""1010280180)
#EndRegion ### END Koda GUI section ###
if $socket = -1 Then
MsgBox
(0"Ops""Run proxy and program will close after 3 sec")
Sleep(3000)

else
   
GUISetState(@SW_SHOW)


   
While 
1
   
    $nMsg 
GUIGetMsg(0)
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
         case 
$Button1
          $recv 
TCPRecv($socket 8)    
        
$binFirst BinaryMid($recv110)
         If @
error Then MsgBox(0"Ops""Run proxy and program will close after 3 sec")
            If 
$recv <> "" Then GUICtrlSetData($edit_
               $g_IP 
" > " $binFirst & @CRLF GUICtrlRead($edit))
              case 
$Button2
TCPSend
($socket,$stan)
;
Sleep(2000)
;
TCPSend($socket,$s1)
;
Sleep(2000)
;
TCPSend($socket,$s2)
    EndSwitch
WEnd
EndIf 
when i send it i got crash can anyone help me and thx

__________________

kondos is offline  
Thanks
1 User
Old   #2
 
Join Date: Sep 2007
Posts: 255
Received Thanks: 523
You have to reverse byte order, and build the packet like:

Code:
"0100" = data length
"4F70" = opcode
"0100" = security, for nu/phConnector used to tell direction/encryption
"04" = packet data
So the sit packet would be "0x01004F70010004". To make life little easier, you should use functions like:

Code:
Func Rev($val)
	$result = ""
	For $i = 1 To StringLen($val) / 2
		$byte = StringRight($val, 2)
		$val = StringTrimRight($val, 2)
		$result &= $byte
	Next
	Return $result
EndFunc

Func SendPacket($opcode, $data)
	$opcode = Rev($opcode)
	$size = Rev(Hex(StringLen($data)/2, 4))
	TCPSend($socket, "0x" & $size & $opcode & "0100" & $data)
EndFunc
Usage: SendPacket("704F", "04")
jremy is offline  
Thanks
2 Users
Old   #3
 
Join Date: Aug 2011
Posts: 10
Received Thanks: 0
Thank you kondo for topic and jremy for the functions, helped me a lot.

But i cant connect i think...

i try phconnector with a default options:
HTML Code:
[phConnector]
IP=121.128.133.30
Port=15779
LoginListenPort=15778
WorldListenPort=15777
BotPort=22580
ServerBlock=
ClientBlock=
Dev=0
OK Connection of phconnector: OK

AutoIt i try:
HTML Code:
$socket = TCPConnect("127.0.0.1", 15779)
And to send:
HTML Code:
SendPacket("704F", "04")
with a function....Like jremy said...

But nothing happen

I will need use a pather for client or program for hackshield? ...

Waiting for anserws
bothpro is offline  
Old   #4
 
Join Date: Jul 2008
Posts: 100
Received Thanks: 8
thx jremy

__________________

kondos is offline  
Old   #5
 
Join Date: May 2009
Posts: 29
Received Thanks: 10
@bothpro
If you want to use client, you have to redirect your client to "127.0.0.1", 15779
Then connect your program to bot port (BotPort=22580)

If you don't want to use client, that topic should help you:

Just use phConnector instead of edxsilkroadproxy
srutownik is offline  
Thanks
1 User
Old   #6
 
Join Date: Aug 2011
Posts: 10
Received Thanks: 0
Dont work for me :/
I tried use new and old version of phconnector ...
I tried use edxloader v5 or v6..and only config redirect..and patch seed...
I tried in a Vsro...

When i send a packet..my client get DC...

Im using a win 64 bits, have any problem using this?

Thanks waiting answers
bothpro is offline  
Old   #7
 
Join Date: Jul 2008
Posts: 100
Received Thanks: 8
@jremy
when i send packet
Quote:
SendPacket("704F", "04")
i got dc why !?!?
kondos is offline  
Old   #8
 
Join Date: May 2009
Posts: 29
Received Thanks: 10
The problem is in using Hex() function.
The proper functioning requires integer arguments.
When you divide a number, foating number was returned.
You have to convert it to integer like this:
Code:
Func SendPacket($opcode, $data)
	$opcode = Rev($opcode)
	$size = Rev(Hex(Int(StringLen($data)/2), 4))
	TCPSend($socket, "0x" & $size & $opcode & "0100" & $data)
EndFunc
srutownik is offline  
Thanks
3 Users
Old   #9
 
Join Date: Jul 2008
Posts: 100
Received Thanks: 8
Quote:
Originally Posted by srutownik View Post
The problem is in using Hex() function.
The proper functioning requires integer arguments.
When you divide a number, foating number was returned.
You have to convert it to integer like this:
Code:
Func SendPacket($opcode, $data)
	$opcode = Rev($opcode)
	$size = Rev(Hex(Int(StringLen($data)/2), 4))
	TCPSend($socket, "0x" & $size & $opcode & "0100" & $data)
EndFunc
it's work thx
kondos is offline  
Old   #10
 
Join Date: Aug 2011
Posts: 10
Received Thanks: 0
Yes itīs work !!!! Thanks!!!
bothpro is offline  
Reply

Thread Tools

Similar Threads
[VB.NET]Use OPCODES
Hi all :D, Im a amateur in VB.NET, and I never programmed a tool for Silkroad except a Spammer. Today, I would like to introduce me to OpCode, in...
17 Replies
New OpCodes
Im looking for OpCodes in Perfect World MS Version to get the Code working. How to get them or any have the right ones ? Func AutoRun($x, $y,...
0 Replies
How to get the sro opcodes?
I would like to get the opcodes of silkroad but where can i get them in the ip packets or in the sro_client ? i already sniffed some stuff with...
5 Replies



All times are GMT +2. The time now is 18:33.


Powered by vBulletin®
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy
Copyright ©2015 elitepvpers All Rights Reserved.