public void DecryptTitleKey(byte[] tiket, byte[] title) { byte[] common_key = new byte[] { 0xeb, 0xe4, 0x2a, 0x22, 0x5e, 0x85, 0x93, 0xe4, 0x48, 0xd9, 0xc5, 0x45, 0x73, 0x81, 0xaa, 0xf7 }; byte[] iv = new byte[16]; Array.Copy(tiket, 476, iv, 0, 8); for (int i = 8; i < 16; i++) { iv[i] = 0; } byte[] tiketb = new byte[tiket.LongLength - 0x01bf]; Array.Copy(tiket, 0x01bf, tiketb, 0, tiketb.LongLength); AESRijndael.aes_set_key(common_key); AESRijndael.aes_decrypt(iv, tiketb, title, 16); }
public void PartitionReadBlock(uint blockno, byte[] block) { if (SectorUsageTable != null) { SectorUsageTable[PartitionBlock + blockno] = 1; } uint offset = PartitionDataOffset + ((0x8000 >> 2) * blockno); PartitionRawRead(offset, TempBuffer, 0x8000); //Decodifica os dados byte[] iv = new byte[16]; Array.Copy(TempBuffer, 0x3d0, iv, 0, 16); byte[] raw = new byte[0x7c00]; Array.Copy(TempBuffer, 0x400, raw, 0, 0x7c00); AESRijndael.aes_set_key(DiscKey); AESRijndael.aes_decrypt(iv, raw, block, 0x7c00); }