Not a member yet? Register for your free account!


Go Back   elitepvpers > Silkroad Online > SRO Coding Corner
You last visited: Today at 12:47

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

 

[Autoit]using opcodes

This is a discussion on [Autoit]using opcodes within the SRO Coding Corner forum part of the Silkroad Online category; I don't know how to send packet like this I copied some codes from "acer2000" but i don't know how ...

Reply
 
Thread Tools
Old   #1
Senior Member
 
Join Date: Jul 2008
Posts: 99
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
bothpro (03-06-2012)
Old 03-06-2012, 15:02   #2
Senior Member
 
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")

Last edited by jremy; 03-06-2012 at 15:19.
jremy is offline  
Thanks
2 Users
bothpro (03-06-2012), kondos (03-06-2012)
Old 03-06-2012, 18:40   #3
Junior Member
 
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

Last edited by bothpro; 03-07-2012 at 01:32.
bothpro is offline  
Old 03-06-2012, 23:03   #4
Senior Member
 
Join Date: Jul 2008
Posts: 99
Received Thanks: 8
thx jremy
kondos is offline  
Old 03-08-2012, 19:24   #5
Junior Member
 
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:
[Guide] Using edxSilkroadProxy to Create a Simple AutoIt Clientless
Just use phConnector instead of edxsilkroadproxy
srutownik is offline  
Thanks
1 User
bothpro (03-09-2012)
Old 03-10-2012, 01:20   #6
Junior Member
 
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 03-10-2012, 23:15   #7
Senior Member
 
Join Date: Jul 2008
Posts: 99
Received Thanks: 8
@jremy
when i send packet
Quote:
SendPacket("704F", "04")
i got dc why !?!?
kondos is offline  
Old 03-10-2012, 23:58   #8
Junior Member
 
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
bothpro (03-11-2012), kondos (03-11-2012), Miserable (03-13-2013)
Old 03-11-2012, 01:04   #9
Senior Member
 
Join Date: Jul 2008
Posts: 99
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 03-11-2012, 01:31   #10
Junior Member
 
Join Date: Aug 2011
Posts: 10
Received Thanks: 0
Yes itīs work !!!! Thanks!!!
bothpro is offline  
Reply

Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
[VB.NET]Use OPCODES lordfeling SRO Coding Corner 17 04-06-2012 18:01
New OpCodes amineurin Perfect World 0 05-20-2010 16:40
How to get the sro opcodes? kevin_owner SRO Main - Discussions / Questions 5 01-19-2010 13:57



All times are GMT +1. The time now is 12:47.


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