Einzelnen Beitrag anzeigen

sk0r

Registriert seit: 1. Mai 2007
181 Beiträge
 
Delphi 7 Enterprise
 
#1

Hooked NtQuerySystemInformation Problem

  Alt 3. Mai 2007, 15:49
Tag

ich habe mal NtQuerySystemInformation gehookt. Ziel ist es eine
Anwendung im Taskmanager zu verstecken (mache das NUR zum lernen).
Naja, das Problem ist, dass ich nun nicht weiß, wie ich in der
Funktion arbeiten soll. Tuts gibts dafür nicht, desshalb hab ich
erstmal rumprobiert.

Delphi-Quellcode:
function scNtQuerySystemInformation(SystemInformationClass: SYSTEM_INFORMATION_CLASS; SystemInformation: Pointer; SystemInformationLength:ULONG; ReturnLength:PULONG):LongInt; stdcall;
var
  NtQueryResult: LongInt;
  SysProcInfo: PSYSTEM_PROCESS_INFORMATION;
  lpProcName: PChar;
  cProcId: Cardinal;
begin
 NtQueryResult := scorigNtQuerySystemInformation(SystemInformationClass, SystemInformation, SystemInformationLength, ReturnLength);
  if SystemInformationClass = SystemProcessesAndThreadsInformation then
  begin
    SysProcInfo := PSYSTEM_PROCESS_INFORMATION(SystemInformation);
    lpProcName := SysProcInfo.ProcessName.Buffer;
    if lpProcName <> nil then
    begin
      MessageBox(0, lpProcName, 'test', 0);
    end;
  end;
  result := NtQueryResult;
end;
Leider funktioniert es nicht. Die abfrage ob SystemInformationClass = SystemProcessesAndThreadsInformation
ist, funktioniert zwar, aber dann geht nichts mehr. lpProcName hat immer keinen Wert, so wie mein
Code da nun ist. meine Frage ist halt nun, was ich falsch mache, bzw was ich ändern muss. Denke mal
da fehlt noch Code. Hilfe wäre echt nett.

Und nochmal: Ich mach nichts illegales damit, ich mach das nur weils interessant ist.

MfG: sk0r
  Mit Zitat antworten Zitat