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

Method invoke

tools/gef.py:9714–9739  ·  view source on GitHub ↗
(self, args: Any, from_tty: bool)

Source from the content-addressed store, hash-verified

9712 return
9713
9714 def invoke(self, args: Any, from_tty: bool) -> None:
9715 self.dont_repeat()
9716 cfg = configparser.RawConfigParser()
9717 old_sect = None
9718
9719 # save the configuration
9720 for key in sorted(gef.config):
9721 sect, optname = key.split(".", 1)
9722 value = gef.config[key]
9723
9724 if old_sect != sect:
9725 cfg.add_section(sect)
9726 old_sect = sect
9727
9728 cfg.set(sect, optname, value)
9729
9730 # save the aliases
9731 cfg.add_section("aliases")
9732 for alias in gef.session.aliases:
9733 cfg.set("aliases", alias._alias, alias._command)
9734
9735 with GEF_RC.open("w") as fd:
9736 cfg.write(fd)
9737
9738 ok(f"Configuration saved to '{GEF_RC}'")
9739 return
9740
9741
9742class GefRestoreCommand(gdb.Command):

Callers

nothing calls this directly

Calls 3

openMethod · 0.80
okFunction · 0.70
writeMethod · 0.45

Tested by

no test coverage detected