tools.ps.windows: Add read-peb and my-peb.

db4
Doug Coleman 2013-05-01 18:14:23 -07:00
parent a326b73470
commit 16d24a5194
1 changed files with 10 additions and 0 deletions

View File

@ -43,6 +43,16 @@ IN: tools.ps.windows
ReadProcessMemory win32-error=0/f
ba ;
: read-peb ( handle address -- peb )
0 PEB heap-size read-process-memory PEB memory>struct ;
: my-peb ( -- peb )
GetCurrentProcessId [
open-process-read
[ <win32-handle> &dispose drop ]
[ dup query-information-process PebBaseAddress>> read-peb ] bi
] with-destructors ;
:: read-args ( handle -- string/f )
handle <win32-handle> &dispose drop
handle query-information-process :> process-basic-information