Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 06:08

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

Advertisement



How to send a packet taken from WPE PRO with Winsock control vb2010

Discussion on How to send a packet taken from WPE PRO with Winsock control vb2010 within the .NET Languages forum part of the Coders Den category.

Reply
 
Old 04/23/2011, 13:20   #46

 
sarkoplata's Avatar
 
elite*gold: 166
Join Date: Apr 2009
Posts: 2,339
Received Thanks: 2,661
Quote:
Originally Posted by xKraizy View Post
Would be nice if we could see the code you are using...
PHP Code:
Dim process As System.Diagnostics.Process Nothing
        Dim processStartInfo 
As System.Diagnostics.ProcessStartInfo
        processStartInfo 
= New System.Diagnostics.ProcessStartInfo()
        
processStartInfo.WindowStyle ProcessWindowStyle.Normal
        processStartInfo
.FileName pathway1.Text
        processStartInfo
.Verb "runas"
        
processStartInfo.Arguments ""
        
processStartInfo.WindowStyle System.Diagnostics.ProcessWindowStyle.Normal
        processStartInfo
.UseShellExecute True
        process 
System.Diagnostics.Process.Start(processStartInfo
Pathway1.text=The place where loader is
Btw i tried arguments as /18 too but nothing changed ^^

/I made curdir& "\private_server_loader.exe" works fine.
sarkoplata is offline  
Old 04/26/2011, 01:45   #47

 
sarkoplata's Avatar
 
elite*gold: 166
Join Date: Apr 2009
Posts: 2,339
Received Thanks: 2,661
I'm here with very different question today.
I want to add all sro_clients to my listview with their process id's.
before I posted here , I thought a lot but no solutions.
My whole code ;
PHP Code:
 Dim label As New Label
        label
.Text "0"
        
Me.Controls.Add(label)
        
Lw1.Items.Clear()
        
Dim orx() As Process Process.GetProcessesByName("SRO_Client")
        For 
Each ox As Process In orx
            label
.Text label.Text 1
        Next

        
For Each o As Process In orx
            
If o.ProcessName "SRO_Client" Then
                Lw1
.Items.Add(o.ProcessName)
                
Lw1.Items(0).SubItems.Add(o.Id.ToString)
            
End If
        
Next 
Label.text = how many sro_clients are working atm
Lw1 = Listview
What I need to do is :
For first client ,do this ;
PHP Code:
 Lw1.Items.Add(o.ProcessName)
                
Lw1.Items(0).SubItems.Add(o.Id.ToString
For second client ,do this ;
PHP Code:
 Lw1.Items.Add(o.ProcessName)
                
Lw1.Items(1).SubItems.Add(o.Id.ToString
For third client ,do this ;
PHP Code:
 Lw1.Items.Add(o.ProcessName)
                
Lw1.Items(2).SubItems.Add(o.Id.ToString
So they all will be added successfully...
Hope you solve it
sarkoplata is offline  
Old 04/26/2011, 13:54   #48
 
Kraizy​'s Avatar
 
elite*gold: 0
The Black Market: 471/0/0
Join Date: Apr 2010
Posts: 9,696
Received Thanks: 1,811
I didn't understand your whole post..did you already got it?
If not:
PHP Code:
Dim counter As Integer 0
For Each proc As Process In Process.GetProcessesByName("SRO_Client")
     
ListView1.Items.Add(proc.ProcessName).SubItems.Add(proc.Id)
     
counter += 1
Next
Label1
.Text counter
//or
Label1.Text ListView1.Items.Count 
Kraizy​ is offline  
Old 04/26/2011, 14:50   #49

 
sarkoplata's Avatar
 
elite*gold: 166
Join Date: Apr 2009
Posts: 2,339
Received Thanks: 2,661
Quote:
Originally Posted by xKraizy View Post
I didn't understand your whole post..did you already got it?
If not:
PHP Code:
Dim counter As Integer 0
For Each proc As Process In Process.GetProcessesByName("SRO_Client")
     
ListView1.Items.Add(proc.ProcessName).SubItems.Add(proc.Id)
     
counter += 1
Next
Label1
.Text counter
//or
Label1.Text ListView1.Items.Count 
Yea already fixed it , in this way ;
PHP Code:
Dim orx()  as process process.getprocessesbyname("sro_client")
Dim PIN(2) as string

Lw1
.Items.Clear()

        
Dim itm As ListViewItem
        
For Each o As Process In orx
            i 
1
            PIN
(0) = i
            PIN
(1) = o.MainWindowTitle.ToString
            PIN
(2) = o.Id.ToString
            itm 
= New ListViewItem(PIN)
            
Lw1.Items.Add(itm)
        
Next
        i 

Now another problem ... It should work but don't know why.. Something Silly...
Here is the code for hiding a process with process id ... Works 100%
( NOTE : { Lw1.SelectedItems(0).SubItems.Item(2).Text.ToStrin g } is the PID of selected process )
PHP Code:
 Dim a As Process Process.GetProcessById(Lw1.SelectedItems(0).SubItems.Item(2).Text.ToString)
        
ShowWindow(a.MainWindowHandleSW_HIDE
And here is the code for restoring it with process id .. Idk why but doesn't work :
PHP Code:
 Dim a As Process Process.GetProcessById(Lw1.SelectedItems(0).SubItems.Item(2).Text.ToString)
        
ShowWindow(a.MainWindowHandleSW_RESTORE
If i do it in this way ;
PHP Code:
 Dim hwnd As IntPtr FindWindow(Nothing,"SRO_client")
        
ShowWindow(hwndSW_RESTORE
It works.. But I want to do it with PID so..


#EDIT : I saw why it doesn't restore it.When process is hidden ,
PHP Code:
Dim procList As Process Process.GetProcessById(Lw1.SelectedItems(0).SubItems.Item(2).Text)
        
Dim hwnd As Integer
        hwnd 
procList.MainWindowHandle
/// Hwnd keeps returning 0 when process is hidden.. And when process is hidden , when I press refresh , On listview p.name value gives me nothing.. Any idea? 
sarkoplata is offline  
Old 04/26/2011, 16:47   #50
 
Kraizy​'s Avatar
 
elite*gold: 0
The Black Market: 471/0/0
Join Date: Apr 2010
Posts: 9,696
Received Thanks: 1,811
I think you can't find the handle if you already hid it..
And I can't understand all your text^^
Here a little example maybe it will help you..

Edit: Well, tried to hide 2-3 process and after that there are problems with restoring them again (just works if you hide one process, show it again, and hide the next one)..will try to find a solution to hide all and show them again..
Attached Files
File Type: rar HideShowProcess.rar (138.0 KB, 40 views)
Kraizy​ is offline  
Old 04/26/2011, 19:36   #51

 
sarkoplata's Avatar
 
elite*gold: 166
Join Date: Apr 2009
Posts: 2,339
Received Thanks: 2,661
Thank you for your source but I already know them and applied in my tool,
So you think getting handle of an hidden process is impossible :/
Maybe before hiding them we can keep their handles? Is it works ?

BTW : What about the client name ? When I hide and refresh it , Can't see the client name anymore :/
EDIT : Yep Worked. Saved their handles before , and if it's 0 , it won't refresh it. One more success^^
sarkoplata is offline  
Old 05/18/2011, 21:39   #52

 
sarkoplata's Avatar
 
elite*gold: 166
Join Date: Apr 2009
Posts: 2,339
Received Thanks: 2,661
Me again
In the time past , I made many little tools.
Now I want to make a server-stat-shower.
It will show:
Current Players:
Max Players:
Server Name:
-
How to do that? (I guess system.net.sockets for it , but how :P )
sarkoplata is offline  
Old 05/19/2011, 14:37   #53
 
Kraizy​'s Avatar
 
elite*gold: 0
The Black Market: 471/0/0
Join Date: Apr 2010
Posts: 9,696
Received Thanks: 1,811
You need to analyse the Loginpacket (A101). I saved some packets some weeks ago, there was also the A101 one, here my result:
Code:
01							NameServer Start
01							Nameserver ID						
10-00							NameServer Name Length (16)
53-52-4F-5F-43-68-69-6E-61-5F-54-65-73-74-49-6E		NameServer Name (SRO_China_TestIn)
00							NameServer End
01							GameServer Start
01-00							GameServer ID
0A-00							GameServer Name Length (10)
5A-53-5A-43-28-46-69-72-65-29				Gameserver Name (ZSZC(Fire))
53-02							Current User (595)
D0-07							Max User (2000)
01							don't know
01							Status (00=Check, 01=Online)
00							GameServer End
To convert it u can use the BitConverter..little example:
Code:
MsgBox(BitConverter.ToInt16(New Byte() {&HD0, &H7}, 0))
//Result: 2000 (MaxUser)
Also take a look at
Kraizy​ is offline  
Thanks
1 User
Old 06/03/2011, 01:17   #54

 
sarkoplata's Avatar
 
elite*gold: 166
Join Date: Apr 2009
Posts: 2,339
Received Thanks: 2,661
Quote:
Originally Posted by xKraizy View Post
You need to analyse the Loginpacket (A101). I saved some packets some weeks ago, there was also the A101 one, here my result:
Code:
01							NameServer Start
01							Nameserver ID						
10-00							NameServer Name Length (16)
53-52-4F-5F-43-68-69-6E-61-5F-54-65-73-74-49-6E		NameServer Name (SRO_China_TestIn)
00							NameServer End
01							GameServer Start
01-00							GameServer ID
0A-00							GameServer Name Length (10)
5A-53-5A-43-28-46-69-72-65-29				Gameserver Name (ZSZC(Fire))
53-02							Current User (595)
D0-07							Max User (2000)
01							don't know
01							Status (00=Check, 01=Online)
00							GameServer End
To convert it u can use the BitConverter..little example:
Code:
MsgBox(BitConverter.ToInt16(New Byte() {&HD0, &H7}, 0))
//Result: 2000 (MaxUser)
Also take a look at
Thanks but this net.sockets makes me crazy. It wouldnt take me more than 5minutes with winsock..
Converted from C# .. lastest codes:
PHP Code:
//Sucessfully connecting loginserver..
  
Dim IP As IPAddress IPAddress.Parse("31.192.104.161")
        
Dim Porta As Integer 15779
        Dim IPEP 
As IPEndPoint = New IPEndPoint(IPPorta)
        
Socket.Connect(IPEP)

// This is ok ... but how do i use this func? how can i  call this method when recevied a packet?
    
Friend Sub Received(ByVal buffer As Byte(), ByVal size As Integer)
        
Dim sData As String BitConverter.ToString(buffer)
        
sData sData.Replace("-""")

        
//OpCode 
        
Dim OpCode As String sData.Substring(44)
        
OpCode OpCode.Substring(22) & OpCode.Substring(02)

        
//Data
        
Dim PacketData As String sData.Substring(12size)

        
//Security
        
Dim Security As String sData.Substring(82)

        If 
Security "01" Then
            Security 
"C->J"
        
Else
            
Security "J->C"
        
End If

        
Dim PacketInfo As String String.Format("[{0}]({1}){2}"SecurityOpCodePacketData)

        
MsgBox(PacketInfo)
        
end sub

//Not sure what this is for O_O
Public Shared Sub OnDataReceived(ByVal asyn As IAsyncResult)
        Try
            
Dim SockId As SocketPacket DirectCast(asyn.AsyncStateSocketPacket)
            
Dim size As Integer SockId.winSock2.EndReceive(asyn)

            
Form1.Received(SockId.dataBuffersize)


        Catch 
ode As ObjectDisposedException
            MessageBox
.Show(ode.Message)
        Catch 
se As SocketException
            MessageBox
.Show(se.Message)
        
End Try
    
End Sub

//Easiest part. But still don't know how to read data which came from socket
Private Sub Button1_Click(ByVal sender As System.ObjectByVal e As System.EventArgsHandles Button1.Click
        Dim SockP 
As New SocketPacket()

        
Socket.BeginReceive(SockP.dataBuffer0SockP.dataBuffer.LengthSocketFlags.NonepfnCallBackSockP)

    
End Sub 
This thing , obviously killed my mind. Waiting for your helps , but please this time , a lil bit with more examples thanks again
sarkoplata is offline  
Reply


Similar Threads Similar Threads
(Winsock hook) replace/filter packet bytes
11/18/2010 - General Coding - 3 Replies
Hi guys Please, can someone explain me or help me about my winsock hook?! I need to change the first and second bytes of the packet I've received... example: I'm receiving the packet:
Play sound via Packet Send?? [Question String Packet]
07/14/2010 - CO2 Private Server - 5 Replies
Yow im trying to figure out why i cant play music with the string packet What im doin is; MyChar.Client.SendPacket(Game.Packet.String(MyCha r.UID, 20, Splitter)); My Packet is: public byte String(long CharId, byte Type, string name)
Control Send...
05/07/2010 - AutoIt - 7 Replies
Hi zusammen, ich möchte gerne bei meinem Script ControlSend benutzen und das läuft ja nach diesem: ControlSend ( "title", "text", controlID, "string" ) Schema ab. Jetzt stellt sich mir die Frage, was ich wenn ich das ans LC fenster schicken muss bei controlID eintragen muss kann mir da jemand vlt weiterhelfen? LG
Need Help about (Winsock Packet Editor (WPE) Pro 0.9a)
09/26/2009 - CO2 Programming - 18 Replies
Hey All I need help to know some thing about ( Winsock Packet Editor (WPE) Pro 0.9a in Network Monitors ) need to know.. How Can i open one Sv in different User account at One Pc How is it work..? Thankz any way i w8 Replies Plz don't avoid me
[VB6]Winsock Packet Sending Program & [C++] ws_32 Hook&DLL
06/07/2009 - C/C++ - 1 Replies
Hi.. im trying to create a program that send packet to the server.. someone told me to hook my program using the ws_32 hook and dll can someone give me or teach me how to do these codes? the client i need to attach to is "KhanClient.exe" i hope you can help me..



All times are GMT +1. The time now is 06:09.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.