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.
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 ;
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
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 = 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 = 0
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.MainWindowHandle, SW_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.MainWindowHandle, SW_RESTORE)
If i do it in this way ;
PHP Code:
Dim hwnd As IntPtr = FindWindow(Nothing,"SRO_client") ShowWindow(hwnd, SW_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?
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..
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^^
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 )
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:
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:
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(IP, Porta) 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(4, 4) OpCode = OpCode.Substring(2, 2) & OpCode.Substring(0, 2)
//Data Dim PacketData As String = sData.Substring(12, size)
//Security Dim Security As String = sData.Substring(8, 2)
If Security = "01" Then Security = "C->J" Else Security = "J->C" End If
Dim PacketInfo As String = String.Format("[{0}]({1}){2}", Security, OpCode, PacketData)
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.AsyncState, SocketPacket) Dim size As Integer = SockId.winSock2.EndReceive(asyn)
Form1.Received(SockId.dataBuffer, size)
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.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim SockP As New SocketPacket()
(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..