MCPcopy Create free account
hub / github.com/ELMERIKH/PyinMemoryPE / merge_shellcode

Method merge_shellcode

windows/native_exec/simple_x86.py:1090–1097  ·  view source on GitHub ↗
(self, other)

Source from the content-addressed store, hash-verified

1088 self.size -= 1
1089
1090 def merge_shellcode(self, other):
1091 shared_labels = set(self.labels) & set(other.labels)
1092 if shared_labels:
1093 raise ValueError("Cannot merge shellcode: shared labels {0}".format(shared_labels))
1094 for offset, instr in sorted(other.instrs.items()):
1095 for label_name in [name for name, label_offset in other.labels.items() if label_offset == offset]:
1096 self.add_instruction(Label(label_name))
1097 self.add_instruction(instr)
1098
1099 def __iadd__(self, other):
1100 if isinstance(other, MultipleInstr):

Callers 1

__iadd__Method · 0.95

Calls 3

add_instructionMethod · 0.95
LabelClass · 0.70
itemsMethod · 0.45

Tested by

no test coverage detected