mirror of
https://github.com/a2-4am/passport.py.git
synced 2024-09-29 19:56:52 +00:00
45 lines
1.3 KiB
Python
45 lines
1.3 KiB
Python
__all__ = [
|
|
"a5count",
|
|
"a6bc95",
|
|
"advint",
|
|
"bademu",
|
|
"bademu2",
|
|
"bbf9",
|
|
"bootcounter",
|
|
"border",
|
|
"d5d5f7",
|
|
"mecc1",
|
|
"mecc2",
|
|
"mecc3",
|
|
"mecc4",
|
|
"microfun",
|
|
"rwts",
|
|
"universale7",
|
|
]
|
|
|
|
class Patch:
|
|
# represents a single patch that could be applied to a disk image
|
|
def __init__(self, track_num, sector_num, byte_offset, new_value, id=None, params={}):
|
|
self.track_num = track_num
|
|
self.sector_num = sector_num
|
|
self.byte_offset = byte_offset
|
|
self.new_value = new_value # (can be 0-length bytearray if this "patch" is really just an informational message with no changes)
|
|
self.id = id # for logger.PrintByID (can be None)
|
|
self.params = params.copy()
|
|
self.params["track"] = track_num
|
|
self.params["sector"] = sector_num
|
|
self.params["offset"] = byte_offset
|
|
|
|
class Patcher: # base class
|
|
def __init__(self, g):
|
|
self.g = g
|
|
|
|
def should_run(self, track_num):
|
|
"""returns True if this patcher applies to the given track in the current process (possibly affected by state in self.g), or False otherwise"""
|
|
return False
|
|
|
|
def run(self, logical_sectors, track_num):
|
|
"""returns list of Patch objects representing patches that could be applied to logical_sectors"""
|
|
return []
|
|
|