A problem

delphi package - getting into other processes

A problem

Postby huolong » Sun Nov 13, 2005 8:08 am

I'm so weak in English that I don't know if I'll make mistakes when I describe the problem.I hope you can understand what I mean..

That's my program
------------------------------

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, MadRemote;


var
Sinfo:TStartupInfo;
Pinfo:TProcessInformation;
Form1: TForm1;
ID,THandle:integer;

procedure Inject(ProcessHandle: longword; EntryPoint: pointer);
var
RemoteEntryPoint:Pointer;
tid : dword;
begin
RemoteEntryPoint:=CopyFunction(EntryPoint, ProcessHandle);
CreateRemoteThreadEx(processHandle, nil, 0, RemoteEntryPoint, nil, 0, tid);
CloseHandle(processHandle);
end;


function TheRemoteThread(dwEntryPoint: Pointer): longword; stdcall;
begin
MessageBox(0, 'Test!!!', 'Huolong Test..', 0);
ExitProcess(0);
Result := 0;
end;


begin
// SInfo.dwFlags:=STARTF_USESHOWWINDOW;
SInfo.wShowWindow:= SW_HIDE;
CreateProcess(
nil,'notepad.exe',nil, nil, False,
NORMAL_PRIORITY_CLASS, nil, nil,
SInfo, PInfo);
ID:=PInfo.dwProcessID;
THandle:= PInfo.hProcess;
Inject(THandle,@TheRemoteThread);
end.
--------------------
It can create a remotethread,
but MessageBox(0, 'Test!!!', 'Huolong Test..', 0);
just show a MessageBox with nothing in it.
It looks like MessageBox(0, ' ', ' ', 0);
WHY?
And how can I do?
huolong
 
Posts: 2
Joined: Sun Nov 13, 2005 7:52 am

Postby madshi » Mon Nov 14, 2005 4:19 pm

You'll find the answer here:

http://forum.madshi.net/viewtopic.php?t=826
madshi
Site Admin
 
Posts: 9339
Joined: Sun Mar 21, 2004 5:25 pm

Thank you

Postby huolong » Fri Nov 18, 2005 10:48 am

Thank you
huolong
 
Posts: 2
Joined: Sun Nov 13, 2005 7:52 am


Return to madRemote

Who is online

Users browsing this forum: No registered users and 1 guest