diff --git a/exploit.c b/exploit.c index 90b4938..c126d37 100644 --- a/exploit.c +++ b/exploit.c @@ -489,6 +489,401 @@ const uint8_t *getPatch(uint8_t *build_date) return 0; } +static const uint8_t forceunlock500[] = { + 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, 0xff, 0x90, + 0xbb, 0x97, 0xd9, 0xda, 0x5f, 0xf3, 0xf2, 0xc2, + 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, 0xff, 0x90, + 0x52, 0x93, 0xeb, 0x18, 0xd8, 0xb8, 0x78, 0x24, + 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, + 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, + 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, 0xff, 0x90, + 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, 0x00, 0xc7, + 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, 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, 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, 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, + 0xff, 0x90, 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, + 0xff, 0x90, 0xdf, 0x94, 0xfe, 0xff, 0x00, 0x4a, +}; +static const uint8_t forceunlock502[] = { + 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, 0xff, 0x90, + 0xc0, 0xb5, 0x2c, 0x29, 0x11, 0x56, 0x52, 0x9a, + 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, 0xff, 0x90, + 0x1f, 0x47, 0x1a, 0x01, 0x34, 0xb2, 0x38, 0x89, + 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, + 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, + 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, 0xff, 0x90, + 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, 0x00, 0xa1, + 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, 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, 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, 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, + 0xff, 0x90, 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, + 0xff, 0x90, 0x07, 0x91, 0xfe, 0xff, 0x00, 0x25, +}; +static const uint8_t forceunlock504[] = { + 0xb1, 0xea, 0x8b, 0xc0, 0xc8, 0x19, 0x84, 0x35, + 0x25, 0x75, 0xde, 0x2e, 0x26, 0xc9, 0x24, 0xae, + 0xa6, 0x84, 0x83, 0x24, 0xdd, 0xf6, 0x9a, 0xeb, + 0x1f, 0x47, 0x1a, 0x01, 0x34, 0xb2, 0x38, 0x89, + 0x61, 0x7d, 0x23, 0xa3, 0x51, 0x05, 0x4e, 0x8c, + 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, 0xff, 0x90, + 0x2e, 0xa7, 0xea, 0x33, 0x14, 0xad, 0x99, 0xd4, + 0x5d, 0xa6, 0x0d, 0xcc, 0xd7, 0x1b, 0x3d, 0x78, + 0xcb, 0x27, 0x51, 0xb4, 0x85, 0x40, 0xf0, 0x96, + 0xb6, 0xda, 0xef, 0x69, 0x9d, 0x96, 0x4b, 0x9c, + 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, 0xb4, + 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, 0x97, 0x0b, 0xfc, 0xff, 0x00, 0x73, +}; +static const uint8_t forceunlock506[] = { + 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, 0xff, 0x90, + 0x25, 0x75, 0xde, 0x2e, 0x26, 0xc9, 0x24, 0xae, + 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, 0xff, 0x90, + 0x1f, 0x47, 0x1a, 0x01, 0x34, 0xb2, 0x38, 0x89, + 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, + 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, + 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, 0xff, 0x90, + 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, 0x00, 0x57, + 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, 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, 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, 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, + 0xff, 0x90, 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, + 0xff, 0x90, 0xdf, 0x90, 0xfe, 0xff, 0x00, 0x4e, +}; +static const uint8_t forceunlock506mx[] = { + 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, 0xff, 0x90, + 0x27, 0xb7, 0x8c, 0xfa, 0x3d, 0x36, 0x03, 0xa4, + 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, 0xff, 0x90, + 0x1f, 0x47, 0x1a, 0x01, 0x34, 0xb2, 0x38, 0x89, + 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, + 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, + 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, 0xff, 0x90, + 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, 0x00, 0x40, + 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, 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, 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, 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, + 0xff, 0x90, 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, + 0xff, 0x90, 0x37, 0x91, 0xfe, 0xff, 0x00, 0xf5, +}; +static const uint8_t forceunlock512[] = { + 0x93, 0x85, 0x9a, 0xf5, 0x2b, 0x5b, 0xd1, 0xbd, + 0x06, 0xd7, 0x3d, 0xf7, 0x18, 0xc1, 0x8e, 0xe4, + 0x49, 0x9a, 0xe4, 0xaa, 0xe1, 0x5e, 0x67, 0x75, + 0x1f, 0x47, 0x1a, 0x01, 0x34, 0xb2, 0x38, 0x89, + 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, 0xb0, + 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, 0x0b, 0xf7, 0xfc, 0xff, 0x00, 0x18, +}; +static const uint8_t forceunlock600[] = { + 0x4d, 0xa2, 0x75, 0x84, 0x97, 0x31, 0x0b, 0x48, + 0x68, 0x8e, 0x58, 0x03, 0x40, 0xa1, 0x72, 0x8a, + 0x00, 0x08, 0x3d, 0x86, 0x52, 0xe1, 0x0f, 0x19, + 0x1f, 0x47, 0x1a, 0x01, 0x34, 0xb2, 0x38, 0x89, + 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, 0x39, + 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, 0x27, 0x43, 0xfc, 0xff, 0x00, 0xe2, +}; +static const uint8_t forceunlock602[] = { + 0x6c, 0x03, 0xf2, 0x1f, 0xe7, 0x37, 0x4b, 0x3a, + 0xc5, 0x12, 0x0e, 0x8a, 0x97, 0x64, 0x69, 0x2c, + 0xc4, 0xe7, 0x37, 0x73, 0xaf, 0xaf, 0x07, 0x8e, + 0x4d, 0x83, 0x76, 0x8c, 0xcb, 0x01, 0xd0, 0x98, + 0x17, 0x20, 0xff, 0xb5, 0x08, 0x96, 0x54, 0xa1, + 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, 0xff, 0x90, + 0xb7, 0x5e, 0xe9, 0xbf, 0xe5, 0xff, 0xe9, 0x35, + 0x22, 0x79, 0xe7, 0x0f, 0x4f, 0xa6, 0x4e, 0xf2, + 0x34, 0x26, 0x6d, 0xd9, 0xbe, 0xc0, 0x7f, 0xd5, + 0x8e, 0x7f, 0x30, 0x03, 0x57, 0x74, 0xda, 0xf5, + 0xf2, 0x9f, 0x32, 0x24, 0x48, 0xeb, 0xa8, 0x34, + 0xf9, 0xba, 0x68, 0xc9, 0x17, 0x18, 0x7d, 0x5e, + 0x88, 0x56, 0xa6, 0xce, 0x4f, 0x37, 0x0e, 0x29, + 0x59, 0x8d, 0xf9, 0xc8, 0x1c, 0xa8, 0x00, 0xd4, + 0x12, 0x62, 0xc2, 0x68, 0x4b, 0x1f, 0xdf, 0x08, + 0x67, 0x40, 0x8e, 0x35, 0x88, 0xfa, 0xda, 0x5c, + 0x42, 0x1c, 0x45, 0x1e, 0xa5, 0x79, 0x75, 0x94, + 0x01, 0xaf, 0x06, 0x5f, 0x89, 0x0f, 0xfa, 0x9b, + 0xcd, 0x60, 0x7d, 0x1d, 0x26, 0x4d, 0xd5, 0xd4, + 0xfa, 0xf2, 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, 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, 0xd7, 0x1d, 0xfe, 0xff, 0x00, 0x94, +}; +static const uint8_t forceunlock604[] = { + 0x67, 0xc3, 0x40, 0x93, 0xec, 0x8a, 0x9f, 0x9c, + 0xd6, 0x52, 0x68, 0xaa, 0x91, 0x65, 0x03, 0x41, + 0x8d, 0x2b, 0x96, 0x7e, 0xfa, 0xeb, 0x6e, 0x1f, + 0x4d, 0x83, 0x76, 0x8c, 0xcb, 0x01, 0xd0, 0x98, + 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, 0x41, + 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, 0xd7, 0x6a, 0xfc, 0xff, 0x00, 0x11, +}; +static const uint8_t forceunlock606[] = { + 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, 0xff, 0x90, + 0x37, 0x3f, 0xc9, 0x9f, 0x54, 0xd7, 0x20, 0x05, + 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, 0xff, 0x90, + 0x4d, 0x83, 0x76, 0x8c, 0xcb, 0x01, 0xd0, 0x98, + 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, + 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, + 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, 0xff, 0x90, + 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, 0x00, 0xb2, + 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, 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, 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, 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, + 0xff, 0x90, 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, + 0xff, 0x90, 0x83, 0x8e, 0xfe, 0xff, 0x00, 0xac, +}; +static const uint8_t forceunlock610[] = { + 0xa4, 0xdb, 0xe6, 0x0e, 0x1a, 0xc1, 0x36, 0x88, + 0x53, 0xb8, 0xfb, 0x3c, 0xf0, 0x62, 0xea, 0x03, + 0x5e, 0xc6, 0x19, 0x85, 0x71, 0x20, 0x46, 0x11, + 0x4d, 0x83, 0x76, 0x8c, 0xcb, 0x01, 0xd0, 0x98, + 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, 0xf2, + 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, 0xfb, 0xd8, 0xfc, 0xff, 0x00, 0x78, +}; +static const uint8_t forceunlock612[] = { + 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, 0xff, 0x90, + 0xbe, 0x32, 0x61, 0xa8, 0x96, 0xa8, 0xfa, 0xc0, + 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, 0xff, 0x90, + 0x4d, 0x83, 0x76, 0x8c, 0xcb, 0x01, 0xd0, 0x98, + 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, + 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, + 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, 0xff, 0x90, + 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, 0x00, 0xef, + 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, 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, 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, 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, + 0xff, 0x90, 0x03, 0xdc, 0xcd, 0x7d, 0xd3, 0x83, + 0xff, 0x90, 0x9b, 0x8e, 0xfe, 0xff, 0x00, 0x94, +}; + +const uint8_t *getForceUnlock(uint8_t *build_date) +{ + if (memcmp(build_date, date500, 5) == 0) + return forceunlock500; + else if (memcmp(build_date, date502, 5) == 0) + return forceunlock502; + else if (memcmp(build_date, date504, 5) == 0) + return forceunlock504; + else if (memcmp(build_date, date506, 5) == 0) + 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, date512, 5) == 0) + return forceunlock512; + /*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) + return forceunlock602; + else if (memcmp(build_date, date604, 5) == 0) + return forceunlock604; + else if (memcmp(build_date, date606, 5) == 0) + return forceunlock606; + else if (memcmp(build_date, date610, 5) == 0) + return forceunlock610; + else if (memcmp(build_date, date612, 5) == 0) + return forceunlock612; + + return 0; +} + char installPatch(const uint8_t *patch) { if (!OpenConfig(1, 0, 7)) diff --git a/exploit.h b/exploit.h index ac5c4e7..d6fe5bd 100644 --- a/exploit.h +++ b/exploit.h @@ -15,4 +15,5 @@ */ const uint8_t *getPatch(uint8_t *build_date); +const uint8_t *getForceUnlock(uint8_t *build_date); char installPatch(const uint8_t *patch); diff --git a/main.c b/main.c index 76c32db..f69ad4c 100644 --- a/main.c +++ b/main.c @@ -618,18 +618,17 @@ void selectRegion2(char isDex, char isSlim, char *model, uint8_t **region_params } } -void setRegion() -{ - char isDex = 0; - selectCexDex(&isDex); +void setRegion(char *isDex) +{ + selectCexDex(isDex); char isSlim = 0; char model[18]; - selectModel(isDex, &isSlim, model); + selectModel(*isDex, &isSlim, model); uint8_t *region_params = 0; uint8_t *region_ciphertext = 0; - selectRegion(isDex, isSlim, model, ®ion_params, ®ion_ciphertext); + selectRegion(*isDex, isSlim, model, ®ion_params, ®ion_ciphertext); - write_region(region_params, model, region_ciphertext); + write_region(region_params, (uint8_t *) model, region_ciphertext); } uint8_t *frames[] = { @@ -764,45 +763,98 @@ char backupNVM() return 1; } -char restorePatches() +char applyPatches(char isDex) { - FILE *f = fopen("mass:/nvm.bin", "rb"); - if (!f) + uint8_t build_date[5]; + getMechaBuildDate(build_date); + + char applyForceUnlock = 0; + const uint8_t *force_unlock = getForceUnlock(build_date); + + if (isDex && force_unlock) { gsKit_clear(gsGlobal, Black); - - char text[] = "Failed to open nvm.bin!"; - + + struct MENU menu; + menu.title = "Install force unlock?"; + menu.x_text = "X Select"; + menu.o_text = "O Exit"; + menu.option_count = 2; + + menu.options[0] = "No"; + menu.options[1] = "Yes"; + + int selected = drawMenu(&menu); + if (selected == -1) + { + ResetIOP(); + LoadExecPS2("rom0:OSDSYS", 0, NULL); + SleepThread(); + } + else if (selected == 1) + { + applyForceUnlock = 1; + } + } + + if (applyForceUnlock) + { int x, y; - getTextSize(42, text, &x, &y); + getTextSize(42, "Applying force unlock...", &x, &y); y += 42; - struct GSTEXTURE_holder *textTextures = draw_text((gsGlobal->Width - x) / 2, (gsGlobal->Height - y) / 2, 42, 0xFFFFFF, text); + gsKit_clear(gsGlobal, Black); + struct GSTEXTURE_holder *textTextures = ui_printf((gsGlobal->Width - x) / 2, (gsGlobal->Height - y) / 2, 42, 0xFFFFFF, "Applying force unlock..."); drawFrame(); freeGSTEXTURE_holder(textTextures); - return 0; + + for (int i = 0; i < 112; i++) + { + if (!WriteNVM(400 + i, *(uint16_t*) &force_unlock[i * 2])) + break; + } + } + else + { + FILE *f = fopen("mass:/nvm.bin", "rb"); + if (!f) + { + gsKit_clear(gsGlobal, Black); + + char text[] = "Failed to open nvm.bin!"; + + int x, y; + getTextSize(42, text, &x, &y); + y += 42; - int x, y; - getTextSize(42, "Restoring patches...", &x, &y); - y += 42; - - gsKit_clear(gsGlobal, Black); - struct GSTEXTURE_holder *textTextures = ui_printf((gsGlobal->Width - x) / 2, (gsGlobal->Height - y) / 2, 42, 0xFFFFFF, "Restoring patches..."); - drawFrame(); - freeGSTEXTURE_holder(textTextures); + struct GSTEXTURE_holder *textTextures = draw_text((gsGlobal->Width - x) / 2, (gsGlobal->Height - y) / 2, 42, 0xFFFFFF, text); + drawFrame(); + freeGSTEXTURE_holder(textTextures); + return 0; + } + + int x, y; + getTextSize(42, "Restoring patches...", &x, &y); + y += 42; + + gsKit_clear(gsGlobal, Black); + struct GSTEXTURE_holder *textTextures = ui_printf((gsGlobal->Width - x) / 2, (gsGlobal->Height - y) / 2, 42, 0xFFFFFF, "Restoring patches..."); + drawFrame(); + freeGSTEXTURE_holder(textTextures); - fseek(f, 400 * 2, SEEK_SET); - for (int i = 0; i < 112; i++) - { + fseek(f, 400 * 2, SEEK_SET); + for (int i = 0; i < 112; i++) + { + + uint16_t data; + fread(&data, 1, 2, f); + if (!WriteNVM(400 + i, data)) + break; + } - uint16_t data; - fread(&data, 1, 2, f); - if (!WriteNVM(400 + i, data)) - break; + fclose(f); } - - fclose(f); return 1; } @@ -1004,8 +1056,9 @@ int main() } else if(selected == 0) { - setRegion(); - restorePatches(); + char isDex = 0; + setRegion(&isDex); + applyPatches(isDex); } else if(selected == 1) {