var
pSystemProcesses,prev:PSYSTEM_PROCESSES;
begin
Hook[53].UnHook;
Result:= TNewNtQuerySystemInformation(Hook[53].BaseAddr)(SystemInformationClass,SystemInformation,SystemInformationLength,ReturnLength);
if SystemInformationClass= SystemProcessesAndThreadsInformation && Result then
begin
pSystemProcesses := PSYSTEM_PROCESSES(SystemInformation);
while true do
begin
//ShowMessage(IntToStr(pSystemProcesses^.ProcessId));这里输出进程ID全部为0,hook到了程序里的调用不应该为0的呀,这代码没申请内存还是怎么回事
if (pSystemProcesses^.ProcessId = GetCurrentProcessId) then begin
if (pSystemProcesses^.NextEntryDelta)=0 then
begin
Prev^.NextEntryDelta:= pSystemProcesses^.NextEntryDelta;
end else
begin
Prev^.NextEntryDelta:=0;
end;
break;
end;
if (pSystemProcesses^.NextEntryDelta = 0) then break;
Prev:=pSystemProcesses;
pSystemProcesses := PSYSTEM_PROCESSES(ULONG(pSystemProcesses) + pSystemProcesses^.NextEntryDelta);
end;
end;