Page 1 of 1

A problem

Posted: Sun Nov 13, 2005 8:08 am
by huolong
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?

Posted: Mon Nov 14, 2005 4:19 pm
by madshi
You'll find the answer here:

viewtopic.php?t=826

Thank you

Posted: Fri Nov 18, 2005 10:48 am
by huolong
Thank you