home *** CD-ROM | disk | FTP | other *** search
Wrap
.386 .MODEL FLAT, STDCALL UNICODE=0 include w32.inc WinMain PROTO :HINSTANCE,:HINSTANCE,:LPSTR,:SDWORD DrawIcon PROTO :DWORD,:DWORD,:DWORD,:DWORD wsprintfA PROTO C :PROC extrn BeginPaint :PROC extrn EndPaint :PROC extrn lstrcat :PROC extrn GetSystemDirectoryA:PROC .data DlgName db "MainWindow",0 ChildName db "AboutChild",0 FontName db "script",0 YourSerial db "File to be patched:",0 filename1 db "CZ-VBcrackMe.exe",0 ErrorNotFound db "Couldn't find the file, make sure it is in the specified path and not in use...",0 ErrorPatched db "File is already patched, or it is a different version!",0 Error db "Error occured",0 Succeeded db "Completed",0 ErrorWriteFailure db "Write Failure",0 Instructions db "Nag killed... Now register using '55555' as code!",0 about db 0Ah,0Dh,"Fully 32b Patcher by Duelist.",0Ah,0Dh,0Ah,0Dh,"This Patcher was coded using TASM",0Ah,0Dh,0Ah,0Dh,"and LCC Resource Editor.",0Ah,0Dh,0Ah,0Dh,"Visit iNSiDE on EFNet at #iNSiDE99!",0 IconHandle dd ? BitmapHandle dd ? hInstance HINSTANCE ? CommandLine LPSTR ? filehandle dd 0 bytesread dd 0 readbuffer db 200 dup(?) originalb db 0FFh,096h,0BCh,001h,000h,000h newb db 090h,090h,090h,090h,090h,090h hDcMem dd ? hfont dd ? lprect RECT <> DlgRect RECT <> locebp24 dd 0 DlgWidth dd ? DlgHeight dd ? DesktopRect RECT <> IDC_OK equ 1 IDC_GENERATE equ 101 IDC_ABOUT equ 102 IDC_EXIT equ 103 IDC_SERIAL equ 105 ID_ABOUTTEXT equ 201 IDI_ICON equ 115 IDI_BITMAP equ 116 ICON_SMALL equ 0 DEFAULT_PITCH equ 0 DEFAULT_QUALITY equ 0 OEM_CHARSET equ 255 CLIP_CHARACTER_PRECIS equ 1 CLIP_DEFAULT_PRECIS equ 0 OUT_DEFAULT_PRECIS equ 0 .code start: call GetModuleHandle, NULL mov hInstance,eax call GetCommandLine call WinMain, hInstance,NULL,CommandLine, SW_SHOWDEFAULT call ExitProcess,eax WinMain proc hInst:HINSTANCE,hPrevInst:HINSTANCE,CmdLine:LPSTR,CmdShow:SDWORD mov eax, OFFSET DlgProc call DialogBoxParam, hInst, offset DlgName,NULL,eax,NULL ret WinMain endp MyProc proc call CreateFileA, offset filename1, GENERIC_READ OR GENERIC_WRITE, NULL, NULL, OPEN_EXISTING, NULL, NULL cmp eax, INVALID_HANDLE_VALUE jne a1 call MessageBoxA, 0, offset ErrorNotFound, offset Error, MB_OK ret a1: mov dword ptr [filehandle], eax call SetFilePointer, filehandle, 004D48h, NULL, NULL call ReadFile, filehandle, offset readbuffer, 6, offset bytesread, NULL mov ebx, 5 c1: movsx eax, byte ptr [originalb+ebx] cmp byte ptr [readbuffer+ebx], al jne b1 dec ebx cmp ebx, -1 jne c1 call SetFilePointer, filehandle, 004D48h, NULL, NULL call WriteFile, filehandle, offset newb, 6, offset bytesread, NULL cmp eax, 0 je e1 aa1: call SetFilePointer, filehandle, 004D86h, NULL, NULL call WriteFile, filehandle, offset newb, 6, offset bytesread, NULL cmp eax, 0 jne d1 e1: call MessageBoxA, 0, offset ErrorWriteFailure, offset Error, MB_OK ret d1: call MessageBoxA, 0, offset Instructions, offset Succeeded, MB_OK mov eax, 99h ret b1: call MessageBoxA, 0, offset ErrorPatched, offset Error, MB_OK ret MyProc endp DlgProc proc Handle: HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM LOCAL hdc:HDC LOCAL ps:PAINTSTRUCT LOCAL rect:RECT mov eax, uMsg cmp eax, WM_CTLCOLORDLG je create_brush cmp eax, WM_PAINT je write_labels cmp eax, WM_DESTROY jne next call PostQuitMessage, NULL xor eax, eax next: cmp eax, WM_INITDIALOG jne fourth call SetDlgItemTextA, Handle, IDC_SERIAL, offset filename1 call LoadIconA, hInstance, IDI_ICON mov IconHandle, eax call LoadBitmap, hInstance, IDI_BITMAP mov BitmapHandle, eax call GetDlgItem, Handle, IDC_EXIT call SetFocus,eax call SendMessage, Handle, WM_SETICON, ICON_SMALL, IconHandle push offset DlgRect push Handle call GetWindowRect call GetDesktopWindow push offset DesktopRect push eax call GetWindowRect push 0 mov eax,DlgRect.rc_bottom sub eax,DlgRect.rc_top mov DlgHeight,eax push eax mov eax,DlgRect.rc_right sub eax,DlgRect.rc_left mov DlgWidth,eax push eax mov eax, DesktopRect.rc_bottom sub eax, DlgHeight shr eax, 1 push eax mov eax, DesktopRect.rc_right sub eax, DlgWidth shr eax, 1 push eax push Handle call MoveWindow fourth: cmp eax, WM_CLOSE jne fifth call EndDialog, Handle, NULL fifth: cmp eax, WM_COMMAND jne msg_done mov eax, wParam cmp ax, IDC_EXIT jne is_it_about shr eax, 16 cmp ax, BN_CLICKED jne msg_done call MyProc cmp eax, 99h jne aaa call GetDlgItem, Handle, IDC_EXIT call EnableWindow, eax, 0 aaa: call CloseHandle, filehandle mov filehandle, NULL jmp msg_done is_it_about: cmp ax, IDC_ABOUT jne msg_done shr eax, 16 cmp ax, BN_CLICKED jne msg_done call DialogBoxParam, hInstance, offset ChildName, Handle, offset ChildProc, NULL jmp msg_done create_brush: call CreateSolidBrush, 00000000h mov eax, 1 ret write_labels: lea eax, ps push eax push [Handle] call BeginPaint mov hdc,eax call CreateCompatibleDC, hdc mov hDcMem, eax call SelectObject, hDcMem, BitmapHandle call BitBlt, hdc, 0, 0, 442, 284, hDcMem, 0, 0, SRCCOPY OR BLACKNESS call ReleaseDC, Handle, hdc call DeleteDC, hDcMem call CreateFont,15,0,0,0,400,0,0,0, OEM_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, offset FontName call SelectObject, hdc, eax mov hfont, eax call SetTextColor,hdc, 00ffffffh call SetBkColor,hdc,00000000h call lstrlen, offset YourSerial call TextOut,hdc, 24, 162, offset YourSerial, eax lea eax, ps call EndPaint, Handle, eax msg_done: xor eax, eax ret DlgProc endp ChildProc proc Handle:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM LOCAL hdc:HDC LOCAL ps:PAINTSTRUCT LOCAL rect:RECT mov eax, uMsg cmp eax, WM_DESTROY je destroy_window cmp eax, WM_CLOSE jne create_abt_brush destroy_window: call EndDialog, Handle, NULL xor eax, eax ret create_abt_brush: cmp eax, WM_CTLCOLORDLG jne do_the_painting call CreateSolidBrush, 00000000h ret do_the_painting: cmp eax, WM_PAINT jne init_about lea eax, ps call BeginPaint, Handle, eax mov hdc,eax call CreateFont,15,0,0,0,400,0,0,0, OEM_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, offset FontName call SelectObject, hdc, eax mov hfont,eax call SetTextColor,hdc, 00ffffffh call SetBkColor,hdc,00000000h call GetClientRect, Handle, offset lprect call DrawText, hdc, offset about, -1, offset lprect, DT_CENTER lea eax, ps call EndPaint, Handle, eax jmp about_done init_about: cmp eax, WM_INITDIALOG jne about_command call SetFocus, Handle push offset DlgRect push Handle call GetWindowRect call GetDesktopWindow push offset DesktopRect push eax call GetWindowRect push 0 mov eax,DlgRect.rc_bottom sub eax,DlgRect.rc_top mov DlgHeight,eax push eax mov eax,DlgRect.rc_right sub eax,DlgRect.rc_left mov DlgWidth,eax push eax mov eax, DesktopRect.rc_bottom sub eax, DlgHeight shr eax, 1 push eax mov eax, DesktopRect.rc_right sub eax, DlgWidth shr eax, 1 push eax push Handle call MoveWindow mov eax, FALSE ret about_command: cmp eax, WM_COMMAND jne about_done mov eax, wParam cmp lParam, 1 je about_done cmp ax, IDC_ABOUT jne about_done shr eax,16 cmp ax, BN_CLICKED jne about_done call EndDialog, Handle,NULL mov eax,FALSE ret about_done: xor eax, eax ret ChildProc endp end start