生活随笔
收集整理的這篇文章主要介紹了
一个含有crc32算法的CrackMe分析
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
exe文件的下載地址為: http://pan.baidu.com/s/1gfw0XKf
啟動(dòng)界面:
大概意思是輸入用戶名和序列號(hào),檢查是否匹配,現(xiàn)在用ida打開分析一下:
msg==0x111位處理傳過來的WM_COMMAND消息
下面對(duì)關(guān)鍵的地方進(jìn)行分析,F5大法:
size = GetDlgItemTextA(hWnd,
1004, name,
255);
if ( size >=
4 ) {nameSize = size;codeSize[
0] = GetDlgItemTextA(hWnd,
1005, code,
255);crc32Init();
if ( Funcrc32(codeSize) ==
0x2F6016F7 ){RtlZeroMemory(byte_40347F,
8);byte_40347F[
0] = code[
8]; byte_40347F[
1] = code[
17];crc32Init();
if ( Funcrc32(byte_40347F) ==
0x242C1465 ){RtlZeroMemory(&buffer1,
10);RtlZeroMemory(&buffer2,
10);cnt =
0;
while (
1 ){t = code[cnt];
if ( t >
'9' && t <
'A' )
break;
if ( t <
'0' || t >
'F' )
break;
if ( ++cnt ==
8 ){count =
0;v10 =
0;buffer1_1 = &buffer1;
do{v10 *=
16;v12 = code[count];*buffer1_1 = v12;
if ( v12 <
'A' || v12 >
'F' )v13 = v12 -
'0';
elsev13 = v12 -
'7'; LOBYTE(v10) = v13 &
0xF | v10;++buffer1_1;++count;step1 = v10; }
while ( count !=
8 );crc32Init();crcName = Funcrc32(name);
if ( step1 == crcName ) {v15 =
0;v16 = &code[
9];
while (
1 ){v17 = v16[v15];
if ( v17 >
'9' && v17 <
'A' )
break;
if ( v17 <
'0' || v17 >
'F' )
break;
if ( ++v15 ==
8 ){cnt_1 =
0;v19 =
0;v20 = &buffer2;
do{v19 *=
16;v21 = v16[cnt_1];*v20 = v21;*v16 = v21;
if ( v21 <
'A' || v21 >
'F' )v22 = v21 -
48;
elsev22 = v21 -
55;LOBYTE(v19) = v22 &
0xF | v19;++v20;++cnt_1;step2 = v19;}
while ( cnt_1 !=
8 );crc32Init();crcBuffer1 = Funcrc32(&buffer1);
if ( step2 == crcBuffer1 ){crc32Init();step2 = Funcrc32(&buffer2);v24 =
0;v25 = &code[
18];
while (
1 ){v26 = v25[v24];
if ( (
unsigned __int8)v26 >
0x39u && (
unsigned __int8)v26 <
0x41u )
break;
if ( (
unsigned __int8)v26 <
0x30u || (
unsigned __int8)v26 >
0x46u )
break;
if ( ++v24 ==
8 ){cnt_2 =
0;v28 =
0;
do{v28 *=
16;v29 = v25[cnt_2];*v25 = v29;
if ( (
unsigned __int8)v29 <
0x41u || (
unsigned __int8)v29 >
0x46u )v30 = v29 -
48;
elsev30 = v29 -
55;LOBYTE(v28) = v30 &
0xF | v28;++cnt_2;step3 = v28;}
while ( cnt_2 !=
8 );這個(gè)
while循環(huán)將Serial的第三部分
16進(jìn)制字符串轉(zhuǎn)換為
int類型
if ( (step2 ^ step1) == step3 ){SetWindowTextA(hWnd,
"GOOD JOB, MAN!");hCheck = GetDlgItem(hWnd,
0x3EE);EnableWindow(hCheck,
0);
def crc32(v):'''Generates the crc32 hash of the v.@return: str, the str value for the crc32 of the v'''return "%08X"%(binascii.crc32(v)&
0xffffffff)
for i
in range(
60):crc = crc32(binascii.a2b_hex(
'%02X'%i))
if crc==
'2F6016F7':
print i
break
for i,j
in itertools.product(string.printable,string.printable):crc =crc32(binascii.a2b_hex(
'%02X%02x'%(ord(i),ord(j))))
if crc==
'242C1465':
print i,j
break
import crypt,binascii,itertoolsname = raw_input(
'輸入你的注冊(cè)名(大于4):')c1 = crc32(name)
print 'c1',c1,hex(int(c1,
16))c2 = crypt.crc32(c1)
print 'c2',c2,hex(int(c2,
16))t = crypt.crc32(c2)c3 =
'%08X'%(int(t,
16)^int(c1,
16))
print 'Serial:',c1+
'-'+c2+
'-'+c3
總結(jié)
以上是生活随笔為你收集整理的一个含有crc32算法的CrackMe分析的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。