is there any way to close a handle of another process?

delphi package - easy access to kernel objects etc.
Post Reply
nildo
Posts: 249
Joined: Mon Mar 22, 2004 11:32 am
Contact:

is there any way to close a handle of another process?

Post by nildo »

Hello again Mathias!
Does MadKernel let me close a handle of another process, or may I have to inject some code into that process for using a CloseHandle into that Handle? What do I have to do?

Thank you!
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

This is not directly supported by madKernel, although the functionality is used internally.

You can use RemoteExecute for this purpose, though. It's *very* easy to do this way. Type RemoteExecute into your Delphi editor and press F1.
nildo
Posts: 249
Joined: Mon Mar 22, 2004 11:32 am
Contact:

Post by nildo »

Great!
Just one thing, your demo program on MadRemote does not use Parameters... The demo demonstrates how to execute GetCommandLine that does not uses parameters. YOu could write one demonstrating how to use the parameters, something like "How to execute MessageBox in the context of another process". What do you think?
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

The GetCommandLine demo *does* use a parameter (namely the buffer for the command line), but just one and it's not copied back/forth by RemoteExecute. It would make sense to add another demo which uses multiple parameters which are copied to the target process. But for your purpose (killing a remote handle) you can directly use/change the GetCommandLine demo.
nildo
Posts: 249
Joined: Mon Mar 22, 2004 11:32 am
Contact:

Post by nildo »

madshi wrote:The GetCommandLine demo *does* use a parameter (namely the buffer for the command line), but just one and it's not copied back/forth by RemoteExecute. It would make sense to add another demo which uses multiple parameters which are copied to the target process. But for your purpose (killing a remote handle) you can directly use/change the GetCommandLine demo.
Thank you!
Post Reply