MCPcopy Create free account
hub / github.com/HexHive/NASS / gef_execute_gdb_script

Function gef_execute_gdb_script

tools/gef.py:2112–2124  ·  view source on GitHub ↗

Execute the parameter `source` as GDB command. This is done by writing `commands` to a temporary file, which is then executed via GDB `source` command. The tempfile is then deleted.

(commands: str)

Source from the content-addressed store, hash-verified

2110
2111
2112def gef_execute_gdb_script(commands: str) -> None:
2113 """Execute the parameter `source` as GDB command. This is done by writing `commands` to
2114 a temporary file, which is then executed via GDB `source` command. The tempfile is then deleted."""
2115 fd, fname = tempfile.mkstemp(suffix=".gdb", prefix="gef_")
2116 with os.fdopen(fd, "w") as f:
2117 f.write(commands)
2118 f.flush()
2119
2120 fname = pathlib.Path(fname)
2121 if fname.is_file() and os.access(fname, os.R_OK):
2122 gdb.execute(f"source {fname}")
2123 fname.unlink()
2124 return
2125
2126
2127@deprecated("Use Elf(fname).checksec()")

Callers

nothing calls this directly

Calls 2

flushMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected