Jump to content
YOUR-AD-HERE
HOSTING
TOOLS
SERVICE

Locked loadPE ( inject PE into a running process )


Diabl0

Recommended Posts

[HIDE-THANKS]Enables you to load an EXE (as a DLL) into a running process, while leaving the host process intact.(Credits To ChilliSource For Ideas)

 

Code:

program Project6;

 

{$APPTYPE CONSOLE}

 

uses

Windows;

 

Function PeToDll(lpFileName: LPCWSTR): Boolean;

var

Handle: THandle;

NULL : cardinal;

Offset: Int32;

Buffer: Word;

begin

Result := False;

Offset := 256 + Int32(@_IMAGE_NT_HEADERS(Nil^).FileHeader.Characteristics);

Handle := CreateFile(lpFileName, GENERIC_WRITE, 0, Nil, OPEN_EXISTING, 0, 0);

IF (Handle <> INVALID_HANDLE_VALUE) Then

Begin

SetFilePointer(Handle, Offset, Nil, FILE_BEGIN);

Result := ReadFile(Handle, Buffer, SizeOf(Buffer), NULL, Nil);

IF (Result = TRUE) Then

Begin

Buffer := (Buffer OR IMAGE_FILE_DLL);

Result := WriteFile(Handle, Buffer, SizeOf(Buffer), NULL, Nil);

End;

CloseHandle(Handle);

End;

end;

[/Quote][/HIDE-THANKS]

Edited by CrypterHacker
Add Hide Thanks
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.