igs036crypt: The format of the key tables is now compatible with the real ones provided by the internal ARM. [Andreas Naive]

This commit is contained in:
andreasnaive 2017-12-08 00:03:32 +01:00
parent 22cf205a18
commit 46b9a9be46
2 changed files with 165 additions and 303 deletions

View File

@ -15,18 +15,15 @@ The scheme works on 16-bits words and is probably designed to depend on 24 bits
(word-) address; in what follows, we will refer to the 8 lowest ones simply as the (word-) address; in what follows, we will refer to the 8 lowest ones simply as the
lowest bits of the address, and the other 16 as the highest bits the address. lowest bits of the address, and the other 16 as the highest bits the address.
The address-based XOR is thought to be comprised of 16 one-bit XOR controlled The address-based XOR can be thought as 16 one-bit XORs against key bits
by a certain combination of one or two of the highest address bits. Every one of controlled by certain combinations of up to three address bits. The game key is
the one-bit XORs affects a different bit of the word. The game key is comprised of comprised of 256 8-bits values provided by the internal ARM; every 8-bit value
256 8-bits values provided by the internal ARM, and acts by masking on/off those XORs; in the key is used on those words whose address match the index modulus 256;
every 8-bit value in the key affect those words whose address match the index modulus 256; in a given key byte, every bit affects two positions of the correponding 16-bits
every bit in a given key byte, affects two positions of the correponding 16-bits encrypted words.
encrypted words, in conjunction with the lowest bits of the address.
This use of the key is similar to the one found in previous instantiations of This use of the key is similar to the one found in previous instantiations of
IGS circuits. IGS circuits.
TO-DO (2017-12-06): change the current implementation to match the real keys.
What is new in the IGS036 is the use of an obfuscation working this way: What is new in the IGS036 is the use of an obfuscation working this way:
1) The highest bits of the address are split in 4 groups, every of which controls 1) The highest bits of the address are split in 4 groups, every of which controls
@ -64,7 +61,7 @@ TO-DO: complete the table with the 20-bytes values
*****************************************************************************/ *****************************************************************************/
igs036_decryptor::igs036_decryptor(const uint16_t* game_key) igs036_decryptor::igs036_decryptor(const uint8_t* game_key)
: key(game_key) : key(game_key)
{ {
} }
@ -87,14 +84,13 @@ uint16_t igs036_decryptor::decrypt(uint16_t cipherword, int word_address)const
// key-dependent manipulation // key-dependent manipulation
for (int i=0; i<16; ++i) for (int i=0; i<16; ++i)
{ {
if (BIT(key[word_address&0xff],i)) if ((word_address&triggers[i][0]) == triggers[i][1])
{ aux ^= BIT(key[word_address&0xff],i&7) << i;
if (((word_address>>8)&triggers[i][0]) == triggers[i][1]) else
aux ^= (1<<i); aux ^= BIT(0x1a3a, i) << i;
}
} }
return aux^0x1a3a; return aux;
} }
uint16_t igs036_decryptor::deobfuscate(uint16_t cipherword, int word_address)const uint16_t igs036_decryptor::deobfuscate(uint16_t cipherword, int word_address)const
@ -169,11 +165,11 @@ uint16_t igs036_decryptor::rol(uint16_t num, int shift)const
// the triggers describe under what conditions are every one of the 16 XORs activated // the triggers describe under what conditions are every one of the 16 XORs activated
const uint16_t igs036_decryptor::triggers[16][2] = { const uint32_t igs036_decryptor::triggers[16][2] = {
{0x0001, 0x0000}, {0x0008, 0x0008}, {0x0002, 0x0000}, {0x0004, 0x0004}, {0x000101, 0x000001}, {0x000802, 0x000800}, {0x000204, 0x000004}, {0x000408, 0x000408},
{0x0100, 0x0000}, {0x0200, 0x0000}, {0x0400, 0x0000}, {0x0800, 0x0800}, {0x010010, 0x000010}, {0x020020, 0x000020}, {0x040040, 0x000040}, {0x080080, 0x080080},
{0x1001, 0x0001}, {0x2002, 0x2000}, {0x4004, 0x4000}, {0x8008, 0x0000}, {0x100100, 0x000100}, {0x200200, 0x200000}, {0x400400, 0x400000}, {0x800801, 0x000001},
{0x0010, 0x0010}, {0x0020, 0x0020}, {0x0040, 0x0000}, {0x0081, 0x0081} {0x001004, 0x001000}, {0x002010, 0x002000}, {0x004040, 0x000040}, {0x008100, 0x008100}
}; };
@ -238,214 +234,118 @@ int (*igs036_decryptor::rot_direction[4][8])(int) = {
// while simple, seems to be pretty robust, so few errors should be expected, // while simple, seems to be pretty robust, so few errors should be expected,
// if any. The exceptions are DDPDOJ & KOF98UMH (see below). // if any. The exceptions are DDPDOJ & KOF98UMH (see below).
const uint16_t orleg2_key[0x100] = { const uint8_t orleg2_key[0x100] = {
0x8100, 0x9202, 0x3000, 0x1200, 0x0100, 0x0800, 0x2100, 0xab05, 0x93, 0x88, 0x22, 0x08, 0x03, 0x02, 0x23, 0xa5, 0x01, 0xa0, 0x11, 0x88, 0x8d, 0xa5, 0x26, 0x09,
0x130a, 0xba0a, 0x0308, 0x9200, 0x8306, 0xab0f, 0x200c, 0x0301, 0x82, 0x01, 0x01, 0x01, 0x97, 0x08, 0x94, 0x8c, 0x99, 0x0b, 0x99, 0x01, 0x0b, 0x98, 0x09, 0x19,
0x9010, 0x1b13, 0x1310, 0x1b11, 0x8104, 0x0212, 0x8204, 0x8214, 0x91, 0xa8, 0xa0, 0x8b, 0x80, 0x04, 0x22, 0x09, 0xaa, 0x1a, 0x81, 0x23, 0x21, 0x83, 0x8c, 0x2c,
0x8302, 0x1111, 0x8300, 0x1b19, 0x0110, 0x8202, 0x0310, 0x0301, 0x11, 0x81, 0x31, 0xa9, 0x93, 0xa2, 0x01, 0x3e, 0x91, 0xb0, 0x3b, 0x0b, 0x03, 0x07, 0x93, 0x26,
0x8322, 0xb202, 0xb200, 0x9121, 0x8222, 0x0a26, 0x2000, 0x0321, 0xf1, 0x9b, 0xe3, 0x1a, 0x67, 0x2e, 0x84, 0x4e, 0xb9, 0xc1, 0x0a, 0xb8, 0xce, 0xee, 0x07, 0x0c,
0xb000, 0x0020, 0x9328, 0x3909, 0x230a, 0x8929, 0x8224, 0x2204, 0x00, 0xc1, 0xc2, 0xd1, 0x43, 0xdd, 0x51, 0x1b, 0x48, 0xc3, 0x09, 0xda, 0xc8, 0xc3, 0x59, 0x83,
0x0322, 0x9b33, 0x0300, 0x9311, 0x8120, 0x8810, 0x0330, 0x0004, 0x30, 0x22, 0xf1, 0x3b, 0x05, 0x2d, 0x41, 0x89, 0x2a, 0xa1, 0x42, 0xe2, 0x41, 0xa1, 0xa7, 0xe8,
0x832a, 0x8a0a, 0x0100, 0x1131, 0x0138, 0x093d, 0x8128, 0x081c, 0xf3, 0xd9, 0xb1, 0x53, 0x36, 0xd2, 0x15, 0x3a, 0xca, 0xbb, 0xca, 0x09, 0x3f, 0x54, 0x71, 0x40,
0xe342, 0x8101, 0xf140, 0x0000, 0x6144, 0x2004, 0x8204, 0x4044, 0xb0, 0xa8, 0x10, 0x38, 0x83, 0x8a, 0x82, 0x02, 0x09, 0x83, 0x32, 0x3a, 0xad, 0x05, 0x84, 0xa8,
0xa302, 0xdb4b, 0x1000, 0xa200, 0xc044, 0xe044, 0x010c, 0x0204, 0x81, 0x88, 0x02, 0x9a, 0x14, 0x99, 0x84, 0x03, 0x99, 0x10, 0x8b, 0x0a, 0x12, 0x11, 0x82, 0x85,
0x1212, 0xdb53, 0xd050, 0xcb41, 0x4150, 0xc347, 0x4340, 0x0101, 0x03, 0x12, 0x30, 0xba, 0x87, 0xac, 0xa1, 0xa0, 0x1b, 0x0a, 0xa2, 0x0a, 0x2a, 0x01, 0x2b, 0x24,
0x5252, 0xd959, 0x1310, 0xc040, 0xc252, 0xc959, 0x4340, 0x8919, 0xa0, 0x82, 0x01, 0xb2, 0xa5, 0x25, 0xb2, 0x1d, 0x3a, 0x83, 0x88, 0x98, 0xbf, 0x1a, 0x09, 0x22,
0x2202, 0x3800, 0xe340, 0x2101, 0x0326, 0x2307, 0x4360, 0x8321, 0xf3, 0xb3, 0xc3, 0xca, 0x63, 0x48, 0xc4, 0x6d, 0xa2, 0x6b, 0x5a, 0xbb, 0x24, 0xee, 0x4f, 0x64,
0x3000, 0xbb0b, 0x5068, 0xf848, 0x436a, 0xab0b, 0xa10c, 0xe240, 0xc2, 0x80, 0x01, 0xc3, 0x81, 0xde, 0x94, 0x82, 0xda, 0x98, 0x98, 0x8a, 0x59, 0x10, 0x58, 0xcf,
0xc140, 0xc363, 0x8300, 0x4961, 0x0004, 0xc860, 0x0324, 0x0000, 0xa2, 0xa8, 0xd3, 0x8a, 0xa6, 0x41, 0x83, 0xe0, 0x68, 0x49, 0x61, 0x19, 0x00, 0x63, 0x49, 0x80,
0xd070, 0x8101, 0xd070, 0x1331, 0x0104, 0x4a6e, 0x4348, 0x4a78, 0xb0, 0x39, 0xb3, 0x09, 0x91, 0x61, 0x55, 0x89, 0x20, 0x9a, 0x00, 0x3a, 0x80, 0x0a, 0xfa, 0x5c,
0xa282, 0xb282, 0x0200, 0x2200, 0x8180, 0x8080, 0x8080, 0x0800,
0x1302, 0x9989, 0x2008, 0x2000, 0xa386, 0x0b0f, 0x828c, 0xa280,
0x9392, 0x9292, 0x1010, 0x8080, 0x0206, 0x8383, 0x8294, 0x0911,
0x8382, 0x0a0a, 0x9190, 0x1010, 0x0008, 0x0b0b, 0x8098, 0x8b9d,
0x1120, 0x0820, 0x2200, 0xa080, 0x81a4, 0xa286, 0xa380, 0xaa80,
0x0120, 0x1020, 0xb088, 0x1020, 0x2000, 0x0b2b, 0x2100, 0x2a0c,
0x9292, 0x98b0, 0x1330, 0x8880, 0x8396, 0x0b17, 0x8080, 0x0325,
0x0000, 0x99b9, 0x92b0, 0x82a0, 0x8184, 0x0020, 0x0330, 0x0818,
0xe1c0, 0xa981, 0xd1c0, 0xd0c0, 0x6140, 0x4242, 0xc2c4, 0x6345,
0xb088, 0x7141, 0x4040, 0xa181, 0x220e, 0xe0c4, 0x4144, 0x6a4c,
0xd0d0, 0x9a92, 0x1310, 0xd9d1, 0x8392, 0xc0c4, 0x8284, 0x8890,
0xc0c0, 0x8282, 0x8280, 0x9090, 0x4342, 0x0a0a, 0x4240, 0xc1d5,
0xb080, 0xb282, 0xc1e0, 0x90a0, 0xa084, 0x4b63, 0x81a0, 0xeac0,
0x7242, 0x5363, 0x7348, 0x0321, 0x022a, 0x6949, 0x4360, 0x8aa8,
0x8282, 0x0303, 0x8180, 0x1331, 0x83a2, 0x4b53, 0x4364, 0x83b1,
0x121a, 0x80a0, 0x1238, 0x0000, 0x82ba, 0x0030, 0xc0c0, 0x4264,
}; };
const uint16_t m312cn_key[0x100] = { const uint8_t m312cn_key[0x100] = {
0x1102, 0x1103, 0x1000, 0xb101, 0x2100, 0x2802, 0xa000, 0x0901, 0x01, 0x09, 0x02, 0xab, 0x23, 0x20, 0xa2, 0x03, 0x10, 0x9b, 0xba, 0x33, 0x04, 0x2e, 0x27, 0x23,
0x000a, 0x8101, 0xa000, 0x2909, 0x000e, 0x2004, 0x210c, 0x2909, 0x92, 0x11, 0x13, 0x93, 0x13, 0x86, 0x83, 0x02, 0x18, 0x8a, 0x8b, 0x9a, 0x10, 0x0f, 0x13, 0x83,
0x8000, 0x0903, 0x0100, 0x8901, 0x0100, 0x8814, 0x8110, 0x0810, 0xa2, 0x98, 0x32, 0xba, 0x06, 0xab, 0x02, 0x0b, 0x1a, 0xa0, 0x13, 0x82, 0x84, 0x80, 0x8a, 0xa7,
0x0002, 0x9010, 0x9110, 0x8000, 0x000a, 0x0115, 0x0108, 0x8919, 0x83, 0xb0, 0xb2, 0xab, 0x31, 0x07, 0xa3, 0x02, 0x10, 0x23, 0x8b, 0xb2, 0x2b, 0x0a, 0xa7, 0xa3,
0xb000, 0x8022, 0x2000, 0xa000, 0x0024, 0xa101, 0x0020, 0x0121, 0x02, 0x7b, 0x12, 0xc3, 0x07, 0x0c, 0x43, 0xa6, 0x91, 0x91, 0x9b, 0xaa, 0x82, 0xca, 0x2e, 0x6a,
0x0020, 0xb80a, 0x0128, 0x9828, 0x802e, 0x882a, 0x8020, 0xa90d, 0x43, 0x51, 0x02, 0xcb, 0x52, 0x8b, 0x56, 0x57, 0x88, 0xc3, 0x83, 0x1a, 0x8d, 0x51, 0x86, 0x0a,
0x9130, 0x8802, 0x8000, 0x9111, 0x0102, 0x0935, 0x8110, 0x0830, 0xc1, 0x1b, 0x22, 0x5a, 0x07, 0x84, 0xa3, 0xce, 0xba, 0xfa, 0xab, 0x6a, 0xea, 0x2c, 0x2e, 0x67,
0x002a, 0x1919, 0x9130, 0x8808, 0x0110, 0x0030, 0x811c, 0x8919, 0x00, 0x33, 0x53, 0xd3, 0x47, 0x98, 0x93, 0x62, 0x2b, 0x9b, 0x2b, 0x82, 0xed, 0x4b, 0x1a, 0x86,
0x1000, 0x6141, 0x0000, 0xd941, 0x0104, 0x0006, 0x4140, 0xa804, 0xa0, 0xb9, 0x82, 0x0b, 0x27, 0x09, 0xa2, 0xab, 0x20, 0x3a, 0x8b, 0x0a, 0x84, 0x8d, 0x0b, 0x8f,
0x810a, 0x890b, 0x8100, 0xb000, 0x8008, 0xc040, 0x2004, 0x6040, 0x83, 0x8a, 0x92, 0x13, 0x10, 0x18, 0x06, 0x96, 0x83, 0x89, 0x8b, 0x92, 0x1c, 0x92, 0x9b, 0x17,
0x5150, 0x4943, 0x1010, 0xd151, 0x4040, 0x8111, 0x4044, 0x4945, 0x02, 0x2b, 0x02, 0x02, 0x06, 0x25, 0xa2, 0xab, 0xa8, 0x12, 0x13, 0x9a, 0x21, 0x27, 0x03, 0x2a,
0x9012, 0xd959, 0x9118, 0x0000, 0x8116, 0x494b, 0x801c, 0x0010, 0xa3, 0x92, 0x33, 0xb2, 0x94, 0x12, 0x32, 0x9b, 0x90, 0xa0, 0x8a, 0x2a, 0x9a, 0xbb, 0xae, 0x1e,
0xd162, 0x0121, 0x3000, 0x4060, 0x0124, 0x8826, 0xa100, 0xc064, 0x41, 0x2b, 0x92, 0xb2, 0x44, 0xe0, 0x02, 0x6f, 0x61, 0x30, 0x4a, 0x13, 0x61, 0x4f, 0x2e, 0xa6,
0xa000, 0xe040, 0xb100, 0x7040, 0xe040, 0x2006, 0x2004, 0x694d, 0x52, 0x00, 0xc2, 0x8b, 0x53, 0x8f, 0x93, 0x4f, 0x5b, 0x01, 0x1a, 0x9b, 0xc6, 0x01, 0x03, 0x0b,
0x1032, 0x0901, 0x4160, 0xc961, 0x4174, 0x8022, 0x8120, 0x4850, 0x42, 0x09, 0xf2, 0x62, 0x82, 0x41, 0x22, 0xc6, 0x90, 0x2a, 0xfa, 0x0b, 0x6c, 0xa0, 0x4f, 0x03,
0x1110, 0x8121, 0x1110, 0x9838, 0xc156, 0x4171, 0x0020, 0x883c, 0xa0, 0x53, 0xf2, 0xbb, 0x46, 0x96, 0x23, 0x22, 0xd8, 0xfa, 0x12, 0xab, 0x88, 0x1a, 0x7a, 0x8a,
0xb082, 0xa183, 0x9080, 0x1101, 0x2104, 0x0103, 0xa080, 0xa181,
0x300a, 0x2000, 0x9180, 0x1000, 0x808e, 0x8187, 0x0100, 0x8185,
0x9190, 0x9090, 0x8080, 0x0901, 0x0002, 0x0002, 0x0014, 0x8884,
0x9198, 0x9193, 0x9190, 0x8888, 0x0006, 0x8888, 0x8180, 0x090d,
0x1020, 0x3101, 0x1020, 0x1820, 0x0024, 0x2907, 0xa080, 0xa181,
0xb082, 0x0828, 0x0128, 0x80a0, 0x210a, 0x290d, 0x0128, 0x2000,
0x9190, 0x88a0, 0x0100, 0x8880, 0x80a6, 0x0820, 0x0000, 0x81a1,
0x80aa, 0x989a, 0x90b0, 0x1010, 0x80a0, 0x8181, 0x8094, 0x0024,
0x5142, 0x3101, 0x8080, 0xa880, 0x4046, 0xe8c2, 0x0000, 0x6145,
0x714a, 0x280a, 0x5040, 0x0909, 0x614a, 0x4145, 0x2004, 0xa88c,
0x4040, 0x1812, 0xd0d0, 0x9191, 0x4140, 0x8195, 0x8180, 0x4155,
0x4140, 0x191b, 0x0000, 0x8181, 0xc0dc, 0x091b, 0x0118, 0x0111,
0x5060, 0x1123, 0xe0c0, 0x7840, 0x80a0, 0x4963, 0x2000, 0xc8e4,
0x80aa, 0x3000, 0xe0c0, 0x1121, 0x6046, 0xa88a, 0x4164, 0x0929,
0x9092, 0x4961, 0xc0c0, 0x8181, 0x4074, 0x88a4, 0x0110, 0x0810,
0xc0e2, 0xc0c0, 0x0028, 0x9191, 0x80b2, 0x0020, 0x4040, 0x80b0,
}; };
const uint16_t cjddzsp_key[0x100] = { const uint8_t cjddzsp_key[0x100] = {
0x0142, 0x3903, 0xb0c0, 0x0040, 0x8006, 0xa145, 0x2004, 0x0141, 0x11, 0x21, 0xa2, 0x1a, 0x84, 0xaf, 0x26, 0x0b, 0x3b, 0xbb, 0x12, 0x9b, 0x89, 0x80, 0x2f, 0x0a,
0x21c0, 0xa1c1, 0x0048, 0x8141, 0x8182, 0x884a, 0x2184, 0x0040, 0x91, 0x80, 0x93, 0x93, 0x80, 0x0b, 0x13, 0x93, 0x0a, 0x82, 0x8a, 0x12, 0x13, 0x05, 0x96, 0x17,
0x8102, 0x98d2, 0x8180, 0x8941, 0x80d2, 0x0151, 0x01c0, 0x8901, 0x81, 0xb1, 0xb3, 0xab, 0x06, 0x2a, 0x87, 0x83, 0x33, 0x93, 0x13, 0x8a, 0x28, 0xa8, 0x07, 0x8b,
0x1090, 0x98d8, 0x9010, 0x0808, 0x0148, 0x095f, 0x804c, 0x090d, 0x11, 0xa3, 0xb2, 0xa2, 0x23, 0x17, 0x17, 0xb6, 0x33, 0xa9, 0xa3, 0x23, 0xa0, 0xa3, 0x9b, 0xbb,
0x9122, 0xa9c3, 0xa180, 0xb101, 0x00e4, 0x2000, 0x81e4, 0x8921, 0x70, 0xe8, 0x83, 0x72, 0xe6, 0xa2, 0xa2, 0x27, 0xbb, 0xc8, 0xf3, 0x42, 0x6d, 0xc8, 0x66, 0x47,
0x2188, 0x89a9, 0x0128, 0x9020, 0x2042, 0xa002, 0x016c, 0x8121, 0x93, 0x18, 0x12, 0x12, 0x13, 0x58, 0xd2, 0xc6, 0x49, 0x09, 0xc3, 0x0a, 0x81, 0x0b, 0xc2, 0xda,
0x01e2, 0x9991, 0x8040, 0x9810, 0x0190, 0x0925, 0x01a4, 0x88c4, 0xd2, 0x33, 0xc2, 0x1a, 0x40, 0x89, 0x26, 0xeb, 0x78, 0x51, 0x5a, 0x62, 0xa3, 0xee, 0x02, 0x8f,
0x0148, 0x9193, 0x91d8, 0x19d9, 0x801a, 0x8919, 0x8120, 0x81c1, 0x42, 0xa1, 0xe3, 0x3a, 0x41, 0x44, 0x93, 0xd3, 0x03, 0xda, 0xe2, 0x83, 0x69, 0xc5, 0xb3, 0xb6,
0x20c2, 0xf0c2, 0xd100, 0x28c0, 0xe0c4, 0xe880, 0xa080, 0x6985, 0x91, 0x00, 0xa2, 0x32, 0x24, 0x88, 0x87, 0xab, 0x02, 0x28, 0x2a, 0x8b, 0x87, 0xab, 0x2b, 0x8b,
0xe100, 0x9042, 0xa1c8, 0x18c8, 0x6146, 0x80c2, 0x604c, 0x09cd, 0x13, 0x02, 0x03, 0x9a, 0x94, 0x13, 0x87, 0x0b, 0x1a, 0x98, 0x03, 0x1b, 0x10, 0x81, 0x1a, 0x9f,
0x8180, 0x4002, 0x0000, 0x4880, 0x4100, 0x00c2, 0x8040, 0xc8d4, 0x81, 0xa9, 0x03, 0x3a, 0x05, 0x06, 0x27, 0xab, 0x3b, 0xa8, 0x8a, 0xab, 0xaf, 0x0a, 0xaa, 0x2f,
0x5152, 0x5113, 0xd1d8, 0x1090, 0xc19a, 0x4191, 0x80d8, 0xc0c0, 0x31, 0x39, 0x32, 0x3a, 0x81, 0xbf, 0x07, 0x87, 0x89, 0x98, 0xa2, 0x22, 0x13, 0xa4, 0xb6, 0x0e,
0xc0e0, 0x6901, 0xd060, 0x00a0, 0x0062, 0x81a3, 0x6004, 0xe1c1, 0x43, 0xf2, 0x43, 0x33, 0x47, 0x4c, 0x66, 0x26, 0xf2, 0x69, 0x2b, 0x5a, 0xa3, 0x83, 0x4b, 0xe6,
0x6042, 0x496b, 0x40e0, 0x78c8, 0xe188, 0xe0c4, 0x40a8, 0x81a5, 0x41, 0x50, 0x92, 0xcb, 0xd3, 0x1e, 0x57, 0x87, 0x01, 0x19, 0x9a, 0x52, 0x45, 0x5a, 0x9e, 0xde,
0x1070, 0x9913, 0x91d0, 0x0080, 0x4172, 0x48f6, 0x8120, 0x8961, 0xa3, 0xa1, 0x42, 0x7b, 0xa3, 0x22, 0xa2, 0x87, 0x80, 0xe0, 0xf3, 0x23, 0x2a, 0x8e, 0x2f, 0x6f,
0x51b8, 0xc060, 0x9058, 0xd939, 0x41d2, 0xc9ff, 0x8188, 0xc80c, 0x92, 0x1a, 0x23, 0xab, 0xb3, 0x09, 0xd6, 0xab, 0x38, 0xe3, 0x2b, 0x3a, 0xdf, 0x7d, 0xea, 0x87,
0x81c2, 0x1802, 0xb040, 0x2840, 0x2006, 0x80c2, 0x8184, 0xa1c1,
0x10c8, 0x30c2, 0x3040, 0x91c1, 0x810c, 0xa1c1, 0x2180, 0x81c1,
0x0100, 0x18d0, 0x1190, 0x80c0, 0x8046, 0x0941, 0x8154, 0x0111,
0x0080, 0x8042, 0x1118, 0x0101, 0x004a, 0x89db, 0x0040, 0x8185,
0x91a2, 0xb143, 0x11a0, 0x2000, 0x01e6, 0x0824, 0x21c4, 0xa181,
0x2180, 0xb002, 0x90a0, 0xb181, 0xa1c4, 0x0020, 0xa0c0, 0x2105,
0x01c2, 0x0183, 0x0040, 0x0000, 0x8132, 0x8185, 0x01b4, 0x8975,
0x91f2, 0x8022, 0x9058, 0x18d8, 0x0128, 0x889e, 0x808c, 0x00f4,
0x11c0, 0xe840, 0x1140, 0x6981, 0x41c4, 0x00c6, 0x60c4, 0x6884,
0xa0c8, 0x3143, 0x7180, 0x00c0, 0xa188, 0xc909, 0x4140, 0xa84c,
0x51d2, 0x0842, 0x8080, 0x9151, 0x81c0, 0x4084, 0x0144, 0x8915,
0x111a, 0x4103, 0x8000, 0x48c8, 0x01de, 0x00c0, 0xc004, 0xc044,
0xb100, 0xf983, 0x5060, 0x61c1, 0xe180, 0x2880, 0xe080, 0x8925,
0x90aa, 0xf8ca, 0xe148, 0x3989, 0x6080, 0x8024, 0x6184, 0x61c5,
0xc0a0, 0x0020, 0x5190, 0x9111, 0x8180, 0x01b3, 0xc0e4, 0xc191,
0x4082, 0xd9d9, 0x5110, 0x4000, 0xc164, 0x41c7, 0xc050, 0xc9bd,
}; };
const uint16_t cjdh2_key[0x100] = { const uint8_t cjdh2_key[0x100] = {
0x1180, 0x2983, 0x8080, 0x3981, 0x2182, 0x2181, 0x2100, 0x2901, 0x03, 0x31, 0x92, 0x23, 0x21, 0x2b, 0x23, 0x23, 0x39, 0x01, 0xb2, 0x9b, 0x0d, 0xaa, 0x07, 0x86,
0x2182, 0x198b, 0xa008, 0x8181, 0x0106, 0xa000, 0x018c, 0x880c, 0x03, 0x9b, 0x03, 0x82, 0x82, 0x00, 0x86, 0x0b, 0x80, 0x92, 0x9a, 0x1b, 0x81, 0x9a, 0x92, 0x8f,
0x1110, 0x8101, 0x1190, 0x9890, 0x8090, 0x0812, 0x8014, 0x0111, 0x83, 0x89, 0x82, 0x0a, 0x02, 0x0f, 0x83, 0xa7, 0x80, 0x32, 0xbb, 0x02, 0x8f, 0xa2, 0xaa, 0x0e,
0x909a, 0x8808, 0x8000, 0x0101, 0x811a, 0x8000, 0x8088, 0x8195, 0x80, 0x12, 0x23, 0xbb, 0x86, 0xb9, 0xb3, 0x1b, 0x19, 0xb8, 0x93, 0x22, 0x28, 0x9d, 0xbf, 0xb2,
0x9120, 0x9123, 0x90a0, 0x1020, 0x00a0, 0x0125, 0x8120, 0xa985, 0xa1, 0xb0, 0x63, 0xaa, 0x81, 0x8a, 0x47, 0x0b, 0xdb, 0x21, 0x5a, 0x03, 0xe9, 0x60, 0x2f, 0xab,
0x90aa, 0x2808, 0xa180, 0x1828, 0x81a4, 0xa808, 0xa080, 0x00a4, 0x00, 0x43, 0xc2, 0x8b, 0x06, 0x54, 0x47, 0x9f, 0x51, 0xc9, 0x4a, 0x4b, 0x1f, 0x40, 0x9f, 0x52,
0x9032, 0x0820, 0x1110, 0x8101, 0x8034, 0x8103, 0x8100, 0x01a1, 0x21, 0x00, 0xe3, 0x72, 0x44, 0x43, 0xc2, 0xab, 0x5a, 0x32, 0x1a, 0x62, 0x6d, 0xa2, 0x82, 0xce,
0x01a2, 0x8002, 0x81a8, 0x1818, 0x0092, 0x8127, 0x8184, 0x8888, 0x73, 0xe0, 0xc3, 0xa3, 0x73, 0x71, 0x16, 0x42, 0x69, 0xc9, 0x02, 0x43, 0x93, 0x23, 0x43, 0xbf,
0xb102, 0xa802, 0x7140, 0xb000, 0x8102, 0x8000, 0x41c4, 0x0181, 0x83, 0x19, 0xb2, 0x9a, 0xa0, 0x8a, 0x03, 0x8e, 0x29, 0x03, 0x02, 0x0b, 0xa0, 0xa0, 0x8b, 0x0a,
0xc140, 0x390b, 0x40c0, 0x1909, 0xe1c2, 0x68ca, 0x2104, 0xa181, 0x13, 0x0b, 0x12, 0x9a, 0x10, 0x80, 0x87, 0x8f, 0x98, 0x89, 0x13, 0x0b, 0x83, 0x8e, 0x1a, 0x1a,
0x1092, 0x59d1, 0xd050, 0x9111, 0x0014, 0x48c6, 0x41d4, 0x8185, 0x90, 0xab, 0xa2, 0x9b, 0xa5, 0xae, 0x22, 0x0a, 0x8b, 0xab, 0xa3, 0x0a, 0x0e, 0x02, 0x8e, 0x0f,
0x414a, 0xd1d3, 0x50d0, 0x51d1, 0x0184, 0x48da, 0x8104, 0x4848, 0x32, 0x3b, 0x13, 0x0b, 0x93, 0x91, 0x22, 0x0b, 0x90, 0xab, 0xb2, 0x33, 0xa1, 0x21, 0xaa, 0xae,
0x3182, 0x18a2, 0xf140, 0x68c0, 0x4066, 0x49e1, 0xc0e0, 0xa101, 0xa3, 0x93, 0x73, 0xc2, 0x67, 0x81, 0xc7, 0x0a, 0x31, 0xa2, 0x7b, 0x93, 0xa7, 0x60, 0x86, 0xce,
0x4060, 0x2888, 0x0020, 0x78c8, 0x6146, 0xa888, 0x8028, 0xc064, 0x53, 0x18, 0x53, 0x52, 0xc6, 0x5b, 0x47, 0x1a, 0x0b, 0x98, 0x5b, 0xda, 0x92, 0x14, 0x07, 0x82,
0x41c0, 0xd8d2, 0xd1f0, 0x9991, 0x41c0, 0x49c3, 0x00a4, 0x4870, 0x70, 0xc3, 0x02, 0xd2, 0xe1, 0x42, 0x42, 0x47, 0xe3, 0x20, 0x9a, 0xea, 0xe6, 0x02, 0x2a, 0x8f,
0x5152, 0xd1f3, 0x1038, 0x59f9, 0x8128, 0x0999, 0x4178, 0x8105, 0xf3, 0x3a, 0x22, 0x7a, 0xf1, 0x58, 0x97, 0xeb, 0x41, 0x59, 0xe2, 0x73, 0xdd, 0xa7, 0x7e, 0x1f,
0x9100, 0x0183, 0xa000, 0x8000, 0xa002, 0x8000, 0x0100, 0x8084,
0x3182, 0x1989, 0x1008, 0x1181, 0xa08a, 0xa88a, 0x8100, 0x0000,
0x0100, 0x1111, 0x0080, 0x8000, 0x0082, 0x8892, 0x8194, 0x8195,
0x8002, 0x9193, 0x0108, 0x1111, 0x8198, 0x8094, 0x0080, 0x0080,
0x80a2, 0xb181, 0xb000, 0x81a1, 0xa106, 0xa084, 0x2000, 0x00a0,
0x9120, 0xb181, 0xb108, 0x1020, 0x00a4, 0x0828, 0x8024, 0x01a5,
0x0000, 0x0101, 0x0120, 0x1131, 0x81a0, 0x89a3, 0x0010, 0x01b1,
0x802a, 0x9191, 0x8008, 0x0909, 0x811a, 0x091b, 0x8010, 0x8014,
0xb180, 0x8981, 0x6140, 0xd8c0, 0x6144, 0x8983, 0xc144, 0x0080,
0x210a, 0xb888, 0x61c0, 0x8989, 0xa10c, 0x68ca, 0x808c, 0xc044,
0x41c0, 0x0082, 0x4140, 0x4840, 0xc0d4, 0x41c1, 0x41d4, 0x0080,
0x1110, 0x8002, 0x41c0, 0xc040, 0x8008, 0x088e, 0x011c, 0x8898,
0x60c2, 0xd961, 0x1020, 0xc860, 0xe1c2, 0x48e0, 0x40e0, 0x4965,
0xf1c8, 0x388a, 0x80a0, 0xf040, 0xe0cc, 0x08a8, 0x2000, 0x81a5,
0xc140, 0x0080, 0x1090, 0x40c0, 0xc142, 0x40e2, 0x8124, 0xc1d1,
0x517a, 0x41e3, 0xd0d8, 0x49c9, 0xc1e6, 0x891d, 0x4044, 0x0125,
}; };
const uint16_t kov3_key[0x100] = { const uint8_t kov3_key[0x100] = {
0x9100, 0x0202, 0x0200, 0xb101, 0x2306, 0x8004, 0x0104, 0x2b01, 0x83, 0x18, 0x10, 0xab, 0x25, 0x8e, 0x07, 0x21, 0x9b, 0x20, 0xb3, 0x31, 0x8c, 0x25, 0xae, 0x21,
0x8100, 0x3a0a, 0xa108, 0x2b09, 0x8206, 0x2b0f, 0xa004, 0x2b09, 0x83, 0x11, 0x90, 0x01, 0x95, 0x0a, 0x95, 0x06, 0x82, 0x13, 0x01, 0x91, 0x96, 0x94, 0x09, 0x04,
0x9110, 0x0b03, 0x8200, 0x1b11, 0x8306, 0x0010, 0x8304, 0x0814, 0x30, 0x1a, 0x10, 0x91, 0x03, 0x08, 0xa3, 0x80, 0x09, 0xa1, 0x3a, 0xa0, 0x0d, 0x03, 0xa6, 0x2f,
0x9018, 0x0909, 0x1318, 0x8b09, 0x800c, 0x8a0e, 0x0310, 0x0a1c, 0xb3, 0xb2, 0x31, 0x32, 0xb7, 0x98, 0x00, 0x18, 0x92, 0x11, 0xaa, 0x08, 0xad, 0xa5, 0x22, 0x3e,
0x2202, 0x0020, 0x0220, 0x8b21, 0x0120, 0x0222, 0xa100, 0x8a20, 0xd3, 0x22, 0x41, 0x98, 0xe2, 0x2f, 0x86, 0x41, 0xc3, 0x79, 0xab, 0xc1, 0xe0, 0x8f, 0xc0, 0x45,
0x1322, 0xbb0b, 0x2000, 0xba08, 0x0326, 0x0929, 0xa00c, 0x2105, 0x02, 0x1b, 0x11, 0xc2, 0x82, 0x9c, 0x12, 0x0f, 0xca, 0x8a, 0xd9, 0x02, 0x1e, 0x56, 0x8b, 0xd3,
0x8100, 0x8800, 0x0300, 0x0800, 0x8104, 0x8222, 0x0230, 0x0220, 0xf0, 0x19, 0x02, 0x4a, 0x86, 0x07, 0xa7, 0x2c, 0xe0, 0x39, 0x1b, 0xfa, 0xa8, 0xa3, 0x25, 0xa4,
0x8028, 0x0b2b, 0x9010, 0x1230, 0x8316, 0x8b1f, 0x0018, 0x0004, 0x60, 0x4a, 0x40, 0x28, 0x35, 0xef, 0x25, 0x9c, 0x32, 0xf2, 0xb0, 0x2b, 0x18, 0x37, 0x74, 0xa6,
0xc140, 0x3800, 0x5340, 0x8200, 0xe040, 0x2105, 0x8004, 0x4b41, 0x03, 0xa2, 0x02, 0x03, 0x07, 0xa6, 0x86, 0x01, 0x28, 0x8b, 0x81, 0xbb, 0xae, 0x26, 0x87, 0xa4,
0xd148, 0x6343, 0xb100, 0xdb49, 0xe24a, 0x8105, 0xc248, 0x4b4d, 0x93, 0x19, 0x82, 0x81, 0x11, 0x04, 0x95, 0x1e, 0x92, 0x91, 0x01, 0x09, 0x83, 0x00, 0x9c, 0x05,
0x1010, 0x0101, 0x0300, 0xd850, 0x8010, 0x8206, 0x0000, 0x0115, 0x21, 0x13, 0xb1, 0x19, 0x84, 0x0a, 0x83, 0xa6, 0x89, 0x81, 0x33, 0xab, 0xa0, 0x82, 0xa0, 0x2c,
0xd050, 0x9010, 0xc340, 0x1818, 0x0004, 0x484c, 0x8110, 0xc949, 0x21, 0x92, 0x10, 0xab, 0x86, 0x9a, 0x90, 0xad, 0x91, 0x20, 0x81, 0xa9, 0xa7, 0x90, 0x39, 0x18,
0xe242, 0x0323, 0x1020, 0x5060, 0x8024, 0x0925, 0xa104, 0x2204, 0x41, 0x83, 0x13, 0x2a, 0xa6, 0xc9, 0xc1, 0x6d, 0x39, 0x82, 0x73, 0x6a, 0x60, 0x89, 0xea, 0xa5,
0xf24a, 0x2303, 0x0120, 0xe040, 0xa202, 0xa909, 0x230c, 0xaa0c, 0xd1, 0xda, 0xc0, 0x11, 0x43, 0x47, 0x54, 0xda, 0x98, 0x01, 0x9b, 0xd2, 0x1d, 0x9d, 0x01, 0xd8,
0x5252, 0x5070, 0x5270, 0x1210, 0x0306, 0xc155, 0x0314, 0x8224, 0x03, 0x8a, 0x40, 0xc2, 0x25, 0xa9, 0x66, 0x86, 0x79, 0x7a, 0x0a, 0x21, 0x26, 0xad, 0x8f, 0x06,
0x0008, 0xc848, 0x8208, 0x1111, 0x0222, 0x090d, 0x424c, 0x881c, 0x10, 0x09, 0xe0, 0x39, 0x02, 0xfe, 0x47, 0x44, 0x2a, 0x51, 0x21, 0x49, 0x04, 0x1d, 0x2d, 0xed,
0x1100, 0xb880, 0x1000, 0x1901, 0x0104, 0xa884, 0x8084, 0x0b01,
0x3202, 0x9181, 0x9388, 0xa181, 0xa084, 0x280c, 0x818c, 0xaa8c,
0x8180, 0x0303, 0x9090, 0x9b91, 0x0302, 0x0a16, 0x8384, 0x0004,
0x8088, 0x8b8b, 0x1318, 0x1311, 0x8198, 0x0a1a, 0x8284, 0x0b1d,
0x3302, 0x0921, 0xa380, 0x0321, 0x82a6, 0x0020, 0x81a0, 0xa884,
0x93a2, 0x9bab, 0x2108, 0xb181, 0xa28a, 0x88a8, 0xa288, 0x2204,
0x1312, 0x88a0, 0x0220, 0x9191, 0x80b4, 0x80a0, 0x82a0, 0x8395,
0x83aa, 0x1a1a, 0x93b8, 0x9391, 0x819c, 0x8aaa, 0x0300, 0x0220,
0x5342, 0x9981, 0x0100, 0x3000, 0xa084, 0xc3c3, 0xc3c0, 0x6345,
0x2302, 0x9888, 0x6148, 0x7040, 0x624a, 0x8383, 0xe0c0, 0xab8d,
0xc3c2, 0xc0c0, 0xd2d0, 0x0b01, 0x4150, 0x4955, 0x4244, 0xc0c0,
0x8282, 0x1b1b, 0x8180, 0xc8c8, 0x0306, 0x8387, 0x0318, 0xc2c0,
0x1120, 0x90a0, 0x5260, 0xd8e0, 0x2306, 0xa383, 0x6044, 0x88a4,
0x6342, 0x6040, 0x1020, 0x3b09, 0x200c, 0xa387, 0x81a4, 0x082c,
0x0222, 0x1333, 0xd2d0, 0x0301, 0x0030, 0xc0c4, 0x4174, 0x4a74,
0x1010, 0x4b6b, 0x1318, 0x5371, 0x023e, 0x0327, 0x0314, 0xc3d5,
}; };
const uint16_t kov2_key[0x100] = { const uint8_t kov2_key[0x100] = {
0x1000, 0x3101, 0x9300, 0x0101, 0xa100, 0x8804, 0x8100, 0x2000, 0x02, 0x2b, 0x81, 0x1b, 0xa3, 0x86, 0x83, 0x2a, 0x1b, 0x0b, 0xa0, 0xbb, 0x8b, 0x05, 0x26, 0x0d,
0x0100, 0x1101, 0xb208, 0xa101, 0x8100, 0x0b0f, 0x200c, 0x0305, 0x12, 0x81, 0x92, 0x83, 0x11, 0x96, 0x90, 0x80, 0x91, 0x10, 0x92, 0x81, 0x0b, 0x12, 0x94, 0x1c,
0x0000, 0x9b13, 0x8000, 0x9911, 0x0302, 0x8804, 0x8200, 0x8a10, 0x30, 0x9b, 0x20, 0xab, 0x83, 0xac, 0x03, 0x0d, 0xa3, 0x2a, 0xa9, 0x01, 0xa0, 0x82, 0x29, 0xa8,
0x830a, 0x0a0a, 0x8008, 0x9b19, 0x0110, 0x0808, 0x820c, 0x0204, 0x82, 0x3b, 0x80, 0x08, 0x26, 0x2c, 0x27, 0x94, 0x33, 0x23, 0xab, 0x01, 0x8d, 0x91, 0xb5, 0xbf,
0x2202, 0x8121, 0x3200, 0xb101, 0x8120, 0xa206, 0x0120, 0x0325, 0x50, 0xaa, 0xf2, 0x03, 0xe7, 0x4c, 0x61, 0xc7, 0xf0, 0x73, 0xf3, 0x20, 0xe7, 0x60, 0x45, 0xa1,
0xb108, 0x3000, 0xb300, 0x1b29, 0xa20a, 0x8828, 0x2300, 0xa200, 0x11, 0x12, 0xc0, 0x51, 0xc2, 0xc4, 0x15, 0xd5, 0xd9, 0x80, 0x10, 0xc0, 0x10, 0xc7, 0xc3, 0xc8,
0x9030, 0x0101, 0x9230, 0x1230, 0x0014, 0x0216, 0x0114, 0x8a24, 0x33, 0x5b, 0xb2, 0x93, 0xc5, 0x2d, 0xe5, 0xe1, 0x91, 0x43, 0xa0, 0x89, 0x4b, 0x05, 0x0a, 0x44,
0x0108, 0x1919, 0x9110, 0x1b39, 0x8336, 0x8b2b, 0x830c, 0x8105, 0x53, 0x82, 0x52, 0xaa, 0x24, 0xb9, 0x12, 0x5b, 0x18, 0x10, 0xd8, 0xda, 0x42, 0x6d, 0xc9, 0xd0,
0x4242, 0xb000, 0xe040, 0x1901, 0xe144, 0x4246, 0x6340, 0xc945, 0x22, 0xb8, 0x33, 0x10, 0x24, 0xa0, 0x84, 0x23, 0x20, 0x19, 0x81, 0x89, 0x0a, 0x0a, 0x24, 0x02,
0xe24a, 0x6949, 0xe148, 0x3a08, 0xe14c, 0x6a4a, 0x434c, 0xab09, 0x83, 0x0a, 0x90, 0x11, 0x94, 0x0c, 0x05, 0x8c, 0x90, 0x1b, 0x9b, 0x82, 0x9d, 0x9b, 0x1c, 0x1d,
0x0302, 0x0800, 0xd250, 0x4b41, 0xc050, 0xca56, 0x0304, 0xcb45, 0x23, 0x32, 0x02, 0x9a, 0x86, 0x05, 0xa5, 0x26, 0x28, 0x2b, 0x39, 0x98, 0xae, 0xae, 0x2a, 0xaa,
0xc342, 0x9a1a, 0x0208, 0xda58, 0x020a, 0xc95d, 0xc158, 0xc250, 0x23, 0x83, 0x01, 0x98, 0x81, 0x0d, 0xa6, 0xb2, 0x99, 0x01, 0xb3, 0x01, 0x07, 0x09, 0x88, 0x02,
0x2100, 0x4161, 0xa000, 0x8921, 0xc366, 0x2307, 0xe344, 0xeb41, 0x83, 0xf0, 0x32, 0x09, 0xc2, 0x6c, 0x21, 0xa1, 0x90, 0xb3, 0x31, 0x51, 0xed, 0xaf, 0x45, 0xc5,
0x832a, 0x5969, 0xb208, 0x9321, 0x4160, 0x0b2f, 0x0020, 0x4a6c, 0x02, 0xd1, 0xd3, 0xc0, 0x15, 0xcc, 0x42, 0xd4, 0x03, 0x59, 0x19, 0x93, 0x9a, 0x8e, 0x14, 0x04,
0x4160, 0x9830, 0x4060, 0x9010, 0x0216, 0x8303, 0x0020, 0x4161, 0x42, 0x08, 0xf0, 0x88, 0xe0, 0x65, 0xa3, 0x4c, 0xe2, 0xe2, 0xb1, 0xb1, 0x20, 0x03, 0xc8, 0x41,
0x0222, 0x0a2a, 0xc260, 0xc060, 0x4078, 0x4357, 0xc370, 0xca68, 0xf3, 0x80, 0x93, 0x40, 0x57, 0x69, 0xa1, 0x5b, 0xea, 0xb9, 0x58, 0xcb, 0x04, 0x64, 0x08, 0xf5,
0x3000, 0xa282, 0x2100, 0x0a00, 0x2206, 0xaa82, 0x8284, 0x2901,
0x320a, 0x0303, 0x9388, 0x9381, 0x0000, 0x0000, 0x220c, 0x0808,
0x9190, 0x1010, 0x8280, 0x0b01, 0x8286, 0x0216, 0x0314, 0x8294,
0x828a, 0x0101, 0x8180, 0x9898, 0x8386, 0x8181, 0x0204, 0x0305,
0x3100, 0x2800, 0x1020, 0x80a0, 0x80a4, 0x0b27, 0xa384, 0x2804,
0x3202, 0x3101, 0x2300, 0x82a0, 0xa084, 0xa084, 0x2000, 0xa080,
0x1110, 0x99b1, 0x1330, 0x82a0, 0x83b2, 0x0337, 0x8094, 0x8880,
0x83a2, 0x1b3b, 0x8188, 0x1b39, 0x013c, 0x0333, 0x82b0, 0x0838,
0x9180, 0xeac2, 0x2000, 0x1301, 0xc0c0, 0x6246, 0x2300, 0xab81,
0x828a, 0xa989, 0x2308, 0x4b49, 0xe3c6, 0xa185, 0x434c, 0xcbcd,
0x1010, 0xcbc3, 0xc1c0, 0xdad0, 0x0306, 0xc2d6, 0x4050, 0xcac4,
0x1118, 0x4343, 0x0300, 0x8989, 0x8080, 0x8094, 0x020c, 0x0a1c,
0x5060, 0x1222, 0xe2c0, 0x92a0, 0xe2c2, 0x6b47, 0xa180, 0x4264,
0xf0c8, 0xf8c8, 0xa388, 0xab89, 0x220a, 0x0929, 0xc2e0, 0x4b69,
0xc1c0, 0x9ab2, 0x81a0, 0x5a70, 0x4164, 0x4353, 0x8390, 0x4161,
0xd0d0, 0x8383, 0x4260, 0xd1f1, 0x023e, 0x4a5e, 0x0230, 0xcbcd,
}; };
// DDPDOJ & KOF98UMH caused lots of problems to the automatic recovery // DDPDOJ & KOF98UMH caused lots of problems to the automatic recovery
@ -453,78 +353,40 @@ const uint16_t kov2_key[0x100] = {
// It is much more probable for these keys to still contain errors // It is much more probable for these keys to still contain errors
// than for the other ones. // than for the other ones.
const uint16_t ddpdoj_key[0x100] = { const uint8_t ddpdoj_key[0x100] = {
0xb102, 0x8802, 0x0000, 0x9101, 0x2004, 0xa105, 0x0000, 0x8905, 0xa1, 0x90, 0x12, 0x8b, 0x26, 0xaf, 0x02, 0x87, 0x99, 0x3a, 0x2a, 0x22, 0x25, 0xac, 0x86, 0xae,
0x8102, 0x2000, 0x3000, 0x3808, 0x210e, 0xa006, 0x800c, 0xa004, 0x83, 0x83, 0x82, 0x92, 0x94, 0x13, 0x87, 0x0f, 0x03, 0x08, 0x13, 0x9b, 0x14, 0x8f, 0x0e, 0x0f,
0x9110, 0x9911, 0x9010, 0x8800, 0x8006, 0x0901, 0x8114, 0x0115, 0x02, 0x13, 0xa3, 0xaa, 0x85, 0x25, 0x02, 0xa3, 0x03, 0x3a, 0x3a, 0x13, 0x2b, 0x09, 0x82, 0x83,
0x1118, 0x1012, 0x0108, 0x8101, 0x000e, 0x8115, 0x0014, 0x0115, 0x23, 0xb0, 0x22, 0xa2, 0xb5, 0x3a, 0xa3, 0x9a, 0xa2, 0x0a, 0x23, 0x83, 0xbe, 0x26, 0x9f, 0x07,
0x1020, 0x0921, 0xb100, 0xb000, 0x8126, 0x2907, 0x0020, 0xa901, 0x01, 0xfb, 0xb2, 0x03, 0x81, 0x83, 0xa6, 0x6b, 0xfa, 0xb9, 0xe2, 0xd3, 0x8a, 0x05, 0xee, 0x86,
0x1128, 0x2000, 0x2000, 0x0929, 0x2100, 0x0123, 0x8028, 0x8929, 0xc1, 0xd2, 0x83, 0xd3, 0x12, 0x0d, 0x56, 0xce, 0x0a, 0x00, 0x9a, 0x43, 0x18, 0x46, 0x0f, 0xcb,
0x1110, 0x8802, 0x1010, 0x9810, 0x8106, 0x0000, 0x8110, 0x8020, 0x42, 0xd0, 0x02, 0x6a, 0xc0, 0x68, 0x86, 0x2b, 0xd9, 0x41, 0xfb, 0x8a, 0xc9, 0x67, 0x2f, 0xa7,
0x9018, 0x1030, 0x1118, 0x9939, 0x8004, 0x081c, 0x8124, 0x093d, 0x00, 0xc0, 0x43, 0x2a, 0x65, 0xe3, 0x76, 0x53, 0x8a, 0xe0, 0x9a, 0x03, 0x25, 0x28, 0xba, 0xeb,
0x21, 0x82, 0xb2, 0xab, 0xa1, 0x8e, 0x02, 0xa3, 0x09, 0x3a, 0x9b, 0x02, 0x8b, 0x27, 0xae, 0x8e,
0x1102, 0xe141, 0xa000, 0x1901, 0x8102, 0x8901, 0xa004, 0x6141, 0x80, 0x93, 0x13, 0x13, 0x16, 0x96, 0x86, 0x83, 0x1b, 0x80, 0x0b, 0x13, 0x89, 0x84, 0x1a, 0x97,
0xe040, 0xa103, 0xf048, 0xc949, 0x8000, 0x090f, 0xe044, 0x880c, 0xa2, 0x08, 0xa2, 0x2a, 0x25, 0x2b, 0x86, 0x83, 0x99, 0x08, 0xa2, 0x2b, 0x28, 0x2d, 0x83, 0x0e,
0xd152, 0xc840, 0x9110, 0xc941, 0x0000, 0x0117, 0x4044, 0xc054, 0xb2, 0xa3, 0x13, 0x1a, 0xa2, 0x3b, 0xb6, 0x23, 0xb8, 0x83, 0xab, 0x2a, 0x8d, 0x91, 0x97, 0xb3,
0x1010, 0x181a, 0x8000, 0x5959, 0x0002, 0x485c, 0x0114, 0xc151, 0xe3, 0x23, 0xb2, 0x6b, 0x07, 0xa7, 0xe6, 0x22, 0x21, 0x30, 0x6a, 0x0b, 0x25, 0xe0, 0x6a, 0x67,
0x5060, 0xc862, 0x1020, 0x7040, 0xc062, 0x6042, 0x8024, 0x2101, 0x82, 0x98, 0x93, 0xc2, 0xc1, 0x8d, 0x07, 0x9b, 0xc2, 0xd2, 0x13, 0xdb, 0xd9, 0x09, 0x87, 0xd7,
0xc162, 0x596b, 0xe140, 0x9020, 0xc162, 0x694d, 0x2104, 0xa90d, 0x83, 0x0b, 0xe2, 0x5b, 0xe4, 0x2c, 0x42, 0xa2, 0x42, 0x6a, 0x3b, 0x22, 0x25, 0x89, 0x47, 0x0b,
0x1032, 0xd872, 0x5170, 0x1010, 0x4156, 0xc951, 0x4044, 0x4961, 0xe3, 0xa9, 0xd3, 0xf3, 0x26, 0x02, 0x62, 0x53, 0x00, 0xd3, 0x23, 0x2b, 0x74, 0xa2, 0x1e, 0x1a,
0x9030, 0xd85a, 0x8020, 0x1939, 0x011e, 0x0012, 0x8000, 0xc151,
0x3102, 0x9880, 0xa080, 0xb181, 0xa182, 0x8084, 0x0000, 0xa981,
0x1102, 0x2000, 0x8180, 0x1808, 0x8180, 0x290d, 0xa084, 0x8084,
0x9092, 0x8981, 0x0100, 0x0901, 0x0004, 0x8884, 0x8094, 0x8991,
0x0100, 0x989a, 0x1110, 0x0909, 0x8192, 0x889e, 0x0000, 0x898d,
0xb080, 0x1022, 0xb080, 0x3000, 0x2106, 0x2101, 0x80a4, 0x89a1,
0x81a2, 0x1022, 0xb088, 0x3101, 0x2002, 0x2107, 0x81a8, 0x0024,
0x8080, 0x9991, 0x0120, 0x0020, 0x8090, 0x0101, 0x8084, 0x0911,
0x8082, 0x99b9, 0x9190, 0x1010, 0x81b6, 0x89ab, 0x81ac, 0x8989,
0xf1c0, 0x3901, 0xa080, 0x7141, 0x0104, 0xa985, 0xe0c4, 0x2800,
0x310a, 0x280a, 0x7040, 0x1101, 0x210e, 0xe8ca, 0x6040, 0x694d,
0x9090, 0x8082, 0x8180, 0xd8d0, 0xc1d2, 0x8197, 0x0114, 0x8181,
0xd0d8, 0xc8c8, 0x0108, 0xc1c1, 0xc1c2, 0x0113, 0x819c, 0xc9cd,
0x91a0, 0x1121, 0xf0c0, 0x4161, 0xe0c6, 0x2006, 0x4060, 0xa880,
0x5068, 0x7040, 0x2100, 0x3808, 0x210e, 0x81a3, 0x416c, 0x0121,
0xd1d0, 0x9193, 0xc1e0, 0xc9c1, 0x0014, 0x0830, 0x4050, 0x4961,
0x103a, 0xc9e9, 0x1118, 0x1111, 0x404e, 0x8898, 0x0024, 0x0020,
}; };
const uint16_t kof98umh_key[0x100] = { const uint8_t kof98umh_key[0x100] = {
0x9202, 0x8f03, 0x0200, 0x3f01, 0x2404, 0x8901, 0x2000, 0x0d05, 0x80, 0x95, 0x10, 0x25, 0x26, 0x83, 0x22, 0x07, 0x95, 0xb4, 0x94, 0xb0, 0x8c, 0x2c, 0x87, 0x82,
0x870a, 0xae0a, 0x8608, 0xaa08, 0x8606, 0x2606, 0x850c, 0x8808, 0x80, 0x82, 0x96, 0x1d, 0x12, 0x10, 0x05, 0x1f, 0x14, 0x09, 0x9c, 0x0f, 0x00, 0x1b, 0x82, 0x8b,
0x9212, 0x9810, 0x8400, 0x0701, 0x0000, 0x0a02, 0x0714, 0x0505, 0x96, 0x8a, 0xa3, 0xa7, 0x85, 0x86, 0xa6, 0xab, 0x80, 0x03, 0x0c, 0x8a, 0x03, 0x26, 0x27, 0xa4,
0x060a, 0x1313, 0x8600, 0x1511, 0x021a, 0x0101, 0x8018, 0x8111, 0x30, 0xa1, 0x85, 0x01, 0xb6, 0xb6, 0xa1, 0xab, 0x9b, 0x83, 0x82, 0x8a, 0x15, 0x26, 0x9c, 0x87,
0x8420, 0x9020, 0xb100, 0xbd01, 0x8726, 0x8c24, 0xa404, 0xa101, 0xf1, 0xb3, 0x13, 0x61, 0xa2, 0x83, 0xa4, 0x4b, 0x01, 0x68, 0x99, 0xc5, 0x07, 0x4f, 0x46, 0xc6,
0x922a, 0x1929, 0x1620, 0x9020, 0x0128, 0x2c0c, 0x250c, 0xae0c, 0x14, 0x0e, 0x55, 0x03, 0x06, 0x01, 0xc6, 0x80, 0x55, 0xda, 0x51, 0x48, 0xca, 0x0e, 0xde, 0xcd,
0x0202, 0x9b13, 0x9730, 0x1b31, 0x8404, 0x8c04, 0x8310, 0x8111, 0x60, 0xf6, 0x82, 0xd5, 0x83, 0xea, 0x26, 0x03, 0x56, 0x2a, 0x72, 0x80, 0xc5, 0x08, 0xec, 0x26,
0x8120, 0x9939, 0x9038, 0x9030, 0x072e, 0x0c1c, 0x8624, 0x8d3d, 0x15, 0x21, 0x90, 0xa2, 0xf2, 0x41, 0x54, 0x42, 0xea, 0x35, 0x0f, 0x01, 0xd4, 0x3b, 0xb3, 0x4d,
0x30, 0x9b, 0x17, 0xaa, 0x20, 0x29, 0x26, 0x88, 0x91, 0xa0, 0x9f, 0xaa, 0x2e, 0x8b, 0x2e, 0xad,
0xe342, 0xa901, 0x0100, 0x7b41, 0xa000, 0x8901, 0xa604, 0x4141, 0x96, 0x93, 0x85, 0x8b, 0x92, 0x1e, 0x13, 0x98, 0x86, 0x04, 0x94, 0x16, 0x15, 0x0d, 0x17, 0x88,
0x130a, 0x7242, 0x8300, 0xdf49, 0x050c, 0x4545, 0x444c, 0xcc4c, 0xa1, 0x2a, 0x12, 0x0c, 0x26, 0x09, 0x82, 0x29, 0x93, 0x82, 0x10, 0x0b, 0x21, 0xaf, 0x87, 0x8a,
0x0602, 0x1410, 0x4740, 0x1911, 0x0414, 0x0b13, 0xc454, 0x8a10, 0x04, 0x9e, 0x04, 0xa1, 0x27, 0xbf, 0x03, 0x2a, 0x90, 0x2f, 0x8a, 0x86, 0x1c, 0x34, 0x13, 0x8e,
0x474a, 0xc040, 0x4348, 0x5250, 0xc050, 0x0414, 0xc444, 0xc755, 0x07, 0x8b, 0xb3, 0xe0, 0x67, 0x02, 0x64, 0x4f, 0x07, 0x68, 0xac, 0x84, 0xae, 0xec, 0x63, 0x4e,
0x7242, 0xec40, 0x9020, 0xcf61, 0x8120, 0xe040, 0x2404, 0x0921, 0x87, 0x0f, 0x56, 0x14, 0x54, 0x06, 0xc5, 0x81, 0x51, 0x96, 0xcf, 0x16, 0x49, 0x99, 0x49, 0xdd,
0x4468, 0x3000, 0x6048, 0x9a28, 0xc76e, 0x0222, 0xe644, 0x2c0c, 0x25, 0xc6, 0xc3, 0xe9, 0xa2, 0xe5, 0x63, 0x05, 0x13, 0x8a, 0xa4, 0x25, 0x26, 0x29, 0x6a, 0xe0,
0x0722, 0x1b13, 0x8220, 0x9810, 0xc040, 0x4b73, 0x4664, 0x4870, 0xc3, 0x6e, 0xc1, 0x99, 0xc1, 0xe2, 0x47, 0xa1, 0x4c, 0xa1, 0x14, 0x11, 0x4d, 0x32, 0x3f, 0x80,
0xd050, 0x0f0b, 0x1530, 0x1b39, 0xc66e, 0x0101, 0x8108, 0x4775,
0x2202, 0x8181, 0x0500, 0xb080, 0x2202, 0x2303, 0x2404, 0x8280,
0x838a, 0xba8a, 0x8580, 0xb080, 0x2404, 0x8181, 0x2404, 0xa785,
0x8480, 0x8981, 0x9790, 0x9191, 0x8080, 0x0404, 0x0100, 0x8280,
0x9498, 0x1e1a, 0x8688, 0x0c08, 0x070e, 0x0717, 0x050c, 0x8290,
0xb382, 0x3000, 0x0020, 0x1620, 0x2404, 0x0323, 0x80a0, 0x2301,
0x81a8, 0x98a8, 0x0228, 0x1121, 0x230a, 0xa585, 0x85ac, 0x80a0,
0x1632, 0x84a0, 0x1630, 0x9b91, 0x0514, 0x8585, 0x0130, 0x0010,
0x82aa, 0x1511, 0x90b0, 0x9cb8, 0x0626, 0x0e0e, 0x0128, 0x84b4,
0x1500, 0x9181, 0xa180, 0xfac0, 0x6544, 0x0800, 0x6644, 0x4545,
0x1508, 0x7242, 0xb680, 0x9e88, 0xa484, 0xe6c6, 0x6148, 0x4444,
0x9590, 0x1511, 0x4440, 0x0e00, 0x4646, 0x0c14, 0xc7d4, 0x8b91,
0x434a, 0x8c88, 0xd5d0, 0x0c08, 0x4352, 0x8383, 0x4350, 0xc7c5,
0x3702, 0xdce0, 0xd1e0, 0xf3c1, 0xa080, 0xefc7, 0x6140, 0x0f25,
0x0128, 0x90a0, 0xb688, 0x3f09, 0x240c, 0x2303, 0x6040, 0xeac8,
0xd1f0, 0x5450, 0xd3f0, 0x83a1, 0xc3f2, 0xc8d0, 0x4574, 0x8b91,
0x5672, 0x9b9b, 0x0628, 0x0b29, 0x4776, 0x0808, 0x0504, 0x8ab8,
}; };

View File

@ -7,17 +7,17 @@
class igs036_decryptor class igs036_decryptor
{ {
public: public:
igs036_decryptor(const uint16_t* game_key); igs036_decryptor(const uint8_t* game_key);
void decrypter_rom(memory_region* region); void decrypter_rom(memory_region* region);
uint16_t decrypt(uint16_t cipherword, int word_address)const; uint16_t decrypt(uint16_t cipherword, int word_address)const;
uint16_t deobfuscate(uint16_t cipherword, int word_address)const; uint16_t deobfuscate(uint16_t cipherword, int word_address)const;
private: private:
const uint16_t* key; const uint8_t* key;
static int (*rot_enabling[16][4])(int); static int (*rot_enabling[16][4])(int);
static int (*rot_direction[4][8])(int); static int (*rot_direction[4][8])(int);
static const uint16_t triggers[16][2]; static const uint32_t triggers[16][2];
int rotation(int address)const; int rotation(int address)const;
uint16_t rol(uint16_t num, int shift)const; uint16_t rol(uint16_t num, int shift)const;
@ -25,13 +25,13 @@ private:
int rot_group(int address, const int* group)const; int rot_group(int address, const int* group)const;
}; };
extern const uint16_t orleg2_key[0x100]; extern const uint8_t orleg2_key[0x100];
extern const uint16_t m312cn_key[0x100]; extern const uint8_t m312cn_key[0x100];
extern const uint16_t cjddzsp_key[0x100]; extern const uint8_t cjddzsp_key[0x100];
extern const uint16_t cjdh2_key[0x100]; extern const uint8_t cjdh2_key[0x100];
extern const uint16_t kov3_key[0x100]; extern const uint8_t kov3_key[0x100];
extern const uint16_t kov2_key[0x100]; extern const uint8_t kov2_key[0x100];
extern const uint16_t ddpdoj_key[0x100]; extern const uint8_t ddpdoj_key[0x100];
extern const uint16_t kof98umh_key[0x100]; extern const uint8_t kof98umh_key[0x100];
#endif #endif