publicidade
publicidade
publicidade
publicidade
publicidade
publicidade
publicidade

Codigo injetor delphi 7

Eaew galera aki e o Andre lima e vim postar o codigo do injetor delphi 7 pra voce criar o injetor ok
unit Unit1;


interface


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


type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Edit2: TEdit;
    Button1: TButton;
    OpenDialog1: TOpenDialog;
    Timer1: TTimer;
    Button2: TButton;
    Label1: TLabel;
    Label2: TLabel;
    Image1: Timage;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;


var
  Form1: TForm1;


implementation


{$R *.dfm}


function GetPID(ProcessName: string): DWORD;
var MyHandle: THandle;
    Struct: TProcessEntry32;
begin
 Result:=0;
 try
  MyHandle:=CreateToolHelp32SnapShot(TH32CS_SNAPPROCESS, 0);
  Struct.dwSize:=Sizeof(TProcessEntry32);
  if Process32First(MyHandle, Struct) then
   if Struct.szExeFile=ProcessName then
    begin
     Result:=Struct.th32ProcessID;
     Exit;
    end;
  while Process32Next(MyHandle, Struct) do
   if Struct.szExeFile=ProcessName then
    begin
     Result:=Struct.th32ProcessID;
     Exit;
    end;
 except on exception do
  Exit;
 end;
end;


function InjectDll(PID:DWORD; sDll:string):Boolean;
var
hLib:     Pointer;
hThread:  THandle;
pMod:     Pointer;
hOpen:    THandle;
dWritten: Cardinal;
ThreadID: Cardinal;
begin
  Result := FALSE;
  hOpen := OpenProcess(PROCESS_ALL_ACCESS, FALSE, PID);
  if hOpen <> INVALID_HANDLE_VALUE then
  begin
    hLib := GetProcAddress(GetModuleHandle(PChar('kernel32.dll')), PChar('LoadLibraryA'));
    pMod := VirtualAllocEx(hOpen, nil, Length(sDll) + 1, MEM_COMMIT or MEM_RESERVE, PAGE_EXECUTE_READWRITE);
    if WriteProcessMemory(hOpen, pMod, @sDll[1], Length(sDll), dWritten) then
      Result := TRUE;
    hThread := CreateRemoteThread(hOpen, nil, 0, hLib, pMod, 0, ThreadID);
    WaitForSingleObject(hThread, INFINITE);
    CloseHandle(hOpen);
    CloseHandle(hThread);
  end;
end;


procedure TForm1.Button1Click(Sender: TObject);
begin
 if not OpenDialog1.Execute then Exit;
 Edit2.Text:=OpenDialog1.FileName;
end;


procedure TForm1.Button2Click(Sender: TObject);
begin
 Timer1.Enabled:=True;
end;


procedure TForm1.Timer1Timer(Sender: TObject);
var PID: DWORD;
begin
 Timer1.Enabled:=False;
 PID:=GetPID(Edit1.Text);
 if PID=0 then
  begin
   Timer1.Enabled:=True;
   Exit;
  end;
 Timer1.Enabled:=False;
 if InjectDll(PID, Edit2.Text) then
  MessageBoxA(Handle, 'DLL injetada com sucesso!', 'DLL Injector', MB_ICONEXCLAMATION+MB_SYSTEMMODAL)
 else
  MessageBoxA(Handle, 'Erro ao injetar DLL.', 'DLL Injector', MB_ICONERROR+MB_SYSTEMMODAL);
end;


end.
Na hora de colar o Codigo apague o codigo do Form.1 E cole o codigo do injetor
ok




Oque precisa no injetor
3 labels
BYPESSOA
PROCESSO
DLL
2 buttons
Aguarda Processo
Procura dll

Comentário:
1 comentário
Categorias:

1 comentários:

Unknown disse...

V c não colocou a lista de objetos tipo assim 1 Button 1 Edit. Por Favor Coloca

Postar um comentário