Einzelnen Beitrag anzeigen

Benutzerbild von Uncle Cracker
Uncle Cracker

Registriert seit: 30. Mär 2003
Ort: Freital
694 Beiträge
 
#16

Re: Wie kann man einen Loader programmierern?

  Alt 30. Nov 2003, 16:08
Danke Christian, deine Methode funktioniert doch, hab's Sie nur am Anfang nicht verstanden. Sieht jetzt so aus:

Delphi-Quellcode:
program loader;

uses
  Windows, Messages;

var
  si : Startupinfo;
  pi : Process_Information;
  Bytesread : DWORD;
  Olddata : array[0..1] of byte;
  sBuffer : string;
  

begin
  sBuffer := #$90#$90;
  IF CreateProcess(nil,'Example.exe',nil,nil,FALSE,
           Create_Suspended,nil,nil,si,pi) = true then

  begin
    ReadProcessMemory(pi.hprocess,Pointer($403CEA),@olddata,2,bytesread);
    if (olddata[0] = $75) and (olddata[1] = $19) then
    begin
      WriteProcessMemory(pi.hProcess, Pointer($403CEA), @sBuffer[1], 2, bytesread);
      ResumeThread(pi.hThread);
      CloseHandle(pi.hProcess);
      CloseHandle(PI.hThread);
    end else
    begin
      Messagebox(0,pchar('Bytes not found! Wrong version?...'),pchar('Error'),mb_iconinformation);
      TerminateProcess(PI.hProcess,0);
      CloseHandle(PI.hProcess);
      CloseHandle(PI.hThread);
    end;
  end;


end.

Man könnte das Olddata auch noch in einen String umwandeln, doch dazu habe ich keine Lust
I wish it was legal to marry software because I'm madly in love with Delphi...
  Mit Zitat antworten Zitat