MCPcopy
hub / github.com/rocky/python-uncompyle6 / get_inst

Method get_inst

uncompyle6/scanner.py:307–316  ·  view source on GitHub ↗
(self, offset: int)

Source from the content-addressed store, hash-verified

305 return self.insts[self.offset2inst_index[offset] - 1].offset
306
307 def get_inst(self, offset: int):
308 # Instructions can get moved as a result of EXTENDED_ARGS removal.
309 # So if "offset" is not in self.offset2inst_index, then
310 # we assume that it was an instruction moved back.
311 # We check that assumption though by looking at
312 # self.code's opcode.
313 if offset not in self.offset2inst_index:
314 offset -= instruction_size(self.opc.EXTENDED_ARG, self.opc)
315 assert self.code[offset] == self.opc.EXTENDED_ARG
316 return self.insts[self.offset2inst_index[offset]]
317
318 def get_target(self, offset: int, extended_arg: int = 0) -> int:
319 """

Callers 6

is_jump_forwardMethod · 0.95
get_targetMethod · 0.95
detect_control_flowMethod · 0.80
detect_control_flowMethod · 0.80
ingestMethod · 0.80
detect_control_flowMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected