Code: Select all
Structure UNICODE_STRING Align #PB_Structure_AlignC
Length.w
MaximumLength.w
Buffer.i
EndStructure
Structure VM_COUNTERS Align #PB_Structure_AlignC
PeakVirtualSize.l
VirtualSize.l
PageFaultCount.l
PeakWorkingSetSize.l
WorkingSetSize.l
QuotaPeakPagedPoolUsage.l
QuotaPagedPoolUsage.l
QuotaPeakNonPagedPoolUsage.l
QuotaNonPagedPoolUsage.l
PagefileUsage.l
PeakPagefileUsage.l
EndStructure
Structure IO_COUNTERS Align #PB_Structure_AlignC
ReadOperationCount.LARGE_INTEGER
WriteOperationCount.LARGE_INTEGER
OtherOperationCount.LARGE_INTEGER
ReadTransferCount.LARGE_INTEGER
WriteTransferCount.LARGE_INTEGER
OtherTransferCount.LARGE_INTEGER
EndStructure
Structure SYSTEM_THREAD Align #PB_Structure_AlignC
KernelTime.LARGE_INTEGER
UserTime.LARGE_INTEGER
CreateTime.LARGE_INTEGER
WaitTime.l
StartAddress.l
UniqueProcess.l
UniqueThread.l
Priority.l
BasePriority.l
ContextSwitchCount.l
State.l
WaitReason.l
Reserved1.l
EndStructure
Structure SYSTEM_PROCESS_INFORMATION Align #PB_Structure_AlignC
NextEntryOffset.l
NumberOfThreads.l
Reserved1.LARGE_INTEGER[3]
CreateTime.LARGE_INTEGER
UserTime.LARGE_INTEGER
KernelTime.LARGE_INTEGER
ModuleName.UNICODE_STRING
BasePriority.l
ProcessID.i
InheritedFromProcessId.l
HandleCount.l
Reserved2.l[2]
VirtualMemoryCounters.VM_COUNTERS
PrivatePageCount.l
IOCounters.IO_COUNTERS
ThreadInfo.SYSTEM_THREAD[1]
EndStructure
#SystemProcessInformation = 5
NtQuerySystemInformation_(#SystemProcessInformation, #Null, 0, @ReturnLength)
*spi.SYSTEM_PROCESS_INFORMATION
*spi = AllocateMemory(ReturnLength)
NtQuerySystemInformation_(#SystemProcessInformation, *spi, ReturnLength, #Null)
*spi\ModuleName\Buffer = AllocateMemory(#MAX_PATH)
While *spi\NextEntryOffset
Debug Str(*spi\ProcessId) + " | " + PeekS(*spi\ModuleName\Buffer, *spi\ModuleName\Length, #PB_Unicode)
*spi + *spi\NextEntryOffset
Wend