mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 11:49:06 +00: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:
parent
c10d69fe07
commit
ec39c45dd5
8 changed files with 48 additions and 17 deletions
|
@ -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];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue