AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Win32/Win64 API (native code) Delphi CreateProcess importieren / API Hooks umgehen
Thema durchsuchen
Ansicht
Themen-Optionen

CreateProcess importieren / API Hooks umgehen

Ein Thema von Zacherl · begonnen am 1. Mär 2007 · letzter Beitrag vom 1. Mär 2007
 
Benutzerbild von Zacherl
Zacherl

Registriert seit: 3. Sep 2004
4.629 Beiträge
 
Delphi 10.2 Tokyo Starter
 
#1

CreateProcess importieren / API Hooks umgehen

  Alt 1. Mär 2007, 14:59
Hi,

ich will die CreateProcess API dynamisch in mein Programm einbinden. Dazu verwende ich:

Delphi-Quellcode:
function CreateProcess(lpApplicationName: PChar; lpCommandLine: PChar;
  const lpProcessAttributes, lpThreadAttributes: PSecurityAttributes;
  bInheritHandles: BOOL; dwCreationFlags: DWORD; lpEnvironment: Pointer;
  lpCurrentDirectory: PChar; const lpStartupInfo: TStartupInfo;
  out lpProcessInformation: TProcessInformation): BOOL; stdcall;
var
  pCreateProcess: function(lpApplicationName: PChar; lpCommandLine: PChar;
  const lpProcessAttributes, lpThreadAttributes: PSecurityAttributes;
  bInheritHandles: BOOL; dwCreationFlags: DWORD; lpEnvironment: Pointer;
  lpCurrentDirectory: PChar; const lpStartupInfo: TStartupInfo;
  out lpProcessInformation: TProcessInformation): BOOL; stdcall;
begin
  pCreateProcess := GetRealProcAddress(GetModuleHandle('kernel32'), 'CreateProcess');
  Result := pCreateProcess(lpApplicationName, lpCommandLine, lpProcessAttributes,
                           lpThreadAttributes, bInheritHandles, dwCreationFlags,
                           lpEnvironment, lpCurrentDirectory, lpStartupInfo,
                           lpProcessInformation);
end;
Leider kommt nun nach dem Start des Programmes sofort die Meldung, dass ein Fehler verursacht wurde und das Programm beendet wird.

Woran kann das liegen?

PS: GetRealProcAddress ermittelt nur die "ursprüngliche" Adresse der API, somit werden Userlevel API Hooks nicht gecallt.
Projekte:
- GitHub (Profil, zyantific)
- zYan Disassembler Engine ( Zydis Online, Zydis GitHub)
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:41 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz