Skip to content

Instantly share code, notes, and snippets.

@kng
Created May 19, 2023 16:16
Show Gist options
  • Save kng/7b4b89dd309ad4e587f3a66001d1e668 to your computer and use it in GitHub Desktop.
Save kng/7b4b89dd309ad4e587f3a66001d1e668 to your computer and use it in GitHub Desktop.
Dump process memory with psutil
#!/usr/bin/env python3
import psutil
import sys
if len(sys.argv) != 2:
print('supply pid to connect')
exit(-1)
p = psutil.Process(int(sys.argv[1]))
print(p.memory_info())
for i in p.memory_maps():
print(i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment