Page 1 of 1

execute procedure is foreign process

Posted: Fri Jul 29, 2005 2:51 pm
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]

Posted: Fri Jul 29, 2005 2:57 pm
by neji
don't know if this really helps you, but have a look at madkernels iprocess.ExecuteFunction

Posted: Fri Jul 29, 2005 3:12 pm
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

Posted: Mon Aug 08, 2005 5:22 pm
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

Posted: Tue Aug 09, 2005 8:10 am
by madshi
Yeah, both madKernel's "IProcess.ExecuteFunction" and madRemote's "RemoteExecute" would do the trick.

doesnt work

Posted: Thu Aug 11, 2005 12:13 am
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;

Posted: Thu Aug 11, 2005 6:09 am
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?

Posted: Thu Aug 11, 2005 7:01 am
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?

Posted: Thu Aug 11, 2005 7:10 am
by madshi
Yep.