A artx Unregistered / Unconfirmed GUEST, unregistred user! 2000-07-19 #1 即求到一个进程从0x00400000 到 0x???????? 结束
O o*o Unregistered / Unconfirmed GUEST, unregistred user! 2000-07-20 #2 uses tlhelp32;<br><br>function GetProcSize(ProcessIDWORD)WORD;<br>var b:BOOL;<br> SnapHandle:THandle;<br> Entry:TModuleEntry32;<br>begin<br> SnapHandle:=CreateToolhelp32Snapshot(TH32CS_SNAPALL,ProcessID);<br> Entry.dwSize:=Sizeof(Entry);<br> b:=Module32First(SnapHandle,Entry);<br> while integer(b)<>0 do begin<br> if Entry.th32ModuleID=ProcessID then Result:=Entry.modBaseSize;<br> b:=Module32Next(SnapHandle,Entry);<br> end;<br>end;
uses tlhelp32;<br><br>function GetProcSize(ProcessIDWORD)WORD;<br>var b:BOOL;<br> SnapHandle:THandle;<br> Entry:TModuleEntry32;<br>begin<br> SnapHandle:=CreateToolhelp32Snapshot(TH32CS_SNAPALL,ProcessID);<br> Entry.dwSize:=Sizeof(Entry);<br> b:=Module32First(SnapHandle,Entry);<br> while integer(b)<>0 do begin<br> if Entry.th32ModuleID=ProcessID then Result:=Entry.modBaseSize;<br> b:=Module32Next(SnapHandle,Entry);<br> end;<br>end;
A artx Unregistered / Unconfirmed GUEST, unregistred user! 2000-07-22 #5 是Entry.th32ModuleID=ProcessID 还是Entry.th32ProcessID=ProcessID?<br>我用Entry.th32ModuleID=ProcessID不对
O o*o Unregistered / Unconfirmed GUEST, unregistred user! 2000-07-24 #6 sorry,我随手写的,有问题.<br><br>function GetProcModuleID(ProcessIDWORD)WORD;<br>var b:BOOL;<br> SnapHandle:THandle;<br> Entry:TProcessEntry32;<br>begin<br> SnapHandle:=CreateToolhelp32Snapshot(TH32CS_SNAPALL,0);<br> Entry.dwSize:=Sizeof(Entry);<br> b:=Process32First(SnapHandle,Entry);<br> while integer(b)<>0 do begin<br> if Entry.th32ProcessID=ProcessID then Result:=Entry.th32ModuleID;<br> b:=Process32Next(SnapHandle,Entry);<br> end;<br>end;<br><br>function GetProcSize(ProcessIDWORD)WORD;<br>var b:BOOL;<br> SnapHandle:THandle;<br> Entry:TModuleEntry32;<br> ModuleIDWORD;<br>begin<br> ModuleID:=GetProcModuleID(ProcessID);<br> SnapHandle:=CreateToolhelp32Snapshot(TH32CS_SNAPALL,ProcessID);<br> Entry.dwSize:=Sizeof(Entry);<br> b:=Module32First(SnapHandle,Entry);<br> while integer(b)<>0 do begin<br> if Entry.th32ModuleID=ModuleID then Result:=Entry.modBaseSize;<br> b:=Module32Next(SnapHandle,Entry);<br> end;<br>end;
sorry,我随手写的,有问题.<br><br>function GetProcModuleID(ProcessIDWORD)WORD;<br>var b:BOOL;<br> SnapHandle:THandle;<br> Entry:TProcessEntry32;<br>begin<br> SnapHandle:=CreateToolhelp32Snapshot(TH32CS_SNAPALL,0);<br> Entry.dwSize:=Sizeof(Entry);<br> b:=Process32First(SnapHandle,Entry);<br> while integer(b)<>0 do begin<br> if Entry.th32ProcessID=ProcessID then Result:=Entry.th32ModuleID;<br> b:=Process32Next(SnapHandle,Entry);<br> end;<br>end;<br><br>function GetProcSize(ProcessIDWORD)WORD;<br>var b:BOOL;<br> SnapHandle:THandle;<br> Entry:TModuleEntry32;<br> ModuleIDWORD;<br>begin<br> ModuleID:=GetProcModuleID(ProcessID);<br> SnapHandle:=CreateToolhelp32Snapshot(TH32CS_SNAPALL,ProcessID);<br> Entry.dwSize:=Sizeof(Entry);<br> b:=Module32First(SnapHandle,Entry);<br> while integer(b)<>0 do begin<br> if Entry.th32ModuleID=ModuleID then Result:=Entry.modBaseSize;<br> b:=Module32Next(SnapHandle,Entry);<br> end;<br>end;