mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-13 00:58:29 +02:00
Wiimote: Added decryption function, it could be useful for debugging real Wiimote extensions
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2099 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -288,10 +288,16 @@ void wiimote_gen_key(wiimote_key *key, u8 *keydata)
|
||||
// ----------------
|
||||
void wiimote_encrypt(wiimote_key *key, u8 *data, int addr, u8 len)
|
||||
{
|
||||
for(int i = 0; i < len; i++, addr++)
|
||||
{
|
||||
//Console::Print("data[%i] from %02x ", i, data[i]);
|
||||
for(int i = 0; i < len; i++, addr++)
|
||||
data[i] = (data[i] - key->ft[addr%8]) ^ key->sb[addr%8];
|
||||
//Console::Print("to %02x\n", data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ===================================================
|
||||
/* Decrypt data */
|
||||
// ----------------
|
||||
void wiimote_decrypt(wiimote_key *key, u8 *data, int addr, u8 len)
|
||||
{
|
||||
for(int i = 0; i < len; i++, addr++)
|
||||
data[i] = (data[i] ^ key->sb[addr%8]) + key->ft[addr%8];
|
||||
}
|
Reference in New Issue
Block a user