Files
2026-05-14 04:25:49 +02:00

21 lines
806 B
Python

from llvm import create_context, Module, Function
from container import PEContainer
from bfs import lift_bfs
def lift_pe(module: Module, filename: str, start: int, *, verbose=False) -> Function:
return lift_bfs(module, PEContainer(filename), start, verbose=verbose).function
if __name__ == "__main__":
with create_context() as context:
with context.create_module("lifted") as module:
vm_entry = lift_pe(module, "tests/binaryshield.exe", 0x140017A41)
print(vm_entry)
cfg = lift_pe(module, "tests/cfg.exe", 0x140001000)
print(cfg)
riscvm_run = lift_pe(module, "tests/riscvm.exe", 0x140001104)
print(riscvm_run)
themida = lift_pe(module, "tests/example2-virt.bin", 0x140001000)
print(themida)