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

Method do_invoke

tools/gef.py:8269–8302  ·  view source on GitHub ↗
(self, _: List[str], **kwargs: Any)

Source from the content-addressed store, hash-verified

8267 @only_if_gdb_running
8268 @parse_arguments({"address": "$sp"}, {("-r", "--reference"): "", ("-l", "--length"): 10})
8269 def do_invoke(self, _: List[str], **kwargs: Any) -> None:
8270 args : argparse.Namespace = kwargs["arguments"]
8271 nb = args.length
8272
8273 target = args.address
8274 target_addr = parse_address(target)
8275
8276 reference = args.reference or target
8277 ref_addr = parse_address(reference)
8278
8279 if process_lookup_address(target_addr) is None:
8280 err(f"Unmapped address: '{target}'")
8281 return
8282
8283 if process_lookup_address(ref_addr) is None:
8284 err(f"Unmapped address: '{reference}'")
8285 return
8286
8287 if gef.config["context.grow_stack_down"] is True:
8288 from_insnum = nb * (self.repeat_count + 1) - 1
8289 to_insnum = self.repeat_count * nb - 1
8290 insnum_step = -1
8291 else:
8292 from_insnum = 0 + self.repeat_count * nb
8293 to_insnum = nb * (self.repeat_count + 1)
8294 insnum_step = 1
8295
8296 start_address = align_address(target_addr)
8297 base_offset = start_address - align_address(ref_addr)
8298
8299 for i in range(from_insnum, to_insnum, insnum_step):
8300 gef_print(DereferenceCommand.pprint_dereferenced(start_address, i, base_offset))
8301
8302 return
8303
8304
8305@register

Callers

nothing calls this directly

Calls 6

parse_addressFunction · 0.85
process_lookup_addressFunction · 0.85
errFunction · 0.85
align_addressFunction · 0.85
gef_printFunction · 0.85
pprint_dereferencedMethod · 0.80

Tested by

no test coverage detected