001-注冊演算法分析
一、工具和除錯環境
- 動態除錯工具:
x64dbg - 系統環境:
win10 1909
二、分析Serial/name的演算法
由于Serial里面就是一個字串比較,沒有啥演算法,這里就不詳細說了,大概就是通過搜索字串Failed,就能定位到關鍵位置,Serial直接可以在堆疊中觀察到,為:Hello Dude!,所以我們主要分析Serial/name的注冊演算法,
直接使用提示字串驗證,得到錯誤提示如下

那么我們直接搜索字串Sorry,得知有兩個地方使用該字串,都設定上斷點,然后重新驗證,成功斷在0x0042F826處,先分析這個,另一個后面再說

斷下之后向上定位到關鍵演算法如下
0042FA87 | 8B45 F0 | mov eax,dword ptr ss:[ebp-10] | [ebp-10]:"Please enter your name !" ; 獲取name首地址
0042FA8A | 0FB600 | movzx eax,byte ptr ds:[eax] | ; eax = name[0] 取出name的第一個字符存放在eax中
0042FA8D | F72D 50174300 | imul dword ptr ds:[431750] | 00431750:L")" ; ")" aiscii碼為 0x29 eax = name[0] * 0x29
0042FA93 | A3 50174300 | mov dword ptr ds:[431750],eax | ; key = name[0] * 0x29
0042FA98 | A1 50174300 | mov eax,dword ptr ds:[431750] | ;
0042FA9D | 0105 50174300 | add dword ptr ds:[431750],eax | ; key = name[0] * 0x29 * 2
通過演算法key = name[0] * 0x29 * 2算出key后,緊接著拼接得到Serial,格式為:CW-key-CRACKED
三、演算法核心代碼模擬
char* GetSerial(char* szName)
{
static char szSerial[60] = {};
if (strlen(szName) < 4)
{
MessageBox(NULL, "Name至少需要4位", "溫馨提示", MB_OK);
return nullptr;
}
int key = szName[0] * 0x29 * 2;
sprintf(szSerial, "CW-%d-CRACKED", key);
return szSerial;
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/543636.html
標籤:其他
