import process
Module32First = ::Kernel32.api("Module32First","int(int hSnapshot,struct& lppe)")
Module32Next = ::Kernel32.api("Module32Next","int(int hSnapshot,struct& lppe)")
function Get(pid){
var arrModule={}
MODULEENTRY32= class{
int dwsize;
int th32ModuleID;
int th32ProcessID;
int GlblcntUsage;
int ProccntUsage;
byte modBaseAddr;
int modBaseSize;
int hModule;
bytes szModule[256];
bytes szExePath[1024];
}
var module =MODULEENTRY32()
hSnapshot= process.CreateToolhelp32Snapshot (8,pid)
if(!hSnapshot)
return 0;
module.dwsize=1024
phandle=Module32First(hSnapshot,module)
while(phandle!=0){
table.push(arrModule,module.szModule)
phandle=Module32Next(hSnapshot,module)
}
raw.closehandle( topointer(hSnapshot))
return arrModule;
}
var pid=0;
for processEntry in process.each( "QQ.exe" ) {
pid=processEntry.th32ProcessID
io.print(pid)
}
io.open()
var arrModule = Get(pid)
io.print( #arrModule )
for(i=1;#arrModule ){
io.print(arrModule[ i ])
}
execute("pause")
io.close()
阅读(1516) | 评论(0) | 转发(1) |