lano
Aktives Mitglied
Moin.
Mir ist kein besserer Titel eingefallen.
Ich hab da folgendes Problem.
Ich hab 2 Funktionen zum entschlüsseln.
Nun such ich das Gegenstück.
Mir ist kein besserer Titel eingefallen.
Ich hab da folgendes Problem.
Ich hab 2 Funktionen zum entschlüsseln.
Nun such ich das Gegenstück.
C:
/* rotl16 */
u_int16_t rotl16(u_int16_t value, unsigned int count) {
const unsigned int mask = (CHAR_BIT * sizeof(value) - 1);
count &= mask;
return (value << count) | (value >> ((-count) & mask));
}
u_int16_t decrypt(u_int16_t encrypted_location, u_int8_t key_xorval, u_int8_t key_xorstart, u_int8_t key_nrot) {
return rotl16(encrypted_location ^ (key_xorval << key_xorstart), key_nrot);
}