Created
September 16, 2021 17:12
-
-
Save Marcin648/0074f322b3af8df76a2bf8e444999187 to your computer and use it in GitHub Desktop.
Simple script that prints all process arguments
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
# | |
# Simple script that prints all process arguments | |
# usage: python3 check_args.py <PID> | |
# by Marcin648 | |
# September 2021 | |
# | |
import sys | |
if(len(sys.argv) < 2): | |
print("usage: check_args.py <PID>") | |
exit(1) | |
pid = sys.argv[1] | |
cmdline = open("/proc/%s/cmdline" % pid, "r").read() | |
args = cmdline.split("\0") | |
for i, arg in enumerate(args): | |
print("argv[%d] = %s" % (i, arg)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment