xor edx,edx
mov eax,edi
mov ecx,3
div ecx
/////////////////////////这里起着取Round()的作用
cmp edx,1
jbe @noAdd
add eax,1
@noAdd:
mov edi,eax
/////////////////////// 还不如不用汇编,我靠!
test eax,eax
jbe @End
jmp @Gen
@Err:
push 0
MOV EAX,DWORD PTR SS:[Title]
PUSH EAX
MOV EAX,DWORD PTR SS:[Text]
PUSH EAX
PUSH MB_OK
Call MessageBox //提示:注册名长度至少要3位
@End:
End; //End ASM
End;
//浮点如何内联汇编?这个Crackme用到了浮点,但是不知如何汇编?
//从百度知道:完全使用浮点指令写程序几乎是不可能的。
//希望有大侠指导。
//先多谢了。
//=======================================================================
Function LinkProc(LinkCtl:HWND;uMsg,wParam,lParam:DWORD):LRESULT;stdcall;
Begin
Result:=0;
Case uMsg of
WM_SETCURSOR:
Begin
SetCursor(L_Cur);
End;
WM_NCHITTEST:
Begin
Result:=1;
End;
WM_LBUTTONUP:
Begin
ShellExecute(0,nil,'http://www.pediy.com',nil,nil,0);//链接到:看雪学院
End
else
Begin
CallWindowProc(Pointer(GetWindowLong(LinkCtl,GWL_USERDATA)),LinkCtl,uMsg,wParam,lParam);
End;
end;
End;
procedure MoveToCentre(hDlg:HWND); //窗口启动中在屏幕中心显示
Var
D_Rect:TRECT; //本程序的RECT
S_Rect:Trect; //DeskTop 的RECT,实际上就是SCREEN了。
S_Hwnd:HWND; //DeskTop 的句柄
Begin
GetWindowRECT(hDlg,D_Rect);
S_Hwnd:=GetDesktopwindow;
GetWindowRect(s_Hwnd,S_Rect);
moveWindow(hDlg,(S_Rect.right-D_Rect.Right)div 2 ,(S_Rect.Bottom-D_Rect.Bottom ) div 2,D_Rect.Right ,D_Rect.Bottom,true);
End;
Function GetOS:string;
var
OS: OSVERSIONINFO;
OS_Str:string;
begin
ZeroMemory(@OS,sizeof(OS));
OS.dwOSVersionInfoSize :=sizeof(OSVERSIONINFO);
GetVerSionEx(OS);
OS_Str:='你使用非Windows操作系统';
if (OS.dwPlatformId = VER_PLATFORM_WIN32_NT) and
(OS.dwMajorVersion = 5) and (OS.dwMinorVersion =1)
then OS_str:='你使用WinXP'+' '+OS.szCSDVersion;
if (OS.dwPlatformId = VER_PLATFORM_WIN32_NT) and
(OS.dwMajorVersion = 5) and
(OS.dwMinorVersion =0)
then OS_str:='你使用Win2K'+' '+OS.szCSDVersion;
if (OS.dwPlatformId = VER_PLATFORM_WIN32_NT) and
(OS.dwMajorVersion = 4)
then OS_str:='你使用WinNT'+' '+OS.szCSDVersion;
if (OS.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS)
then OS_str:='你使用Win9X'+' '+OS.szCSDVersion;
Result:=OS_str;
end;
Procedure DialogInit(hDlg:HWND);
Begin
SetDlgItemText(hDlg,IDC_Time,Time);
SetDlgItemText(hDlg,IDC_wofan,Author);
SetDlgItemText(hDlg,IDC_Name,Pchar('wofan'));
setWindowText(hDlg,mainCaption);
if h_Cur<>0 then
Begin
SetClassLong(hDlg,GCL_HCURSOR,h_Cur); //设置动画光标
SetClassLong(GetDlgItem(hDlg,IDC_Name),GCL_HCURSOR,h_Cur); //各个控件有同样的光标
SetClassLong(GetDlgItem(hDlg,IDC_Code),GCL_HCURSOR,h_Cur);
SetClassLong(GetDlgItem(hDlg,IDC_OK),GCL_HCURSOR,h_Cur);
SetClassLong(GetDlgItem(hDlg,IDC_About),GCL_HCURSOR,h_Cur);
SetClassLong(GetDlgItem(hDlg,IDC_Cancel),GCL_HCURSOR,h_Cur);
End;
WM_LBUTTONDOWN:
Begin
Cap_PT.X:=lParam and $FFFF;
Cap_PT.Y:=lParam SHR 16;
if PTInRect(Cap_Rect,Cap_PT) then
Begin
PostMessage(hDlg,WM_NCLBUTTONDOWN,HTCAPTION,0); //转换消息,单击Form如同单击标题栏
End;
End;
if h_Icon<>0 Then
Begin
DrawIconEx(DC,4,4,h_Icon,$10,$10,0,0,3);
End;
SetBKMode(DC,TRANSPARENT); //设置背景透明,标题栏的画出的文字背景色不再是难看的白色
DrawText(DC,MainCaption,-1,Cap_Rect,DT_CENTER OR DT_SINGLELINE OR DT_VCENTER); //居中单行绘制文本
EndPaint(hDlg,sPaint);
End;
WM_COMMAND:
Begin
Case wParam and $FFFF of
IDC_OK:
Begin
wofanKeygen(hDlg);
SetDlgItemText(hdlg,IDC_Code,@mCode);
End;
IDC_About:
Begin
MessageBox(hDlg,pchar(AboutText+#13+GetOS),AboutTitle,MB_OK or MB_ICONINFORMATION);
End;
IDC_Cancel:
Begin
EndDialog(hDlg,0);
End;
IDC_Close:
Begin
EndDialog(hDlg,0);
End;
IDC_Name:
Begin
Case wParam shr 16 of
EN_CHANGE:
Begin
wofanKeygen(hDlg);
SetDlgItemText(hdlg,IDC_Code,@mCode);
End;
End; //end---wParam shr 16 of---- case
End; //End ----IDC_Name ----Begin
End; //End----WM_Command----Case
End; //End ----WM_Command---- Begin
End; //End ---Umsg----case
End; //End -----Function
//=======================================================================
Function LinkProc(LinkCtl:HWND;uMsg,wParam,lParam:DWORD):LRESULT;stdcall;
Begin
Result:=0;
Case uMsg of
WM_SETCURSOR:
Begin
SetCursor(L_Cur);
End;
WM_NCHITTEST:
Begin
Result:=1;
End;
WM_LBUTTONUP:
Begin
ShellExecute(0,nil,'http://www.pediy.com',nil,nil,0);//链接到:看雪学院
End
else
Begin
CallWindowProc(Pointer(GetWindowLong(LinkCtl,GWL_USERDATA)),LinkCtl,uMsg,wParam,lParam);
End;
end;
End;
procedure MoveToCentre(hDlg:HWND); //窗口启动中在屏幕中心显示
Var
D_Rect:TRECT; //本程序的RECT
S_Rect:Trect; //DeskTop 的RECT,实际上就是SCREEN了。
S_Hwnd:HWND; //DeskTop 的句柄
Begin
GetWindowRECT(hDlg,D_Rect);
S_Hwnd:=GetDesktopwindow;
GetWindowRect(s_Hwnd,S_Rect);
moveWindow(hDlg,(S_Rect.right-D_Rect.Right)div 2 ,(S_Rect.Bottom-D_Rect.Bottom ) div 2,D_Rect.Right ,D_Rect.Bottom,true);
End;
Function GetOS:string;
var
OS: OSVERSIONINFO;
OS_Str:string;
begin
ZeroMemory(@OS,sizeof(OS));
OS.dwOSVersionInfoSize :=sizeof(OSVERSIONINFO);
GetVerSionEx(OS);
OS_Str:='你使用非Windows操作系统';
if (OS.dwPlatformId = VER_PLATFORM_WIN32_NT) and
(OS.dwMajorVersion = 5) and (OS.dwMinorVersion =1)
then OS_str:='你使用WinXP'+' '+OS.szCSDVersion;
if (OS.dwPlatformId = VER_PLATFORM_WIN32_NT) and
(OS.dwMajorVersion = 5) and
(OS.dwMinorVersion =0)
then OS_str:='你使用Win2K'+' '+OS.szCSDVersion;
if (OS.dwPlatformId = VER_PLATFORM_WIN32_NT) and
(OS.dwMajorVersion = 4)
then OS_str:='你使用WinNT'+' '+OS.szCSDVersion;
if (OS.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS)
then OS_str:='你使用Win9X'+' '+OS.szCSDVersion;
Result:=OS_str;
end;
Procedure DialogInit(hDlg:HWND);
Begin
SetWindowText(hDlg,mainCaption);
SetDlgItemText(hDlg,IDC_Time,Time);
SetDlgItemText(hDlg,IDC_wofan,Author);
SetDlgItemText(hDlg,IDC_Name,Pchar('wofan'));
if h_Cur<>0 then
Begin
SetClassLong(hDlg,GCL_HCURSOR,h_Cur); //设置动画光标
SetClassLong(GetDlgItem(hDlg,IDC_Name),GCL_HCURSOR,h_Cur); //各个控件有同样的光标
SetClassLong(GetDlgItem(hDlg,IDC_Code),GCL_HCURSOR,h_Cur);
SetClassLong(GetDlgItem(hDlg,IDC_OK),GCL_HCURSOR,h_Cur);
SetClassLong(GetDlgItem(hDlg,IDC_About),GCL_HCURSOR,h_Cur);
SetClassLong(GetDlgItem(hDlg,IDC_Cancel),GCL_HCURSOR,h_Cur);
End;
WM_LBUTTONDOWN:
Begin
Cap_PT.X:=lParam and $FFFF;
Cap_PT.Y:=lParam SHR 16;
if PTInRect(Cap_Rect,Cap_PT) then
Begin
PostMessage(hDlg,WM_NCLBUTTONDOWN,HTCAPTION,0); //转换消息,单击Form如同单击标题栏
End;
End;
if h_Icon<>0 Then
Begin
DrawIconEx(DC,4,4,h_Icon,$10,$10,0,0,3);
End;
SetBKMode(DC,TRANSPARENT); //设置背景透明,标题栏的画出的文字背景色不再是难看的白色
DrawText(DC,MainCaption,-1,Cap_Rect,DT_CENTER OR DT_SINGLELINE OR DT_VCENTER); //居中单行绘制文本
EndPaint(hDlg,sPaint);
End;
WM_COMMAND:
Begin
Case wParam and $FFFF of
IDC_OK:
Begin
wofanKeygen(hDlg);
SetDlgItemText(hdlg,IDC_Code,@mCode);
End;
IDC_About:
Begin
MessageBox(hDlg,pchar(AboutText+#13+GetOS),AboutTitle,MB_OK or MB_ICONINFORMATION);
End;
IDC_Cancel:
Begin
EndDialog(hDlg,0);
End;
IDC_Close:
Begin
EndDialog(hDlg,0);
End;
IDC_Name:
Begin
Case wParam shr 16 of
EN_CHANGE:
Begin
wofanKeygen(hDlg);
SetDlgItemText(hdlg,IDC_Code,@mCode);
End;
End; //end---wParam shr 16 of---- case
End; //End ----IDC_Name ----Begin
End; //End----WM_Command----Case
End; //End ----WM_Command---- Begin
End; //End ---Umsg----case
End; //End -----Function
//=======================================================================
Function LinkProc(LinkCtl:HWND;uMsg,wParam,lParam:DWORD):LRESULT;stdcall;
Begin
Result:=0;
Case uMsg of
WM_SETCURSOR:
Begin
SetCursor(L_Cur);
End;
WM_NCHITTEST:
Begin
Result:=1;
End;
WM_LBUTTONUP:
Begin
ShellExecute(0,nil,'http://www.pediy.com',nil,nil,0);//链接到:看雪学院
End
else
Begin
CallWindowProc(Pointer(GetWindowLong(LinkCtl,GWL_USERDATA)),LinkCtl,uMsg,wParam,lParam);
End;
end;
End;
procedure MoveToCentre(hDlg:HWND); //窗口启动中在屏幕中心显示
Var
D_Rect:TRECT; //本程序的RECT
S_Rect:Trect; //DeskTop 的RECT,实际上就是SCREEN了。
S_Hwnd:HWND; //DeskTop 的句柄
Begin
GetWindowRECT(hDlg,D_Rect);
S_Hwnd:=GetDesktopwindow;
GetWindowRect(s_Hwnd,S_Rect);
moveWindow(hDlg,(S_Rect.right-D_Rect.Right)div 2 ,(S_Rect.Bottom-D_Rect.Bottom ) div 2,D_Rect.Right ,D_Rect.Bottom,true);
End;
Function GetOS:string;
var
OS: OSVERSIONINFO;
OS_Str:string;
begin
ZeroMemory(@OS,sizeof(OS));
OS.dwOSVersionInfoSize :=sizeof(OSVERSIONINFO);
GetVerSionEx(OS);
OS_Str:='你使用非Windows操作系统';
if (OS.dwPlatformId = VER_PLATFORM_WIN32_NT) and
(OS.dwMajorVersion = 5) and (OS.dwMinorVersion =1)
then OS_str:='你使用WinXP'+' '+OS.szCSDVersion;
if (OS.dwPlatformId = VER_PLATFORM_WIN32_NT) and
(OS.dwMajorVersion = 5) and
(OS.dwMinorVersion =0)
then OS_str:='你使用Win2K'+' '+OS.szCSDVersion;
if (OS.dwPlatformId = VER_PLATFORM_WIN32_NT) and
(OS.dwMajorVersion = 4)
then OS_str:='你使用WinNT'+' '+OS.szCSDVersion;
if (OS.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS)
then OS_str:='你使用Win9X'+' '+OS.szCSDVersion;
Result:=OS_str;
end;
Procedure DialogInit(hDlg:HWND);
Begin
SetWindowText(hDlg,mainCaption);
SetDlgItemText(hDlg,IDC_Time,Time);
SetDlgItemText(hDlg,IDC_wofan,Author);
SetDlgItemText(hDlg,IDC_Name,Pchar('wofan'));
if h_Cur<>0 then
Begin
SetClassLong(hDlg,GCL_HCURSOR,h_Cur); //设置动画光标
SetClassLong(GetDlgItem(hDlg,IDC_Name),GCL_HCURSOR,h_Cur); //各个控件有同样的光标
SetClassLong(GetDlgItem(hDlg,IDC_Code),GCL_HCURSOR,h_Cur);
SetClassLong(GetDlgItem(hDlg,IDC_OK),GCL_HCURSOR,h_Cur);
SetClassLong(GetDlgItem(hDlg,IDC_About),GCL_HCURSOR,h_Cur);
SetClassLong(GetDlgItem(hDlg,IDC_Cancel),GCL_HCURSOR,h_Cur);
End;
WM_LBUTTONDOWN:
Begin
Cap_PT.X:=lParam and $FFFF;
Cap_PT.Y:=lParam SHR 16;
if PTInRect(Cap_Rect,Cap_PT) then
Begin
PostMessage(hDlg,WM_NCLBUTTONDOWN,HTCAPTION,0); //转换消息,单击Form如同单击标题栏
End;
End;
if h_Icon<>0 Then
Begin
DrawIconEx(DC,4,4,h_Icon,$10,$10,0,0,3);
End;
SetBKMode(DC,TRANSPARENT); //设置背景透明,标题栏的画出的文字背景色不再是难看的白色
DrawText(DC,MainCaption,-1,Cap_Rect,DT_CENTER OR DT_SINGLELINE OR DT_VCENTER); //居中单行绘制文本
EndPaint(hDlg,sPaint);
End;
WM_COMMAND:
Begin
Case wParam and $FFFF of
IDC_OK:
Begin
wofanKeygen(hDlg);
SetDlgItemText(hdlg,IDC_Code,@mCode);
End;
IDC_About:
Begin
MessageBox(hDlg,pchar(AboutText+#13+GetOS),AboutTitle,MB_OK or MB_ICONINFORMATION);
End;
IDC_Cancel:
Begin
EndDialog(hDlg,0);
End;
IDC_Close:
Begin
EndDialog(hDlg,0);
End;
IDC_Name:
Begin
Case wParam shr 16 of
EN_CHANGE:
Begin
wofanKeygen(hDlg);
SetDlgItemText(hdlg,IDC_Code,@mCode);
End;
End; //end---wParam shr 16 of---- case
End; //End ----IDC_Name ----Begin
End; //End----WM_Command----Case
End; //End ----WM_Command---- Begin
End; //End ---Umsg----case
End; //End -----Function