• Welcome to Valhalla Legends Archive.
 

process control

Started by LivedKrad, January 03, 2006, 10:52 PM

Previous topic - Next topic

LivedKrad

What I want to accomplish:

1. Locally execute another program. (ShellEx()?).
2. Input mouse clicks and movements into this program. (e.g.: get resolution and pixel dimensions of the remote program so as to precisely move the mouse where I want to and click), (no idea what API will allow this).
3. Monitor the network traffic of this program, specifically to see when certain messages are sent and/or received. (no idea how to do this either).
4. Send keyboard actions to this program.

It would seem to some that I have not researched this, I have. Maybe it would also seem that I have not tried to figure out how to do it, I have. Admittedly, I haven't done much delving into API, but I hope that someone here could help me.

Edit: As of reading a post, I saw something mentioned about Adron's "hooksocket". Would this be able to help me in my endeavour? I've never heard of it.

FrOzeN

#1
Quote from: LivedKrad.fe on January 03, 2006, 10:52 PM
1. Locally execute another program. (ShellEx()?).
Yes.
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Quote from: LivedKrad.fe on January 03, 2006, 10:52 PM
3. Monitor the network traffic of this program, specifically to see when certain messages are sent and/or received. (no idea how to do this either).
Look into Hooking onto the program, using SetWindowsHookEx and UnhookWindowsHookEx.
They'll probably be some other API's involved aswell.
Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" (ByVal idHook As Long, ByVal lpfn As Long, ByVal hmod As Long, ByVal dwThreadId As Long) As Long

Declare Function UnhookWindowsHookEx Lib "user32" Alias "UnhookWindowsHookEx" (ByVal hHook As Long) As Long


Quote from: LivedKrad.fe on January 03, 2006, 10:52 PM
4. Send keyboard actions to this program.
Assuming you have gained focus of that program you could probably use SendKeys().

Hope that helps a bit. :)

[EDIT] I just found this for Mouse Input. I was looking into it yesterday to no avail.
http://www.ftponline.com/archives/premier/mgznarch/VBPJ/1999/06jun99/ap0699.pdf
Maybe it will help with #2.
~ FrOzeN

Tazo

perhaps execute an autoit script for #2?

Eric

1, 2, & 4 can all be easily acheived through the use of API calls, however Winsock hooking is going to require a great deal of work.  The most common way that I know of (without the use of a third-party library) would be code injection.

MyndFyre

Quote from: Lord[nK] on January 06, 2006, 01:27 PM
1, 2, & 4 can all be easily acheived through the use of API calls, however Winsock hooking is going to require a great deal of work.  The most common way that I know of (without the use of a third-party library) would be code injection.

It might be easier to just write a network filter driver.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Joe[x86]

Quote3. Monitor the network traffic of this program, specifically to see when certain messages are sent and/or received. (no idea how to do this either).

I don't know much about DLL callback functions in Visual Basic, but if you can figure out how to use then, WinPcap is your best friend.
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.