mirror of
https://git.soft.fish/val/MicroCorruption.git
synced 2024-11-22 12:05:59 +00:00
Create microcorruption debugger scripts
Call arbitrary funcs with arbitrary args
This commit is contained in:
parent
1d90ffc2f2
commit
31df36d848
19
17-Chernobyl/Code/crappy_python/caller_id.py
Normal file
19
17-Chernobyl/Code/crappy_python/caller_id.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""
|
||||||
|
caller_id: Call a function with arbitrary parameters in microcorruption
|
||||||
|
"""
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
|
preamble = "reset; break main; continue; unbreak main;"
|
||||||
|
|
||||||
|
while 1:
|
||||||
|
address, *args = re.split(r"[(,) ]",input("> "))
|
||||||
|
if address == "": break
|
||||||
|
print(f"{preamble} Let pc = {address}", end=";")
|
||||||
|
reg = 15
|
||||||
|
for arg in args:
|
||||||
|
if arg:
|
||||||
|
print(f"Let r{reg} = {arg}", end=";")
|
||||||
|
reg -= 1
|
||||||
|
print("\b ")
|
Loading…
Reference in New Issue
Block a user