我一直在努力为特定软件反汇编解密算法。它的工作方式是序列密钥包含所有适当的信息,在输出纯文本数据的算法中得到处理(它实际上是二进制数据,但这在这里并不重要)。
我现在想创建一个算法来重新加密任意数据。
经过一些工作,我设法大大减少了解密过程的代码库。下面是它的工作原理 :
BigUnsigned hash_func(BigUnsigned serial, BigUnsigned running_value, BigUnsigned encrypt_key)
{
return (serial * running_value) - (((serial * running_value) / encrypt_key) * encrypt_key);
}
void do_the_thing()
{
BigUnsigned key1 = hash_func(buSerial, buSerial, buEncryptKey);
BigUnsigned key2 = hash_func(buSerial, key1, buEncryptKey);
BigUnsigned result = 1;
int key_select = 0;
unsigned int weird_number = 0xc3530000;
for(int i = 0; i < 8; ++i, weird_number *= 4){
result = hash_func(result, result, buEncryptKey);
result = hash_func(result, result, buEncryptKey);
if(weird_number >> 30){
key_select++;
if(key_select < 3){
result = hash_func(result, key2, buEncryptKey);
}else{
result = hash_func(result, buSerial, buEncryptKey);
if(key_select == 4){
key_select = 0;
}
}
}
}
}
两个buSerial和buEncryptKey16个无符号整型(512位)。我不知道如何创建一种算法来加密新数据。我的问题是 key2 是根据我事先不知道的最终结果生成的。
我正在使用这个 BigInt 库