# usualsuspect/daxin_decrypt_embedded.py **[gist.github.com/usualsuspect/839fbc54e0d76bb2626329cd94274cd6](https://gist.github.com/usualsuspect/839fbc54e0d76bb2626329cd94274cd6)** #!/usr/bin/env python3 # # Algorithm used by Daxin to decrypt embedded driver # Uses slightly modified RC4 (see comment in rc4() below) # # Constants fitting for sample # b0eb4d999e4e0e7c2e33ff081e847c87b49940eb24a9e0794c6aa9516832c427 # import hashlib import struct def gen_key(const1,const2): # hardcoded into function, might also change per sample ----- key_data = b"\x7C\x4E\xD0\x68\x20\x4b\x42\xEB\x08\x4A\xFE\xA9\xEB\x50\x30\xa3" d1 = struct.pack("> 5) & 0xFFFFFFFF) k ^= out[i] k ^= 0xFFFFFFFF # not else: k = ((h >> 3) & 0xFFFFFFFF) ^ ((h << 7) & 0xFFFFFFFF) k ^= out[i] h ^= k out = struct.pack("