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

Method do_invoke

tools/gef.py:8313–8344  ·  view source on GitHub ↗
(self, argv: List[str])

Source from the content-addressed store, hash-verified

8311 _syntax_ = f"{_cmdline_} [(on|off)]"
8312
8313 def do_invoke(self, argv: List[str]) -> None:
8314 argc = len(argv)
8315
8316 if argc == 0:
8317 ret = gdb.execute("show disable-randomization", to_string=True)
8318 i = ret.find("virtual address space is ")
8319 if i < 0:
8320 return
8321
8322 msg = "ASLR is currently "
8323 if ret[i + 25:].strip() == "on.":
8324 msg += Color.redify("disabled")
8325 else:
8326 msg += Color.greenify("enabled")
8327
8328 gef_print(msg)
8329 return
8330
8331 elif argc == 1:
8332 if argv[0] == "on":
8333 info("Enabling ASLR")
8334 gdb.execute("set disable-randomization off")
8335 return
8336 elif argv[0] == "off":
8337 info("Disabling ASLR")
8338 gdb.execute("set disable-randomization on")
8339 return
8340
8341 warn("Invalid command")
8342
8343 self.usage()
8344 return
8345
8346
8347@register

Callers

nothing calls this directly

Calls 7

gef_printFunction · 0.85
infoFunction · 0.85
warnFunction · 0.85
redifyMethod · 0.80
greenifyMethod · 0.80
usageMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected