MCPcopy Index your code
hub / github.com/qilingframework/qiling / patch

Method patch

qiling/core.py:594–607  ·  view source on GitHub ↗

Volatilely patch binary and libraries with arbitrary content. Patching may be done prior to emulation start. Args: offset: offset in target to patch data: patch data target: target library name to patch (or `None` for the main executable binary)

(self, offset: int, data: bytes, target: Optional[str] = None)

Source from the content-addressed store, hash-verified

592 debugger.run()
593
594 def patch(self, offset: int, data: bytes, target: Optional[str] = None) -> None:
595 """Volatilely patch binary and libraries with arbitrary content.
596 Patching may be done prior to emulation start.
597
598 Args:
599 offset: offset in target to patch
600 data: patch data
601 target: target library name to patch (or `None` for the main executable binary)
602 """
603
604 if target is None:
605 self.patch_bin.append((offset, data))
606 else:
607 self.patch_lib.append((offset, data, target))
608
609 def save(self, reg=True, mem=True, hw=False, fd=False, cpu_context=False, os=False, loader=False, *, snapshot: Optional[str] = None):
610 """Pack Qiling's current state into an object and optionally dump it to a file.

Callers 6

our_sandboxMethod · 0.95
crackMethod · 0.95
my_sandboxFunction · 0.95
crackFunction · 0.95

Calls 1

appendMethod · 0.45

Tested by 4

our_sandboxMethod · 0.76
crackMethod · 0.76