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)
| 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. |