|
You last visited: Today at 09:46
Advertisement
[C#] Questions about sro_client
Discussion on [C#] Questions about sro_client within the SRO Coding Corner forum part of the Silkroad Online category.
12/26/2011, 19:06
|
#1
|
elite*gold: 0
Join Date: Nov 2011
Posts: 67
Received Thanks: 3
|
[C#] Questions about sro_client
Hello guys, as i learned some JAVA and C# now i decided to do some stuff for silkroad, just for fun..
My questions are, how i can attach my program to silkroad client, for example, im doing a simple autoclicker i want to attach it to client and allow him to press keys ONLY in silkroad window, that means i can minimize silkroad window and program wont be pressing keys in windows, just in silkroad window..
I started to code that and i have a little problem with sro_Client..
Code:
Process[] procs = Process.GetProcessesByName("sro_client");
foreach (Process p in procs)
{
IntPtr pFoundWindow = p.MainWindowHandle;
p.CloseMainWindow();
}
}
This should close my window, but it does not.. Same as
Code:
SendKeys.Send("{ENTER}")
doesn't send any information to silkroad client
|
|
|
12/28/2011, 17:06
|
#2
|
elite*gold: 0
Join Date: Nov 2011
Posts: 67
Received Thanks: 3
|
Guys, can you answer a simple question? How to integrate with silkroad client by C# program?
|
|
|
12/28/2011, 17:09
|
#3
|
elite*gold: 0
Join Date: Feb 2009
Posts: 1,064
Received Thanks: 539
|
did you try it with rsro or isro?
because you know, isro has hackshield
|
|
|
12/28/2011, 18:09
|
#4
|
elite*gold: 0
Join Date: Nov 2011
Posts: 67
Received Thanks: 3
|
Yep i know it has, i tried it with PlaySro client - means Vsro client.. Probably ill need to do this by packets as i guess?..
Code:
const UInt32 WM_KEYDOWN = 0x0100;
const int VK_RETURN = 0x0D;
const int jeden = 0x44;
[DllImport("user32.dll")]
static extern bool PostMessage(IntPtr hWnd, UInt32 Msg, int wParam, int lParam);
public void writing()
{
Process[] processes = Process.GetProcessesByName("sro_client");
foreach (Process proc in processes)
{
PostMessage(proc.MainWindowHandle, WM_KEYDOWN, jeden, 0);
PostMessage(proc.MainWindowHandle, WM_KEYDOWN, VK_RETURN, 0);
}
}
It's a simple code, should add a number 1 and press enter.. (It works in **** such as Tibia - without any hackshields etc.)..
|
|
|
12/29/2011, 09:38
|
#5
|
elite*gold: 0
Join Date: Dec 2007
Posts: 2,400
Received Thanks: 1,517
|
Are you sure PlaySRO doesn't use XTrap? That might cause problems too.
|
|
|
12/29/2011, 11:24
|
#6
|
elite*gold: 0
Join Date: Feb 2009
Posts: 1,064
Received Thanks: 539
|
Just try it at rsro
|
|
|
12/29/2011, 11:58
|
#7
|
elite*gold: 0
Join Date: Nov 2011
Posts: 67
Received Thanks: 3
|
Quote:
Originally Posted by lesderid
Are you sure PlaySRO doesn't use XTrap? That might cause problems too.
|
Well im not sure.. They may use XTrap.. Ok since they are secured, is there any way to break that? i mean, many bots are working on those versions, even if they are secured.. Im wondering how? Packets?
|
|
|
12/30/2011, 00:25
|
#8
|
elite*gold: 0
Join Date: Jan 2010
Posts: 1,484
Received Thanks: 809
|
Most of the bots work with packets so if you do it right xtrap won´t notice it. But if you try to mess with the memory xtrap can detect it. I´m not sure what works and what doesn´t if xtrap is enabled since I´m a not newb at the game hacking thing.
|
|
|
12/30/2011, 00:36
|
#9
|
elite*gold: 0
Join Date: Nov 2011
Posts: 67
Received Thanks: 3
|
Well im sure that's the security of client.. Im totally newbie in packets etc.. Seems that i need to start learning that  .. Now making a simple Autoclicker with a simple fuctions seems to be more complicated ever  ..
|
|
|
12/30/2011, 08:25
|
#10
|
elite*gold: 0
Join Date: Sep 2007
Posts: 255
Received Thanks: 531
|
You have to use sro_client's "Edit" handle, eg:
Code:
HWND mainHwnd = FindWindowA(0, "SRO_Client");
HWND childHwnd = FindWindowExA(mainHwnd, 0, "Edit", 0);
PostMessage(childHwnd, WM_KEYDOWN, VK_RETURN, 0);
|
|
|
12/30/2011, 23:03
|
#11
|
elite*gold: 0
Join Date: Nov 2011
Posts: 67
Received Thanks: 3
|
Code:
const UInt32 WM_KEYDOWN = 0x0100;
const int VK_RETURN = 0x0D;
const int VK_F8 = 0x77;
const int VK_F9 = 0x78;
const int A = 0x41;
[DllImport("user32.dll")]
static extern bool PostMessage(IntPtr hWnd, UInt32 Msg, int wParam, int lParam);
[DllImport("USER32.DLL", CharSet = CharSet.Unicode)]
public static extern IntPtr FindWindow(string lpClassName,
string lpWindowName);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern IntPtr FindWindowEx(IntPtr hwNd, IntPtr chhwNd, string lclassName, string windowTitle);
static void Main(string[ ] args) {
try {
IntPtr mainWindow = FindWindow(null, "SRO_Client");
if (mainWindow == IntPtr.Zero)
{
Console.WriteLine("Nie znaleziono okna silkroad'a");
return;
}
IntPtr childWindow = FindWindowEx(mainWindow, IntPtr.Zero ,"Edit", null);
PostMessage(childWindow, WM_KEYDOWN, VK_RETURN, 0);
PostMessage(mainWindow, WM_KEYDOWN, VK_F8, 0);
PostMessage(childWindow, WM_KEYDOWN, VK_F9, 0);
PostMessage(childWindow, WM_KEYDOWN, A, 0);
PostMessage(mainWindow, WM_KEYDOWN, A, 0);
} catch
{
Console.WriteLine("Nie dziala");
}
}
}
}
I wrote that kind of code, probably wrong, but u can make corrects, anyway.. Code is sending informations to MainWindow, but it seems to do not send or even find childWindow..
|
|
|
01/06/2012, 18:16
|
#12
|
elite*gold: 0
Join Date: Dec 2007
Posts: 2,400
Received Thanks: 1,517
|
Quote:
Originally Posted by jremy
You have to use sro_client's "Edit" handle, eg:
Code:
HWND mainHwnd = FindWindowA(0, "SRO_Client");
HWND childHwnd = FindWindowExA(mainHwnd, 0, "Edit", 0);
PostMessage(childHwnd, WM_KEYDOWN, VK_RETURN, 0);
|
That's not true as long as the control has focus.
|
|
|
All times are GMT +1. The time now is 09:47.
|
|