Created
May 19, 2023 16:16
-
-
Save kng/7b4b89dd309ad4e587f3a66001d1e668 to your computer and use it in GitHub Desktop.
Dump process memory with psutil
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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