add SunburstPatcher

This commit is contained in:
4am 2019-01-29 20:55:25 -05:00
parent 046902f1e3
commit 541ba512da
7 changed files with 60 additions and 7 deletions

View File

@ -6,12 +6,11 @@
from passport import eddimage, wozardry, a2rimage
from passport import DefaultLogger, DebugLogger
from passport import Crack, Verify, Convert
from passport.strings import STRINGS
from passport.strings import __date__, STRINGS
import argparse
import os.path
__version__ = "0.2" # https://semver.org/
__date__ = "2019-01-29"
__progname__ = "passport"
class BaseCommand:

View File

@ -586,7 +586,7 @@ class BasePassportProcessor: # base class
self.patches_found = []
self.patch_count = 0 # number of patches found across all tracks
self.patcher_classes = [
#SunburstPatcher,
sunburst.SunburstPatcher,
#JMPBCF0Patcher,
#JMPBEB1Patcher,
#JMPBECAPatcher,

View File

@ -14,6 +14,7 @@ __all__ = [
"mecc4",
"microfun",
"rwts",
"sunburst",
"universale7",
]
@ -41,4 +42,3 @@ class Patcher: # base class
def run(self, logical_sectors, track_num):
"""returns list of Patch objects representing patches that could be applied to logical_sectors"""
return []

View File

@ -22,4 +22,3 @@ tested on
b'\xC9\xD5'
b'\xF0\x12'): return []
return [Patch(0, 3, 0x58, b'\xF0\x06')]
return patches

View File

@ -0,0 +1,53 @@
from passport.patchers import Patch, Patcher
from passport.util import *
class SunburstPatcher(Patcher):
"""RWTS with track-based address and data prologue modifications
tested on
- Challenge Math
- Safari Search
- Ten Clues
- The Factory
- Trading Post
- Word Quest
"""
def should_run(self, track_num):
return self.g.is_rwts and (track_num == 0)
def run(self, logical_sectors, track_num):
if not find.at(0x40, logical_sectors[3], b'\xD0'): return []
if not find.at(0x9C, logical_sectors[3], b'\xF0'): return []
if not find.at(0x69, logical_sectors[4], bytes.fromhex(
"48"
"A5 2A"
"4A"
"A8"
"B9 29 BA"
"8D 6A B9"
"8D 84 BC"
"B9 34 BA"
"8D FC B8"
"8D 5D B8"
"C0 11"
"D0 03"
"A9 02"
"AC"
"A9 0E"
"8D C0 BF"
"68"
"69 00"
"48"
"AD 78 04"
"90 2B")): return []
if not find.at(0x69, logical_sectors[6], bytes.fromhex(
"4C B8 B6"
"EA"
"EA"
"EA")): return []
if not find.at(0x8C, logical_sectors[8], bytes.fromhex(
"69 BA")): return []
return [Patch(0, 3, 0x40, bytes.fromhex("F0")),
Patch(0, 3, 0x9C, bytes.fromhex("D0")),
Patch(0, 6, 0x69, bytes.fromhex("20 C3 BC 20 C3 BC")),
Patch(0, 8, 0x8C, bytes.fromhex("A0 B9"))]

View File

@ -7,7 +7,7 @@ class UniversalE7Patcher(Patcher):
(invented by qkumba, see PoC||GTFO 0x11 and 4am crack no. 655 Rocky's Boots 4.0 for explanation)
"""
e7sector = b'\x00'*0xA0 + b'\xAC\x00'*0x30
def should_run(self, track_num):
return True

View File

@ -1,5 +1,7 @@
__date__ = "2019-01-29"
STRINGS = {
"header": "Passport.py by 4am (2019-01-28)\n", # max 32 characters
"header": "Passport.py by 4am (" + __date__ + ")\n", # max 32 characters
"reading": "Reading from {filename}\n",
"diskrwts": "Using disk's own RWTS\n",
"bb00": "T00,S05 Found $BB00 protection check\n"