Advertisement
den4ik2003

Untitled

Dec 6th, 2024
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. import subprocess
  2.  
  3. gdb_command = ['gdb', './cutted_bin']
  4.  
  5. gdb_script = """
  6. run
  7. generate-core-file /mnt/core-dump
  8. quit
  9. """
  10.  
  11. try:
  12.     result = subprocess.run(
  13.         gdb_command,
  14.         input=gdb_script,
  15.         text=True,
  16.         check=True,
  17.         capture_output=True
  18.     )
  19. except subprocess.CalledProcessError as e:
  20.     print('Error:', e.stderr)
  21.     print('Return code:', e.returncode)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement