A Question About PHConnector

05/23/2012 16:10 tarekwiz#1
I Have Coded A Very Very Simple Program That when you Press A Button It Stands/sit But I wanted To Test it and i didn't know how to connect it to silkroad through PHConnector Here's My Code
PHP Code:
Imports System.Net.Sockets
Imports System
.Text

Public Class Form1
    
Public Client As Socket = New Socket(AddressFamily.InterNetworkSocketType.StreamProtocolType.Tcp)
    
Dim clientSocket As New System.Net.Sockets.TcpClient()
    Private 
Sub Button1_Click(ByVal sender As System.ObjectByVal e As System.EventArgsHandles Button1.Click
        
Try
            
Client.Connect("localhost"15778)
        Catch 
ex As Exception
            MsgBox
("You Didnt Start PHConnecter")
            
Label1.Text "Not Connected"
            
Label1.ForeColor Color.Red

        End 
Try

        If 
Client.Connected True Then
            Label1
.Text "Connected"
            
Label1.ForeColor Color.Green
            Button1
.Enabled False

        End 
If
    
End Sub


    
Public Sub SendPacket(ByVal OpCode As StringByVal sData As StringByVal Enc As Boolean)
        
Using buffer As New IO.MemoryStream
            Using w 
As New IO.BinaryWriter(buffer)
                
w.Write(CUShort(0)) ' Size is 0 because it 'cannot' be known yet.
                w.Write(CUShort("&H" + OpCode)) ' 
Converts the string Opcode to a UInt16reading the Opcode as a hexadecimal representation
                
If Enc True Then
                    w
.Write(CUShort(3)) ' Encryption flag phConnector
                Else
                    w.Write(CUShort(1)) ' 
No-encryption flag phConnector
                End 
If
                For 
0 To sData.Length ' Each byte is two characters and starting from 0 so decreasing by 1
                    w.Write(CByte("&H" & sData.Substring(n * 2, 2))) ' 
Writes every byte
                Next

                w
.BaseStream.Position ' Resets the position to write the size
                w.Write(CUShort(w.BaseStream.Length - 6)) ' 
Writes the size to the '0' placeholder
                w
.Flush() ' Makes sure the data is written to the buffer
                Client.Send(buffer.ToArray) ' 
Sends the buffer to the Socket
            End Using
        End Using
    End Sub

    
Private Sub Button2_Click(ByVal sender As System.ObjectByVal e As System.EventArgsHandles Button2.Click
        SendPacket
("704F""04"False)
     
    
End Sub


    End 
Class 
And Here is my PHconnector's Ini File
PHP Code:
[phConnector]
IP=121.128.133.30
Port
=15778
LoginListenPort
=15778
WorldListenPort
=15777
BotPort
=22580
ServerBlock
=
ClientBlock=
Dev=
Thanks For Your Time

Solved But I Used Ibot's Hackshield But I Need To Know How do i redirect the Client To My Bot?? So I Can Send It Directly Or I Need The PhConnector's Source Code So I Can Find How

Solved But I Used Ibot's Hackshield But I Need To Know How do i redirect the Client To My Bot?? So I Can Send It Directly Or I Need The PhConnector's Source Code So I Can Find How

Please Close I Used NUCONNECTOR and Worked Perfectly
Now I Need To Find Out Movement Packets And How To Sendthem From VB>NET but Ill Search And if you know how Please Post How
Thanks
08/06/2012 10:53 zakrialom#2
please can u give me PH link ?