Skip to content

Instantly share code, notes, and snippets.

@mattifestation
Last active September 16, 2019 04:58
Show Gist options
  • Save mattifestation/92062cb8d6fb887f2fcb7fb7482af5a5 to your computer and use it in GitHub Desktop.
Save mattifestation/92062cb8d6fb887f2fcb7fb7482af5a5 to your computer and use it in GitHub Desktop.
Enumerating module base addresses for a process using only WMI
Get-CimInstance -ClassName Win32_Process -Filter "ProcessID = $PID" -Property Handle | % {
Get-CimInstance -ClassName CIM_ProcessExecutable -Filter "Dependent = 'Win32_Process.Handle=$($_.Handle)'"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment