| View previous topic :: View next topic |
| Author |
Message |
slippppppppp Grandmaster Cheater
Reputation: 0
Joined: 08 Aug 2006 Posts: 929
|
Posted: Sun Nov 04, 2007 1:28 pm Post subject: Delphi Dll Injection |
|
|
I tried translating C++ to delph and came up wtih this.
I get an access violation but i know im close, can anyone read my source and tell me what im doing wrong? POR FAVOR
|
|
| Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Sun Nov 04, 2007 1:46 pm Post subject: |
|
|
It looks like you are are sending an uninitialized pointer into the function.
| Source wrote: | procedure TForm1.SpeedButton2Click(Sender: TObject);
var lpprocess : string;
dwpid : DWORD;
lpdll : LPSTR;
TempSnapshot:THandle;
Process32:TProcessEntry32;
begin
lpprocess := edit1.text;
if Process32.szExeFile = lpprocess then
begin dwPID:=Process32.th32ProcessID;
end;
Injectdll(dwPID, lpdll, 0 );
end; |
I don't use Delphi often, so I could be wrong, but i will give you advice on something else also:
| Source wrote: | | InjectDll(dwPid, lpDll, nLength); |
nLength is the length of the buffer that stores the path of the dll, in your source you are passing 0, which is bad.
Oh, and I thought I would point out you are translating from C to Delphi (it is blatantly obvious you are translating my source ). As far as I can tell, it doesn't look like you are doing so well.
|
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
|
| Back to top |
|
 |
|