好友
阅读权限10
听众
最后登录1970-1-1
|
推荐
迷雾
发表于 2019-7-4 13:01
本帖最后由 迷雾 于 2019-7-4 13:03 编辑
先上效果
本人渣渣一枚,大神们勿喷,lz的程序没加密我就直接ida f5了.
[C] 纯文本查看 复制代码 INT_PTR __stdcall DialogFunc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
char v5; // dl
void (__stdcall *v6)(UINT); // ebx
int v7; // ecx
char *v8; // ebx
char v9; // al
int v10; // esi
int v11; // eax
int v12; // esi
CHAR v13; // al
CHAR *v14; // edx
int v15; // ecx
CHAR v16; // al
HWND v17; // eax
HWND v18; // eax
HWND v19; // eax
HWND v20; // eax
HICON v21; // eax
signed int v22; // [esp+0h] [ebp-110h]
CHAR String; // [esp+4h] [ebp-10Ch]
char Dst[100]; // [esp+68h] [ebp-A8h]
CHAR String2[16]; // [esp+CCh] [ebp-44h]
__int16 v26; // [esp+DCh] [ebp-34h]
CHAR v27[16]; // [esp+E0h] [ebp-30h]
int v28; // [esp+F0h] [ebp-20h]
__int16 v29; // [esp+F4h] [ebp-1Ch]
CHAR v30[16]; // [esp+F8h] [ebp-18h]
__int16 v31; // [esp+108h] [ebp-8h]
char v32; // [esp+10Ah] [ebp-6h]
v26 = 33;
v28 = 565626318;
v29 = 33;
*(_OWORD *)String2 = xmmword_D52128; // 对应的字符串为 "恭喜你,成功"
v31 = -24157;
*(_OWORD *)v27 = xmmword_D5213C;
v32 = 0;
*(_OWORD *)v30 = xmmword_D52154;
memset(Dst, 0, 0x64u);
memset(&String, 0, 0x64u);
if ( Msg == 0x10 ) // WM_CLOSE
{
DestroyWindow(hWnd);
return 0;
}
if ( Msg == 272 ) // WM_INITDIALOG
{
v21 = LoadIconA(hInstance, (LPCSTR)0x69);
SendMessageA(hWnd, 0x80u, 1u, (LPARAM)v21); // WM_SETICON
SendDlgItemMessageA(hWnd, 1003, 0xC5u, 0x50u, 0);
return 0;
}
if ( Msg != 273 ) // WM_COMMAND
return 0;
if ( (unsigned __int16)wParam == 1007 )
{
v22 = GetDlgItemTextA(hWnd, 1003, Dst, 101);// UserName
GetDlgItemTextA(hWnd, 1004, &String, 101); // PassWord
v5 = Dst[0];
v6 = (void (__stdcall *)(UINT))MessageBeep;
if ( Dst[0] && v22 >= 5 ) // if userName[0]!=0 && length(userName)>=5
{
v7 = 0;
v8 = Dst; // userName
if ( v22 <= 0 ) // length(userName)
{
LABEL_15:
v10 = 0;
if ( v5 ) // v5=首字符
{
do
{
v11 = v5; // 移到下一个字符,v5=下一字符
v5 = *++v8;
v10 += v11;
}
while ( *v8 );
}
v12 = v10 ^ 0x1357; // v10=所有字符ascii码之和
}
else // if userName[0]==0 || length(userName)<5
{
while ( 1 )
{
v9 = Dst[v7]; // 如果用户名是数字,跳出循环
if ( v9 < 65 )
break; // 如果ASCI大于90(判断小写字母?)
if ( v9 > 90 ) // 转为大写字母
Dst[v7] = v9 - 32;
if ( ++v7 >= v22 ) // 索引下移,这里应该是v7++吧?,先移动下一再判断是否到达结尾
{
v5 = Dst[0]; // v5=首字符
goto LABEL_15;
}
} // 如果有数字跳出循环设置这个标记
v12 = 1;
}
v13 = String; // PassWord
v14 = &String; // Pointer to PassWord
v15 = 0;
if ( String ) // 将每一个密码字符-48('0')转为数字 然后放到缓冲区v14中,v15为每一次转换出的数字加上上一次的转换的数字*10
{
do
{
v16 = v13 - 48;
*v14++ = v16;
v15 = v16 + 10 * v15;
v13 = *v14; // 这个v13好像没什么卵用
}
while ( *v14 );
}
if ( v12 == (v15 ^ 0x2468) ) // 如果用户名有数字的话这里v12==1
{
lstrcpyA(Text, String2); // 密码正确 "恭喜你,成功"
v17 = GetDlgItem(hWnd, 1003);
EnableWindow(v17, 0);
v18 = GetDlgItem(hWnd, 1004);
EnableWindow(v18, 0);
}
else
{
lstrcpyA(Text, v27); // 密码错误
}
v19 = GetDlgItem(hWnd, 1004);
SetFocus(v19);
v6 = (void (__stdcall *)(UINT))MessageBeep;
}
else
{
lstrcpyA(Text, v30); // 长度不对
v20 = GetDlgItem(hWnd, 1003);
SetFocus(v20);
MessageBeep(0);
}
v6(0);
MessageBoxA(hWnd, Text, "CrackMe", 0);
}
else if ( (unsigned __int16)wParam == 1008 )
{
SendMessageA(hWnd, 0x10u, 0, 0);
return 1;
}
return 1;
}
//根据这个枚举出5位数字下的一个正确密码
[C++] 纯文本查看 复制代码 #include <iostream>
using namespace std;
int func(char *p)
{
int a=0, b=0, c=0;
char buf[10] = { 0 };
int i = 0;
do
{
a = *p - '0';
buf[i++] = a;
c = a + 10 * c;
p++;
} while (*p);
return c;
}
int main()
{
char a, b, c, d, e;
char buf[7] = { 0 };
for (a = '0'; a <= '9'; a++)
for (b = '0'; b <= '9'; b++)
for (c = '0'; c <= '9'; c++)
for (d = '0'; d <= '9'; d++)
for (e = '0'; e <= '9'; e++)
{
buf[0] = a;
buf[1] = b;
buf[2] = c;
buf[3] = d;
buf[4] = e;
int ret = func(buf);
if ((ret^0x2468) == 1)
{
cout << "find" << endl;
cout << a << b << c << d << e << "ret:" << ret << endl;
}
}
return 0;
}
find
09321ret:9321
|
|