Guest User

patch_ignition.py

a guest
Oct 13th, 2026
28
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.89 KB | None | 0 0
  1. #!/usr/bin/env python3
  2. """Remove the GarageGames Ignition check from Marble Blast Gold 1.4.1 for Linux.
  3.  
  4. Usage: patch_ignition.py <marbleblastgold.bin> [output]
  5.  
  6. Patches (virtual address -> file offset = va - 0x08048000):
  7.  0x0821e184  Ignition library validate()  -> return 4 (ValidTicket)
  8.  0x0821e3a0  Ignition library getStatus() -> return 4 (ValidTicket)
  9.  0x0814f310  IgnitionObject ticket-field fill -> return immediately
  10.              (with no ticket it would insert NULL into the StringTable)
  11.  
  12. With validate() reporting ValidTicket, the script-side runIgnition() goes
  13. straight to the main menu, and the IgnitionEventA check posted on every
  14. Marble::onAdd never schedules the quit/GUI-swap/delete events (B/C/D).
  15. """
  16. import hashlib
  17. import sys
  18.  
  19. ORIGINAL_SHA256 = "31631d3d590227e7389bfa4c429c83179bf63f7cf855c521576c349a79250c0c"
  20. BASE = 0x08048000
  21. RET4 = bytes.fromhex("b804000000c3")  # mov eax,4 ; ret
  22.  
  23. PATCHES = [
  24.     (0x0821E184, bytes.fromhex("5589e55653b8"), RET4),
  25.     (0x0821E3A0, bytes.fromhex("5589e5b80100"), RET4),
  26.     (0x0814F310, bytes.fromhex("53"), bytes.fromhex("c3")),
  27. ]
  28.  
  29.  
  30. def main():
  31.     if len(sys.argv) not in (2, 3):
  32.         sys.exit(__doc__)
  33.     src = sys.argv[1]
  34.     dst = sys.argv[2] if len(sys.argv) == 3 else src
  35.     data = bytearray(open(src, "rb").read())
  36.  
  37.     digest = hashlib.sha256(data).hexdigest()
  38.     if digest != ORIGINAL_SHA256:
  39.         sys.exit(f"unexpected input sha256 {digest}; expected the 1.4.1 Linux binary")
  40.  
  41.     for va, expect, new in PATCHES:
  42.         off = va - BASE
  43.         if data[off:off + len(expect)] != expect:
  44.             sys.exit(f"bytes at {va:#x} do not match; refusing to patch")
  45.         data[off:off + len(new)] = new
  46.         print(f"patched {va:#x} (file offset {off:#x})")
  47.  
  48.     open(dst, "wb").write(data)
  49.     print(f"wrote {dst} sha256 {hashlib.sha256(data).hexdigest()}")
  50.  
  51.  
  52. if __name__ == "__main__":
  53.     main()
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment