execute procedure is foreign process

delphi package - getting into other processes
Post Reply
ssivagna
Posts: 3
Joined: Fri Jul 29, 2005 2:46 pm

execute procedure is foreign process

Post by ssivagna »

Hi!

I see examples on how to CreateRemoteThreadEx and then tell the remote thread to use function loadlibrary that lays in kernel32.dll (loaded inside process).

But there arent just LoadLibrary that lays in kernel32.dll.
There are alot of interesting stuff.

What I want to do is simple, I want to beep(1000,1000) from the remote process (kernel32.dll contains this function).

Many of you will tell me to make a dll witt Beep and then inject it. But I want the kernel32.dll inside any other process to do it.[/code]
neji
Posts: 155
Joined: Wed Mar 09, 2005 11:39 am
Contact:

Post by neji »

don't know if this really helps you, but have a look at madkernels iprocess.ExecuteFunction
ssivagna
Posts: 3
Joined: Fri Jul 29, 2005 2:46 pm

Post by ssivagna »

Okey.. i just read through my post again. It might be abit unclear.

What I want to do is:
Tell a foreign process to beep(1000,1000);
Beep function is included in kernel32.dll, which is included in all processes.

Note: I don't want a dll injection here :D.

NEJI, I will take a look at it when I get home from training. :D
nildo
Posts: 249
Joined: Mon Mar 22, 2004 11:32 am
Contact:

Post by nildo »

ssivagna wrote:Okey.. i just read through my post again. It might be abit unclear.

What I want to do is:
Tell a foreign process to beep(1000,1000);
Beep function is included in kernel32.dll, which is included in all processes.

Note: I don't want a dll injection here :D.

NEJI, I will take a look at it when I get home from training. :D
iprocess.ExecuteFunction doesn't need DLL injection and works just fine
madshi
Site Admin
Posts: 10749
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Yeah, both madKernel's "IProcess.ExecuteFunction" and madRemote's "RemoteExecute" would do the trick.
ssivagna
Posts: 3
Joined: Fri Jul 29, 2005 2:46 pm

doesnt work

Post by ssivagna »

:cry:

how come this doesnt work

Code: Select all

procedure ShowMessageBox();

begin
LoadLibrary('E:\jeroen\Delphi\IPROCESS\dllfile.dll');
END;



procedure TForm1.Button1Click(Sender: TObject);
begin
Process('notepad.exe').ExecuteFunction(ShowMessageBox, INFINITE, nil, 5);
end;
madshi
Site Admin
Posts: 10749
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

You may not use string constants in the function you want to have executed in the other process.

But if you want to inject a dll into another process, why don't you simply use madCodeHook's InjectLibrary API?
neji
Posts: 155
Joined: Wed Mar 09, 2005 11:39 am
Contact:

Post by neji »

madshi wrote:But if you want to inject a dll into another process, why don't you simply use madCodeHook's InjectLibrary API?
or IProcess.LoadModule, wouldn't it also do the trick?
madshi
Site Admin
Posts: 10749
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Yep.
Post Reply