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

Method __install_extras_script

tools/gef.py:10086–10105  ·  view source on GitHub ↗
(self, script: str)

Source from the content-addressed store, hash-verified

10084
10085
10086 def __install_extras_script(self, script: str) -> bool:
10087 fpath = self.dirpath / f"{script}.py"
10088 if not fpath.exists():
10089 url = f"https://raw.githubusercontent.com/hugsy/gef-extras/{self.branch}/scripts/{script}.py"
10090 info(f"Searching for '{script}.py' in `gef-extras@{self.branch}`...")
10091 data = http_get(url)
10092 if not data:
10093 warn("Not found")
10094 return False
10095
10096 with fpath.open("wb") as fd:
10097 fd.write(data)
10098 fd.flush()
10099
10100 old_command_set = set(gef.gdb.commands)
10101 gdb.execute(f"source {fpath}")
10102 new_command_set = set(gef.gdb.commands)
10103 new_commands = [f"`{c[0]}`" for c in (new_command_set - old_command_set)]
10104 ok(f"Installed file '{fpath}', new command(s) available: {', '.join(new_commands)}")
10105 return True
10106
10107
10108#

Callers 1

invokeMethod · 0.95

Calls 8

infoFunction · 0.85
http_getFunction · 0.85
warnFunction · 0.85
openMethod · 0.80
flushMethod · 0.80
joinMethod · 0.80
okFunction · 0.70
writeMethod · 0.45

Tested by

no test coverage detected