diff --git a/README.md b/README.md index 7cfe9a8..9a65e5d 100644 --- a/README.md +++ b/README.md @@ -39,9 +39,9 @@ _You will need to reinstall the exploit patch to change your region again_ MechaPwn logo will wait until the USB device is ready. -Backup nvram. MechaPwn will backup your console NVRAM data into USB. This will work on any console, so the app can be used for dumping NVRAM. +Backup nvram. MechaPwn will backup your console NVRAM data to the USB device. This will work on any console, so the app can be used for dumping NVRAM. -Information scren. Will show data about your console: Serial number, model ID, real model name, mechacon firmware version and timestamp. If your console is untested or unsupported, MechaPwn will block itself. If you see a message "please report ..." feel free to open an issue and your console data will be tested for compatibility with MechaPwn. +Information screen. Will show data about your console: Serial number, model ID, real model name, mechacon firmware version and timestamp. If your console is untested or unsupported, MechaPwn will block itself. If you see a message "please report ..." feel free to open an issue and your console data will be tested for compatibility with MechaPwn. FMCB check. For slim consoles, MechaPwn will check that FMCB is installed for the US region. Again, please use FMCB cross-region install. If you have a compatible FMCB, this screen will be skipped. @@ -57,7 +57,7 @@ Patch menu. This menu will allow you to keep the current patch, install factory The Dragon[^2]-based MechaCon store configuration flags and patches were encrypted in their EEPROM, and the patch DES key was eventually brute-forced, thus allowing code execution on those units and for the full keystore to be dumped. -Normally, the patch area is write-protected and cannot be written to at runtime except while using PMAP in TEST mode (this requires soldering). Furthermore, the configuration area can only be written to when it is empty. +Normally, the patch area is write-protected and cannot be written to at runtime except while using PMAP in TEST mode (this requires soldering). Furthermore, the configuration area can only be written when it is empty. This is done to prevent an attacker or anyone outside of Sony's factory from overwriting the mechacon configuration. @@ -65,7 +65,7 @@ However, an exploitable bug was found in the WriteConfig function that allows wr ### DSP limitations -1. Burning coils. It is NOT MECHAPWN fault!!! It is a hardware bug, you are risking every time you put the burned disk into FAT[^5] and 70k[^7]. Affects any FAT[^5] and 70k[^7] consoles. If a disc has bad ECC (error correction) data on the error correction area of each sector, there's a chance it may crash the DSP during a read, given that the coils are driven using PWM (pulse width modulation) there's a 50% chance it may crash while the coil is energized. The coil is not designed to receive constant current so it can be damaged. It doesn't crash with silver discs (without scrapes), it **may** crash with burnt discs, it only depends if the ECC data is bogus or not. While this problem is not caused by MechaPwn, our team understands that after MechaPwn you will have more reasons to put burned disks inside. You are warned! The only working fix for preventing this - is `Matrix PIC fix` that shut down the system in case of ECC error. All other passive fixes are not working. The other way for fixing this: replace the DSP chip with some DTL DSP chip (that is marked -1). [More details about Matrix PIC fix](docs/PICfix.md). +1. Burning coils. It is NOT MECHAPWN fault!!! It is a hardware bug, you are risking every time you put the burned disk into FAT[^5] and 70k[^7]. Affects any FAT[^5] and 70k[^7] consoles. If a disc has bad ECC (error correction) data on the error correction area of each sector, there's a chance it may crash the DSP during a read, given that the coils are driven using PWM (pulse width modulation) there's a 50% chance it may crash while the coil is energized. The coil is not designed to receive constant current so it can be damaged. It doesn't crash with silver discs (without scrapes), it **may** crash with burnt discs, it only depends if the ECC data is bogus or not. While this problem is not caused by MechaPwn, our team understands that after MechaPwn you will have more reasons to put burned disks inside. You are warned! The only working fix for preventing this - is `Matrix PIC fix` that shut down the system in case of an ECC error. All other passive fixes are not working. The other way for fixing this: replace the DSP chip with some DTL DSP chip (that is marked -1). [More details about Matrix PIC fix](docs/PICfix.md). 2. DSP does not store disk keys (16 bytes) inside its registers. This only affects retail units, real DTL units do not have this `bug?/feature?` cause DTL units have another DSP chip revision. The mechacon copies disc ID data from the masterdisc sector into the DSP registers and later in CDVDMAN on DTL units. Retail DSP always read back from the disc. This will block MasterPatched disks from running directly from OSD. ## Program Advantages @@ -77,6 +77,7 @@ On all units - Disable disc region checks (ps1 and ps2 discs from all-region as well as masterdiscs mount with data accessible) - Change the region the console reports as, as well as change the disc/KELF region that mechacon allows - Boot burned PS1 backups from the console's original region directly from OSD +- Boot burned PS2 CD disks from the console's original region directly from OSD (without masterpatch) - Boot masterpatched PS2 backups and original PS2 disks from all-region by skipping the logo check (for example, by loading a disc using [wlaunchELF](https://github.com/ps2homebrew/wLaunchELF)) - 70k[^7] and Deckard[^3] only: Change OSD and DVD region - Deckard[^3] only: force NTSC-U region and video mode for PS2/PS1 titles @@ -126,7 +127,7 @@ What it's meant to do is unlock the disk drive for access. #### How to create a master patched disk? -Master patch creation isnt covered by this FAQ. Try to search for *PSX/PS2 Disc Patcher v3.0* or official SONY utilites. +Master patch creation isnt covered by this FAQ. Try to search for *PSX/PS2 Disc Patcher v3.0* or official SONY utilities. #### What are the advantages of use on PSX[^6] DVR units? @@ -135,14 +136,17 @@ PSX DVR units mostly have the same limitations as Japan FAT[^5] consoles, but th ## TODO / Known bugs and limitations / Planned work 70k[^7] consoles with mechacon 6.0 and 6.2 will break DVD Player support (so exploits like FreeDVDPlayer will stop working). 70k[^7] consoles with mechacon 6.4 are not affected by this behavior. -FMCB will bootloop with Force Unlock and burned PS2DVD. +FMCB will bootloop with Force Unlock and PS2DVD. Check NVRAM lens area, for better laser calibration. Collect all possible Model IDs + sticker photo. Develop an app for restoring nvram based on sticker photos. +Improve Force Unlock or implement other patch exploits. ## How does it work -More info about mechacon flags [here](https://playstationdev.wiki/ps2devwiki/index.php/MechaCon#Region_code). Currently, Mechacon Region Code is set to 0x00130000 (bit 16, 17, 20). Patch area, that allows to play with mechacon, described [here](https://playstationdev.wiki/ps2devwiki/index.php/MechaCon#Rom_patch). Region parameters, that are changed on slims, are described [here](https://playstationdev.wiki/ps2devwiki/index.php/MechaCon#Region_params). +More info about mechacon flags [here](https://playstationdev.wiki/ps2devwiki/index.php/MechaCon#Region_code). Currently, Mechacon Region Code is set to 0x00130000 (bit 16, 17, 20) + region bit that matches the console or selected settings. +Patch area, that allows to play with mechacon, described [here](https://playstationdev.wiki/ps2devwiki/index.php/MechaCon#Rom_patch). This area contains sets of encrypted assembler instructions that mechacon applies to itself on console boot. +Region parameters, that are changed on slims, are described [here](https://playstationdev.wiki/ps2devwiki/index.php/MechaCon#Region_params). ## Credits diff --git a/exploit.c b/exploit.c index 6809f43..f8f7608 100644 --- a/exploit.c +++ b/exploit.c @@ -18,6 +18,7 @@ #include #include "mecha.h" +#include "exploit.h" static const uint8_t date500[] = {0x03, 0x01, 0x20, 0x15, 0x28}; // 5.00 (CXR706080-101GG) $Date: 03/01/20 15:28 $ 0x12CBC static const uint8_t date502[] = {0x03, 0x03, 0x05, 0x22, 0x40}; // 5.02 (CXR706080-102GG) $Date: 03/03/05 22:40 $ 0x1316C @@ -455,6 +456,7 @@ static const uint8_t patch612[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFC, 0x39, 0xA0, 0x95, 0x4A, }; + static const uint8_t forceunlock500[] = { 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, 0xff, 0x90, 0xbb, 0x97, 0xd9, 0xda, 0x5f, 0xf3, 0xf2, 0xc2, @@ -816,464 +818,6 @@ static const uint8_t forceunlock612[] = { 0xff, 0x90, 0x9b, 0x8e, 0xfe, 0xff, 0x00, 0x94, }; -/* static const uint8_t zeropatch[] = { - 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, - 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0x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0x95, 0x6D, 0x23, 0xA4, 0xE1, 0x23, 0x57, 0x1C, - 0xCE, 0x8E, 0xD3, 0x2F, 0x1C, 0xC6, 0x55, 0x4B, - 0xCD, 0xFB, 0x5A, 0xEF, 0xD3, 0x9B, 0x3A, 0xD8, - 0xB4, 0x89, 0x9C, 0xB7, 0x72, 0x97, 0x00, 0x27, - 0xBA, 0xDF, 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, - 0xE6, 0xE8, 0x74, 0xDF, 0x39, 0xD0, 0xD5, 0x17, - 0x88, 0xCC, 0xB0, 0x1B, 0x75, 0x1B, 0x05, 0xA5, - 0xD6, 0x21, 0xB0, 0x70, 0xD9, 0xA5, 0x76, 0x8B, - 0x24, 0xB6, 0x09, 0x0C, 0x65, 0x47, 0xF1, 0x05, - 0x7C, 0xD2, 0xB1, 0x82, 0x87, 0xFF, 0x3D, 0xA3, - 0xFC, 0xED, 0x98, 0x4B, 0x96, 0x4F, 0xF8, 0x3F, - 0x32, 0x7C, 0xFA, 0x38, 0x6B, 0x13, 0xC7, 0x69, - 0x9A, 0x24, 0xB3, 0x75, 0x64, 0xC2, 0x39, 0x65, - 0x2D, 0x43, 0x2C, 0x30, 0x15, 0x3D, 0x01, 0xB2, - 0x7D, 0x34, 0x64, 0x66, 0x1F, 0x67, 0x50, 0x20, - 0xC8, 0xB4, 0x13, 0xBD, 0xC9, 0x30, 0x98, 0xFE, - 0xE2, 0xE7, 0x23, 0x07, 0x3E, 0x3A, 0x51, 0xD2, - 0xFF, 0x90, 0xB7, 0x7A, 0xFD, 0xFF, 0x00, 0xE3, -}; -// zeropatch -static const uint8_t orig_patch506[] = { - 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, - 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0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63, 0xC2, 0x1D, 0x5A, 0xD2, 0xDB, 0xB8, 0x00, - 0xC1, 0x60, 0x7C, 0x7B, 0x93, 0x91, 0x2B, 0xAD, - 0x9F, 0x75, 0x1C, 0xA0, 0xDC, 0x16, 0x61, 0xED, - 0xD3, 0xDC, 0x8E, 0x9B, 0x51, 0x81, 0x00, 0x79, - 0xEB, 0x88, 0x53, 0xAE, 0x0D, 0xCC, 0xA7, 0xE2, - 0x10, 0xE3, 0x93, 0x42, 0x97, 0x09, 0x59, 0x1C, - 0xF7, 0x4F, 0x5A, 0x63, 0x3D, 0x8F, 0xA7, 0x39, - 0x78, 0x05, 0xF5, 0x47, 0x0F, 0x99, 0xB0, 0x67, - 0x03, 0x5D, 0x97, 0x7E, 0x14, 0x09, 0x26, 0x26, - 0xBD, 0x3D, 0x9E, 0x18, 0xB1, 0x6E, 0xC1, 0xA3, - 0x68, 0xD8, 0x9B, 0x4E, 0x49, 0x76, 0xD8, 0xA7, - 0xAC, 0x1C, 0xC0, 0xC3, 0xC5, 0x61, 0x77, 0xD6, - 0xB1, 0xAF, 0x70, 0x8C, 0x57, 0xC2, 0xD9, 0x6A, - 0x57, 0xAB, 0xC2, 0x39, 0xDD, 0x61, 0xC8, 0x36, - 0xE6, 0x67, 0x9E, 0x18, 0xB1, 0x6E, 0xC1, 0xA3, - 0x68, 0xD8, 0x29, 0xE5, 0xB8, 0xE5, 0xBD, 0xDE, - 0x78, 0x26, 0xE9, 0x5A, 0xAC, 0xDB, 0x07, 0xF9, - 0x21, 0x59, 0xD3, 0x94, 0xFB, 0xFF, 0x00, 0xAF, -}; -static const uint8_t orig_patch512[] = { - 0x93, 0x85, 0x9A, 0xF5, 0x2B, 0x5B, 0xD1, 0xBD, - 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, - 0x49, 0x9A, 0xE4, 0xAA, 0xE1, 0x5E, 0x67, 0x75, - 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, - 0xDE, 0xA6, 0x9B, 0xE9, 0xD1, 0xD8, 0x45, 0x61, - 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, - 0xE1, 0xFD, 0x79, 0xCB, 0x33, 0xB3, 0x1C, 0x78, - 0x53, 0xFD, 0x10, 0x86, 0x6C, 0x11, 0x4A, 0x3E, - 0xA3, 0xDE, 0x31, 0xBF, 0xD9, 0x23, 0xC1, 0x3D, - 0x8C, 0x5D, 0x05, 0x0D, 0xBF, 0x98, 0x8F, 0x51, - 0x24, 0x0E, 0xB8, 0x08, 0xB5, 0x3C, 0x6A, 0x46, - 0xF0, 0xA7, 0x2E, 0xCF, 0x42, 0xAB, 0x24, 0x25, - 0x09, 0xB4, 0x0E, 0x80, 0xF1, 0xAD, 0xBE, 0x68, - 0x42, 0x80, 0xBE, 0x7E, 0x6A, 0x27, 0x00, 0x18, - 0xFC, 0xF3, 0x2C, 0x8C, 0xB6, 0x6C, 0x5E, 0xBB, - 0x27, 0x06, 0x57, 0xA1, 0x20, 0x14, 0x78, 0x8B, - 0x6F, 0x74, 0xA3, 0x45, 0x18, 0x65, 0x26, 0x2B, - 0x63, 0x1F, 0xE6, 0x28, 0x37, 0x1C, 0x58, 0xC9, - 0x42, 0xD0, 0x90, 0xAD, 0xE9, 0x54, 0x50, 0x4C, - 0x00, 0x57, 0x56, 0x84, 0x68, 0xCA, 0x24, 0xFE, - 0x58, 0x11, 0xB6, 0x42, 0xCD, 0x79, 0xDA, 0x8E, - 0x9F, 0x8C, 0x60, 0xA4, 0xC0, 0xF9, 0x51, 0x3E, - 0x3A, 0xAA, 0x10, 0x17, 0x33, 0xE8, 0x32, 0x4B, - 0xE4, 0x26, 0xC8, 0x22, 0x7B, 0xB5, 0xE5, 0x97, - 0x82, 0xBB, 0x44, 0xEE, 0xB4, 0xFA, 0x66, 0xD8, - 0xD9, 0x06, 0x63, 0x97, 0x97, 0xD5, 0x21, 0x07, - 0x27, 0x1B, 0x9C, 0x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 0x50, 0x4C, 0x00, 0x57, - 0x56, 0x84, 0x68, 0xCA, 0x24, 0xFE, 0x00, 0x73, - 0x58, 0x11, 0xB6, 0x42, 0xCD, 0x79, 0xDA, 0x8E, - 0x9F, 0x8C, 0x60, 0xA4, 0xC0, 0xF9, 0x51, 0x3E, - 0x3A, 0xAA, 0x10, 0x17, 0x33, 0xE8, 0x32, 0x4B, - 0xE4, 0x26, 0xC8, 0x22, 0x7B, 0xB5, 0xE5, 0x97, - 0x82, 0xBB, 0x44, 0xEE, 0xB4, 0xFA, 0x66, 0xD8, - 0xD9, 0x06, 0x63, 0x97, 0x97, 0xD5, 0x21, 0x07, - 0x27, 0x1B, 0x9C, 0x53, 0x81, 0xE1, 0x65, 0x71, - 0xEC, 0x7C, 0x01, 0x51, 0xF5, 0xCD, 0x70, 0xA6, - 0xA3, 0x84, 0x4F, 0x12, 0x33, 0xFE, 0xE2, 0x4C, - 0x64, 0xC9, 0xD8, 0x07, 0x7E, 0x15, 0xE8, 0xE8, - 0xF1, 0x41, 0x28, 0xB4, 0x03, 0x5A, 0xEB, 0x2D, - 0x1A, 0xE6, 0x9B, 0x33, 0xE2, 0x12, 0x0C, 0x58, - 0xD1, 0xB3, 0xBD, 0x26, 0xC9, 0xED, 0x1A, 0xBB, - 0xBD, 0x7E, 0x87, 0xA9, 0xFD, 0xFF, 0x00, 0x1B, -}; -static const uint8_t orig_patch602[] = { - 0xDB, 0xC8, 0x71, 0x2D, 0xA6, 0x01, 0x85, 0x03, - 0x0F, 0xBD, 0x85, 0x53, 0x5F, 0x34, 0xE7, 0x99, - 0xF0, 0xA5, 0x3B, 0xCE, 0xA7, 0x38, 0xA7, 0x4E, - 0xF1, 0xB1, 0x46, 0x0D, 0x7B, 0xC1, 0xA3, 0xFE, - 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, - 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, - 0x51, 0x72, 0x45, 0xC3, 0xBD, 0x7B, 0x89, 0xEF, - 0x61, 0xE9, 0xD1, 0xB0, 0x81, 0x48, 0xF5, 0xEC, - 0xEC, 0x4A, 0x95, 0x55, 0x80, 0xC4, 0xAC, 0x4E, - 0x61, 0xE9, 0xD1, 0xB0, 0x81, 0x48, 0xF5, 0xEC, - 0xA8, 0xD3, 0xE2, 0xB6, 0x62, 0xDA, 0x9C, 0x9F, - 0x61, 0xE9, 0xD1, 0xB0, 0x81, 0x48, 0xF5, 0xEC, - 0xD5, 0xE6, 0x2B, 0x93, 0x91, 0x5B, 0x98, 0xCB, - 0xAB, 0xE4, 0x8A, 0xE3, 0xF0, 0xCD, 0x00, 0x35, - 0x12, 0x90, 0xBC, 0xE5, 0xF2, 0x77, 0x19, 0xE3, - 0x8F, 0x17, 0x55, 0xD7, 0xDB, 0x89, 0xA1, 0xCD, - 0x9A, 0xC7, 0x30, 0x50, 0x8A, 0x96, 0x5C, 0x3C, - 0x40, 0x8C, 0x9E, 0xFA, 0xAB, 0x87, 0x02, 0xF6, - 0xFE, 0x12, 0xB4, 0x98, 0xD3, 0xC6, 0x60, 0x9E, - 0x21, 0x69, 0x5C, 0xCF, 0xCC, 0xFD, 0x1E, 0x00, - 0xB2, 0x36, 0x4E, 0x57, 0x32, 0x2A, 0x4C, 0x69, - 0xD4, 0x8A, 0x64, 0xA7, 0x34, 0xA3, 0xAB, 0x46, - 0x04, 0x26, 0x55, 0xD7, 0xDB, 0x89, 0xA1, 0xCD, - 0x9A, 0xC7, 0x51, 0x69, 0xFB, 0xEE, 0x98, 0xFC, - 0x5A, 0x25, 0x44, 0x05, 0xE5, 0x9A, 0x8A, 0x84, - 0x80, 0x30, 0xB6, 0x48, 0xD8, 0x48, 0xE9, 0x43, - 0x59, 0xAD, 0x41, 0xD8, 0xE8, 0xD9, 0x1F, 0x4E, - 0x1C, 0x10, 0x8F, 0x17, 0xF6, 0xFF, 0x00, 0x0B, -}; -static const uint8_t orig_patch604[] = { - 0x67, 0xC3, 0x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 0x6A, 0x31, 0x07, 0x5D, - 0x2C, 0x8C, 0xB6, 0x6C, 0x5E, 0xBB, 0x27, 0x06, - 0x57, 0xA1, 0x20, 0x14, 0x78, 0x8B, 0x6F, 0x74, - 0xA3, 0x45, 0x18, 0x65, 0x26, 0x2B, 0x63, 0x1F, - 0xE6, 0x28, 0x37, 0x1C, 0x58, 0xC9, 0x42, 0xD0, - 0x90, 0xAD, 0xE9, 0x54, 0x50, 0x4C, 0x00, 0x5D, - 0x00, 0x57, 0x56, 0x84, 0x68, 0xCA, 0x24, 0xFE, - 0x58, 0x11, 0xB6, 0x42, 0xCD, 0x79, 0xDA, 0x8E, - 0x9F, 0x8C, 0x60, 0xA4, 0xC0, 0xF9, 0x51, 0x3E, - 0x3A, 0xAA, 0x10, 0x17, 0x33, 0xE8, 0x32, 0x4B, - 0xE4, 0x26, 0xC8, 0x22, 0x7B, 0xB5, 0xE5, 0x97, - 0x82, 0xBB, 0x44, 0xEE, 0xB4, 0xFA, 0x66, 0xD8, - 0xD9, 0x06, 0x63, 0x97, 0x97, 0xD5, 0x21, 0x07, - 0x27, 0x1B, 0x9C, 0x53, 0x81, 0xE1, 0x65, 0x71, - 0xEC, 0x7C, 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, - 0xFF, 0x90, 0x99, 0x8D, 0x68, 0x58, 0x75, 0x96, - 0x92, 0x46, 0x1F, 0xC5, 0x2B, 0xBB, 0x6A, 0x31, - 0x07, 0x5D, 0x2C, 0x8C, 0xB6, 0x6C, 0x5E, 0xBB, - 0x27, 0x06, 0x57, 0xA1, 0x20, 0x14, 0x78, 0x8B, - 0x6F, 0x74, 0x3F, 0x4B, 0xFE, 0xFF, 0x00, 0xBF, -}; -// zeropatch -static const uint8_t orig_patch612[] = { - 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, - 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, - 0xFF, 0xFF, 0xFF, 0xFF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 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, -}; - // clang-format on const uint8_t *getOrigPatch(uint8_t *build_date) @@ -1297,7 +841,7 @@ const uint8_t *getOrigPatch(uint8_t *build_date) else if (memcmp(build_date, date600, 5) == 0) return orig_patch600; else if (memcmp(build_date, date602, 5) == 0) - return orig_patch602; + return orig_patch602_B; /* orig_patch602_A check manually */ else if (memcmp(build_date, date604, 5) == 0) return orig_patch604; else if (memcmp(build_date, date606, 5) == 0) @@ -1356,12 +900,12 @@ const uint8_t *getForceUnlock(uint8_t *build_date) return forceunlock506; else if (memcmp(build_date, date506mx, 5) == 0) return forceunlock506mx; - /*else if (memcmp(build_date, date510, 5) == 0) - return forceunlock510;*/ + /* else if (memcmp(build_date, date510, 5) == 0) + return forceunlock510; */ else if (memcmp(build_date, date512, 5) == 0) return forceunlock512; - /*else if (memcmp(build_date, date514, 5) == 0) - return forceunlock514;*/ + /* else if (memcmp(build_date, date514, 5) == 0) + return forceunlock514; */ else if (memcmp(build_date, date600, 5) == 0) return forceunlock600; else if (memcmp(build_date, date602, 5) == 0) diff --git a/exploit.h b/exploit.h index 2588ed6..be99da3 100644 --- a/exploit.h +++ b/exploit.h @@ -19,6 +19,434 @@ const uint8_t *getPatch(uint8_t *build_date); const uint8_t *getForceUnlock(uint8_t *build_date); char installPatch(const uint8_t *patch); +// clang-format off + +/* static const uint8_t zeropatch[] = { + 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, + 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, + 0xFF, 0xFF, 0xFF,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 0x57, 0xAB, 0xC2, 0x39, 0xDD, 0x61, 0xC8, 0x36, + 0xE6, 0x67, 0x9E, 0x18, 0xB1, 0x6E, 0xC1, 0xA3, + 0x68, 0xD8, 0x29, 0xE5, 0xB8, 0xE5, 0xBD, 0xDE, + 0x78, 0x26, 0xE9, 0x5A, 0xAC, 0xDB, 0x07, 0xF9, + 0x21, 0x59, 0xD3, 0x94, 0xFB, 0xFF, 0x00, 0xAF, +}; +static const uint8_t orig_patch512[] = { + 0x93, 0x85, 0x9A, 0xF5, 0x2B, 0x5B, 0xD1, 0xBD, + 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, + 0x49, 0x9A, 0xE4, 0xAA, 0xE1, 0x5E, 0x67, 0x75, + 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, + 0xDE, 0xA6, 0x9B, 0xE9, 0xD1, 0xD8, 0x45, 0x61, + 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, + 0xE1, 0xFD, 0x79, 0xCB, 0x33, 0xB3, 0x1C, 0x78, + 0x53, 0xFD, 0x10, 0x86, 0x6C, 0x11, 0x4A, 0x3E, + 0xA3, 0xDE, 0x31, 0xBF, 0xD9, 0x23, 0xC1, 0x3D, + 0x8C, 0x5D, 0x05, 0x0D, 0xBF, 0x98, 0x8F, 0x51, + 0x24, 0x0E, 0xB8, 0x08, 0xB5, 0x3C, 0x6A, 0x46, + 0xF0, 0xA7, 0x2E, 0xCF, 0x42, 0xAB, 0x24, 0x25, + 0x09, 0xB4, 0x0E, 0x80, 0xF1, 0xAD, 0xBE, 0x68, + 0x42, 0x80, 0xBE, 0x7E, 0x6A, 0x27, 0x00, 0x18, + 0xFC, 0xF3, 0x2C, 0x8C, 0xB6, 0x6C, 0x5E, 0xBB, + 0x27, 0x06, 0x57, 0xA1, 0x20, 0x14, 0x78, 0x8B, + 0x6F, 0x74, 0xA3, 0x45, 0x18, 0x65, 0x26, 0x2B, + 0x63, 0x1F, 0xE6, 0x28, 0x37, 0x1C, 0x58, 0xC9, + 0x42, 0xD0, 0x90, 0xAD, 0xE9, 0x54, 0x50, 0x4C, + 0x00, 0x57, 0x56, 0x84, 0x68, 0xCA, 0x24, 0xFE, + 0x58, 0x11, 0xB6, 0x42, 0xCD, 0x79, 0xDA, 0x8E, + 0x9F, 0x8C, 0x60, 0xA4, 0xC0, 0xF9, 0x51, 0x3E, + 0x3A, 0xAA, 0x10, 0x17, 0x33, 0xE8, 0x32, 0x4B, + 0xE4, 0x26, 0xC8, 0x22, 0x7B, 0xB5, 0xE5, 0x97, + 0x82, 0xBB, 0x44, 0xEE, 0xB4, 0xFA, 0x66, 0xD8, + 0xD9, 0x06, 0x63, 0x97, 0x97, 0xD5, 0x21, 0x07, + 0x27, 0x1B, 0x9C, 0x53, 0x81, 0xE1, 0x65, 0x71, + 0xEC, 0x7C, 0x63, 0x66, 0xFE, 0xFF, 0x00, 0x4F, +}; +// zeropatch +static const uint8_t orig_patch514[] = { + 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, + 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xF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19, + 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, + 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, + 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, + 0x99, 0x8D, 0x68, 0x58, 0x75, 0x96, 0x92, 0x46, + 0x1F, 0xC5, 0x2B, 0xBB, 0x6A, 0x31, 0x07, 0x5D, + 0x2C, 0x8C, 0xB6, 0x6C, 0x5E, 0xBB, 0x27, 0x06, + 0x57, 0xA1, 0x20, 0x14, 0x78, 0x8B, 0x6F, 0x74, + 0xA3, 0x45, 0x18, 0x65, 0x26, 0x2B, 0x63, 0x1F, + 0xE6, 0x28, 0x37, 0x1C, 0x58, 0xC9, 0x42, 0xD0, + 0x90, 0xAD, 0xE9, 0x54, 0x50, 0x4C, 0x00, 0x57, + 0x56, 0x84, 0x68, 0xCA, 0x24, 0xFE, 0x00, 0x73, + 0x58, 0x11, 0xB6, 0x42, 0xCD, 0x79, 0xDA, 0x8E, + 0x9F, 0x8C, 0x60, 0xA4, 0xC0, 0xF9, 0x51, 0x3E, + 0x3A, 0xAA, 0x10, 0x17, 0x33, 0xE8, 0x32, 0x4B, + 0xE4, 0x26, 0xC8, 0x22, 0x7B, 0xB5, 0xE5, 0x97, + 0x82, 0xBB, 0x44, 0xEE, 0xB4, 0xFA, 0x66, 0xD8, + 0xD9, 0x06, 0x63, 0x97, 0x97, 0xD5, 0x21, 0x07, + 0x27, 0x1B, 0x9C, 0x53, 0x81, 0xE1, 0x65, 0x71, + 0xEC, 0x7C, 0x01, 0x51, 0xF5, 0xCD, 0x70, 0xA6, + 0xA3, 0x84, 0x4F, 0x12, 0x33, 0xFE, 0xE2, 0x4C, + 0x64, 0xC9, 0xD8, 0x07, 0x7E, 0x15, 0xE8, 0xE8, + 0xF1, 0x41, 0x28, 0xB4, 0x03, 0x5A, 0xEB, 0x2D, + 0x1A, 0xE6, 0x9B, 0x33, 0xE2, 0x12, 0x0C, 0x58, + 0xD1, 0xB3, 0xBD, 0x26, 0xC9, 0xED, 0x1A, 0xBB, + 0xBD, 0x7E, 0x87, 0xA9, 0xFD, 0xFF, 0x00, 0x1B, +}; +static const uint8_t orig_patch602_A[] = { + 0x00, 0xC6, 0x58, 0xEE, 0x14, 0x41, 0x00, 0x09, + 0xD4, 0x65, 0xD7, 0x17, 0x3F, 0x36, 0x9F, 0x1A, + 0x27, 0x3C, 0x9C, 0xDD, 0xBA, 0xFB, 0x9C, 0x4C, + 0xD4, 0xDA, 0xBC, 0x52, 0xC2, 0xB0, 0x80, 0xB7, + 0x46, 0x5C, 0x65, 0xAA, 0x3F, 0x93, 0xBA, 0x4D, + 0x17, 0x20, 0xFF, 0xB5, 0x08, 0x96, 0x54, 0xA1, + 0xCF, 0x5B, 0x38, 0x97, 0x73, 0x72, 0x1F, 0x94, + 0x31, 0x1C, 0xD8, 0x03, 0xF1, 0xB2, 0xA5, 0x0C, + 0x86, 0xF9, 0x88, 0xA2, 0x82, 0x71, 0xD0, 0xA8, + 0x1B, 0x55, 0x10, 0xFA, 0x6C, 0xC5, 0x43, 0x2F, + 0x2D, 0xE6, 0x1F, 0x48, 0xC4, 0x2F, 0x60, 0x2B, + 0x65, 0x9F, 0x05, 0x50, 0xD1, 0x41, 0x34, 0x36, + 0x17, 0xB6, 0x15, 0x77, 0xBE, 0x1E, 0x8F, 0x8C, + 0x40, 0x9E, 0x4B, 0x66, 0x28, 0x64, 0x00, 0xE4, + 0x55, 0x97, 0xA2, 0xFE, 0xC8, 0x5C, 0xEA, 0x6F, + 0x74, 0xF2, 0xE7, 0x78, 0x98, 0xEE, 0x3B, 0xF1, + 0x35, 0x1A, 0x9B, 0xE0, 0x3A, 0xBB, 0x1B, 0x03, + 0xDA, 0xC4, 0xF8, 0xB4, 0x6B, 0x92, 0x2A, 0xBD, + 0x8C, 0x84, 0x86, 0xAB, 0x3A, 0xE0, 0x95, 0x60, + 0x1A, 0x54, 0xF8, 0xB4, 0x6B, 0x92, 0x2A, 0xBD, + 0x8C, 0x84, 0x8F, 0xA8, 0x42, 0x47, 0x6B, 0x31, + 0x65, 0x6C, 0xD9, 0x48, 0xA9, 0x6B, 0x32, 0xE3, + 0x98, 0xD8, 0x6E, 0x8C, 0x7E, 0xC5, 0xEC, 0x41, + 0xBE, 0x6A, 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, + 0xFF, 0x90, 0x99, 0x8D, 0x68, 0x58, 0x75, 0x96, + 0x92, 0x46, 0x1F, 0xC5, 0x2B, 0xBB, 0x6A, 0x31, + 0x07, 0x5D, 0x2C, 0x8C, 0xB6, 0x6C, 0x5E, 0xBB, + 0x27, 0x06, 0x63, 0x7C, 0xFE, 0xFF, 0x00, 0x01, +}; +static const uint8_t orig_patch602_B[] = { + 0xDB, 0xC8, 0x71, 0x2D, 0xA6, 0x01, 0x85, 0x03, + 0x0F, 0xBD, 0x85, 0x53, 0x5F, 0x34, 0xE7, 0x99, + 0xF0, 0xA5, 0x3B, 0xCE, 0xA7, 0x38, 0xA7, 0x4E, + 0xF1, 0xB1, 0x46, 0x0D, 0x7B, 0xC1, 0xA3, 0xFE, + 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, + 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, + 0x51, 0x72, 0x45, 0xC3, 0xBD, 0x7B, 0x89, 0xEF, + 0x61, 0xE9, 0xD1, 0xB0, 0x81, 0x48, 0xF5, 0xEC, + 0xEC, 0x4A, 0x95, 0x55, 0x80, 0xC4, 0xAC, 0x4E, + 0x61, 0xE9, 0xD1, 0xB0, 0x81, 0x48, 0xF5, 0xEC, + 0xA8, 0xD3, 0xE2, 0xB6, 0x62, 0xDA, 0x9C, 0x9F, + 0x61, 0xE9, 0xD1, 0xB0, 0x81, 0x48, 0xF5, 0xEC, + 0xD5, 0xE6, 0x2B, 0x93, 0x91, 0x5B, 0x98, 0xCB, + 0xAB, 0xE4, 0x8A, 0xE3, 0xF0, 0xCD, 0x00, 0x35, + 0x12, 0x90, 0xBC, 0xE5, 0xF2, 0x77, 0x19, 0xE3, + 0x8F, 0x17, 0x55, 0xD7, 0xDB, 0x89, 0xA1, 0xCD, + 0x9A, 0xC7, 0x30, 0x50, 0x8A, 0x96, 0x5C, 0x3C, + 0x40, 0x8C, 0x9E, 0xFA, 0xAB, 0x87, 0x02, 0xF6, + 0xFE, 0x12, 0xB4, 0x98, 0xD3, 0xC6, 0x60, 0x9E, + 0x21, 0x69, 0x5C, 0xCF, 0xCC, 0xFD, 0x1E, 0x00, + 0xB2, 0x36, 0x4E, 0x57, 0x32, 0x2A, 0x4C, 0x69, + 0xD4, 0x8A, 0x64, 0xA7, 0x34, 0xA3, 0xAB, 0x46, + 0x04, 0x26, 0x55, 0xD7, 0xDB, 0x89, 0xA1, 0xCD, + 0x9A, 0xC7, 0x51, 0x69, 0xFB, 0xEE, 0x98, 0xFC, + 0x5A, 0x25, 0x44, 0x05, 0xE5, 0x9A, 0x8A, 0x84, + 0x80, 0x30, 0xB6, 0x48, 0xD8, 0x48, 0xE9, 0x43, + 0x59, 0xAD, 0x41, 0xD8, 0xE8, 0xD9, 0x1F, 0x4E, + 0x1C, 0x10, 0x8F, 0x17, 0xF6, 0xFF, 0x00, 0x0B, +}; +static const uint8_t orig_patch604[] = { + 0x67, 0xC3, 0x40, 0x93, 0xEC, 0x8A, 0x9F, 0x9C, + 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, + 0x8D, 0x2B, 0x96, 0x7E, 0xFA, 0xEB, 0x6E, 0x1F, + 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, + 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, + 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, + 0xD2, 0x0B, 0x46, 0xE1, 0xC1, 0x27, 0x4A, 0x2B, + 0x1C, 0xB2, 0x0C, 0xF3, 0xAA, 0x23, 0x7C, 0x09, + 0xE7, 0x9C, 0xE7, 0xBD, 0xE7, 0xF3, 0xD8, 0xFE, + 0x44, 0x96, 0x15, 0xE9, 0x42, 0xF4, 0xC5, 0x7B, + 0xB6, 0x3D, 0xB7, 0x98, 0xCC, 0x5C, 0xB3, 0x71, + 0x52, 0x4E, 0x81, 0xB0, 0x0A, 0x0C, 0xB8, 0x9D, + 0x65, 0xB3, 0xA4, 0xD3, 0xD6, 0x09, 0xBA, 0x57, + 0x50, 0x23, 0x3D, 0x3B, 0xE3, 0x80, 0x00, 0x9F, + 0x3C, 0x67, 0x7A, 0xAC, 0x44, 0x77, 0xAA, 0x93, + 0xAD, 0x13, 0x99, 0x8D, 0x68, 0x58, 0x75, 0x96, + 0x92, 0x46, 0x1F, 0xC5, 0x2B, 0xBB, 0x6A, 0x31, + 0x07, 0x5D, 0x2C, 0x8C, 0xB6, 0x6C, 0x5E, 0xBB, + 0x27, 0x06, 0x57, 0xA1, 0x20, 0x14, 0x78, 0x8B, + 0x6F, 0x74, 0xA3, 0x45, 0x18, 0x65, 0x26, 0x2B, + 0x63, 0x1F, 0xE6, 0x28, 0x37, 0x1C, 0x58, 0xC9, + 0x42, 0xD0, 0x90, 0xAD, 0xE9, 0x54, 0x50, 0x4C, + 0x00, 0x57, 0x56, 0x84, 0x68, 0xCA, 0x24, 0xFE, + 0x58, 0x11, 0xB6, 0x42, 0xCD, 0x79, 0xDA, 0x8E, + 0x9F, 0x8C, 0x60, 0xA4, 0xC0, 0xF9, 0x51, 0x3E, + 0x3A, 0xAA, 0x10, 0x17, 0x33, 0xE8, 0x32, 0x4B, + 0xE4, 0x26, 0xC8, 0x22, 0x7B, 0xB5, 0xE5, 0x97, + 0x82, 0xBB, 0xCB, 0xD9, 0xFD, 0xFF, 0x00, 0xAD, +}; +// zeropatch +static const uint8_t orig_patch606[] = { + 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0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0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, +}; static const uint8_t orig_patch610_A[] = { 0x7E, 0xAC, 0x5F, 0xB3, 0x78, 0x19, 0xA2, 0x10, 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, @@ -49,3 +477,66 @@ static const uint8_t orig_patch610_A[] = { 0x27, 0x06, 0x57, 0xA1, 0x20, 0x14, 0x78, 0x8B, 0x6F, 0x74, 0x7F, 0xEE, 0xFD, 0xFF, 0x00, 0xDD, }; +static const uint8_t orig_patch610_B[] = { + 0xA4, 0xDB, 0xE6, 0x0E, 0x1A, 0xC1, 0x36, 0x88, + 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, + 0x5E, 0xC6, 0x19, 0x85, 0x71, 0x20, 0x46, 0x11, + 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, + 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, + 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, + 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, + 0x99, 0x8D, 0x68, 0x58, 0x75, 0x96, 0x92, 0x46, + 0x1F, 0xC5, 0x2B, 0xBB, 0x6A, 0x31, 0x07, 0x5D, + 0x2C, 0x8C, 0xB6, 0x6C, 0x5E, 0xBB, 0x27, 0x06, + 0x57, 0xA1, 0x20, 0x14, 0x78, 0x8B, 0x6F, 0x74, + 0xA3, 0x45, 0x18, 0x65, 0x26, 0x2B, 0x63, 0x1F, + 0xE6, 0x28, 0x37, 0x1C, 0x58, 0xC9, 0x42, 0xD0, + 0x90, 0xAD, 0xE9, 0x54, 0x50, 0x4C, 0x00, 0x5D, + 0x00, 0x57, 0x56, 0x84, 0x68, 0xCA, 0x24, 0xFE, + 0x58, 0x11, 0xB6, 0x42, 0xCD, 0x79, 0xDA, 0x8E, + 0x9F, 0x8C, 0x60, 0xA4, 0xC0, 0xF9, 0x51, 0x3E, + 0x3A, 0xAA, 0x10, 0x17, 0x33, 0xE8, 0x32, 0x4B, + 0xE4, 0x26, 0xC8, 0x22, 0x7B, 0xB5, 0xE5, 0x97, + 0x82, 0xBB, 0x44, 0xEE, 0xB4, 0xFA, 0x66, 0xD8, + 0xD9, 0x06, 0x63, 0x97, 0x97, 0xD5, 0x21, 0x07, + 0x27, 0x1B, 0x9C, 0x53, 0x81, 0xE1, 0x65, 0x71, + 0xEC, 0x7C, 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, + 0xFF, 0x90, 0x99, 0x8D, 0x68, 0x58, 0x75, 0x96, + 0x92, 0x46, 0x1F, 0xC5, 0x2B, 0xBB, 0x6A, 0x31, + 0x07, 0x5D, 0x2C, 0x8C, 0xB6, 0x6C, 0x5E, 0xBB, + 0x27, 0x06, 0x57, 0xA1, 0x20, 0x14, 0x78, 0x8B, + 0x6F, 0x74, 0x3F, 0x4B, 0xFE, 0xFF, 0x00, 0xBF, +}; +// zeropatch +static const uint8_t orig_patch612[] = { + 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, + 0x03, 0xDC, 0xCD, 0x7D, 0xD3, 0x83, 0xFF, 0x90, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, +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xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, +}; + +// clang-format on diff --git a/main.c b/main.c index b0f30ae..d762de9 100644 --- a/main.c +++ b/main.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include