more work done
This commit is contained in:
parent
5cc5612f4e
commit
d323bb28fc
68 changed files with 714 additions and 19 deletions
33
scripts/_tmp_changer_ir_dump.py
Normal file
33
scripts/_tmp_changer_ir_dump.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
from pathlib import Path
|
||||
import json
|
||||
|
||||
from tools.poc_crusader_usecode_parser import parse_ir
|
||||
|
||||
|
||||
def dump_variant(label: str, extracted_root: str, class_name: str, slot: int) -> None:
|
||||
ir = parse_ir(class_name, slot, extracted_root)
|
||||
print(f"=== {label} {class_name} slot=0x{slot:02X} ===")
|
||||
print(json.dumps(ir["class"], indent=2))
|
||||
print(json.dumps(ir["event"], indent=2))
|
||||
for op in ir["ops"]:
|
||||
print(
|
||||
json.dumps(
|
||||
{
|
||||
"offset": op["offset"],
|
||||
"mnemonic": op["mnemonic"],
|
||||
"operands": op["operands"],
|
||||
"raw_bytes": op["raw_bytes"],
|
||||
},
|
||||
separators=(",", ":"),
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def main() -> None:
|
||||
root = Path(__file__).resolve().parent
|
||||
dump_variant("remorse", str(root / "USECODE" / "EUSECODE_extracted"), "CHANGER", 0x07)
|
||||
dump_variant("regret", str(root / "USECODE" / "REGRET" / "REGRET_USECODE_extracted"), "CHANGER", 0x07)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue