Add argument to apply experimental DI patch to IOS

This commit is contained in:
Campbell 2024-07-31 01:33:50 -04:00
parent 304539b120
commit bb3c2737e5
Signed by: NinjaCheetah
GPG Key ID: B547958AF96ED344
2 changed files with 14 additions and 0 deletions

View File

@ -45,6 +45,16 @@ def patch_version_downgrading(ios_patcher: libWiiPy.title.IOSPatcher) -> int:
return count
def patch_drive_inquiry(ios_patcher: libWiiPy.title.IOSPatcher) -> int:
print("Applying drive inquiry patch... ", end="", flush=True)
count = ios_patcher.patch_drive_inquiry()
if count == 1:
print(f"{count} patch applied")
else:
print(f"{count} patches applied")
return count
def handle_iospatch(args):
input_path = pathlib.Path(args.input)
if not input_path.exists():
@ -85,6 +95,8 @@ def handle_iospatch(args):
patch_count += patch_nand_access(ios_patcher)
if args.version_downgrading is True:
patch_count += patch_version_downgrading(ios_patcher)
if args.drive_inquiry is True:
patch_count += patch_drive_inquiry(ios_patcher)
print(f"\nTotal patches applied: {patch_count}")

View File

@ -70,6 +70,8 @@ if __name__ == "__main__":
iospatch_parser.add_argument("-na", "--nand-access", action="store_true", help="patch in /dev/flash access")
iospatch_parser.add_argument("-vd", "--version-downgrading", action="store_true",
help="patch in version downgrading support")
iospatch_parser.add_argument("-di", "--drive-inquiry", action="store_true",
help="patches out the drive inquiry check")
iospatch_parser.add_argument("-v", "--version", metavar="VERSION", type=int, help="set the IOS version")
iospatch_parser.add_argument("-s", "--slot", metavar="SLOT", type=int,
help="set the slot that this IOS will install to")