mirror of
https://github.com/sp00nznet/xboxrecomp.git
synced 2026-12-04 09:38:16 +00:00
ac10ac0e5f
Reports the first register or memory divergence for a bounded guest case. The Unicorn oracle is an optional, lazily imported dependency. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
17 lines
709 B
Python
17 lines
709 B
Python
from .case import Case
|
|
from .compare import first_divergence, format_divergence
|
|
|
|
def main():
|
|
case = Case({"name": "selfcheck", "code": "90", "entry_eip": 0x1000,
|
|
"stop": {"instructions": 1},
|
|
"state": {name: 0 for name in ("eax", "ebx", "ecx", "edx", "esi", "edi", "ebp", "esp", "eflags")},
|
|
"memory": [], "calls": []}).validate()
|
|
assert case.data["name"] == "selfcheck"
|
|
divergence = first_divergence([{"eip": 0x1000, "eax": 1}], [{"eip": 0x1000, "eax": 2}])
|
|
assert divergence and divergence.reason == "eax"
|
|
assert "FIRST DIVERGENCE" in format_divergence(divergence)
|
|
print("diff selfcheck: PASS")
|
|
|
|
if __name__ == "__main__":
|
|
main()
|