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

Method get_target

uncompyle6/scanner.py:318–329  ·  view source on GitHub ↗

Get next instruction offset for op located at given . NOTE: extended_arg is no longer used

(self, offset: int, extended_arg: int = 0)

Source from the content-addressed store, hash-verified

316 return self.insts[self.offset2inst_index[offset]]
317
318 def get_target(self, offset: int, extended_arg: int = 0) -> int:
319 """
320 Get next instruction offset for op located at given <offset>.
321 NOTE: extended_arg is no longer used
322 """
323 inst = self.get_inst(offset)
324 if inst.opcode in self.opc.JREL_OPS | self.opc.JABS_OPS:
325 target = inst.argval
326 else:
327 # No jump offset, so use fall-through offset
328 target = next_offset(inst.opcode, self.opc, inst.offset)
329 return target
330
331 def get_argument(self, pos: int):
332 arg = self.code[pos + 1] + self.code[pos + 2] * 256

Callers 15

is_jump_forwardMethod · 0.95
first_instrMethod · 0.95
last_instrMethod · 0.95
inst_matchesMethod · 0.95
all_instrMethod · 0.95
ingestMethod · 0.80
detect_control_flowMethod · 0.80
is_jump_backMethod · 0.80
next_except_jumpMethod · 0.80
rem_orMethod · 0.80
detect_control_flowMethod · 0.80

Calls 1

get_instMethod · 0.95

Tested by

no test coverage detected