home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Elite Hackers Toolkit
/
TheEliteHackersToolkitVolume1_1998.rar
/
HACKERS.BIN
/
appcraks
/
MATHCRAC.ZIP
/
MCRACK.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1998-03-17
|
10KB
|
394 lines
#include <windows.h>
#include <commdlg.h>
#include <stdio.h>
#include "mcrack.rh"
int PASCAL WinMain( HINSTANCE, HINSTANCE, LPSTR, int );
void PaintMainWindow ( HWND );
//BOOL FAR PASCAL _export AboutBoxProc ( HWND, UINT, WPARAM, LPARAM );
BOOL FAR PASCAL _export FirstProc ( HWND, UINT, WPARAM, LPARAM );
long FAR PASCAL _export MainWindowProc( HWND, UINT, WPARAM, LPARAM );
HINSTANCE hInst;
HWND hWnd;
char show=0;
unsigned long filelen = 3294720L;
char texto[]="Mathcad 7 Professional - Crack applicator";
char texto1[]="Instrucciones:";
char texto2[]="1) Presione el boton Continuar";
char texto3[]="2) Ubique el archivo correspondiente";
char texto4[]="3) Presione el boton Aceptar";
char texto5[]="4) Disfrute del Mathcad 7 Professional";
char szTemp[] = "MathCad exefile\0demomcad.exe\0\0";
char szName[256] = "Demomcad.exe";
char data1[] = "ThIs VeRsIoN oF MaThCaD\0"; // offset 29b285
char data2[] = "ííWiLl NeVeR ExPiRe!!\0"; // offset 2982a3
char data3[] = "íCrAcKeD vErSiOn!\0"; // offset 29b34e
char data4[] = {0x33, 0xc0, 0x40, 0x90}; // offset 201792
char data5[] = {0x90, 0x90}; // offset 20179b
char data6[] = {0xeb}; // offset 20179f
char data7[] = {0x90,0x90}; // offset 2017b8
char data8[] = {0x90,0x90,0x90,0x90,0x90,0x90}; // offset 2017ee
int PASCAL WinMain( HINSTANCE hInstance,
HINSTANCE,
LPSTR ,
int )
{
MSG msg;
WNDCLASS clase;
clase.lpszClassName = "XXX";
clase.hInstance = hInstance;
clase.lpfnWndProc = MainWindowProc;
clase.hCursor = LoadCursor( NULL, IDC_ARROW );
clase.hIcon = LoadIcon( hInstance, MAKEINTRESOURCE(ICON_1) );
clase.lpszMenuName = NULL;
clase.hbrBackground = (HBRUSH)(COLOR_BACKGROUND);
clase.style = CS_HREDRAW | CS_VREDRAW;
clase.cbClsExtra = 0;
clase.cbWndExtra = 0;
RegisterClass( &clase );
hInst = hInstance;
hWnd = CreateWindow( "XXX",
"Crack Applicator",
WS_BORDER,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
HWND_DESKTOP,
NULL,
hInstance,
NULL );
ShowWindow (hWnd, SW_SHOWMAXIMIZED); // Muestra la Ventana
UpdateWindow ( hWnd ); // La redibuja
while( GetMessage(&msg, NULL, 0, 0 ))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
UnregisterClass( "XXX", hInst );
return (msg.wParam);
}
//*******************************************************************
//****************** MainWindowProc
//*******************************************************************
long FAR PASCAL _export MainWindowProc( HWND hWnd,
unsigned message,
WPARAM wParam,
LPARAM lParam )
{
switch (message)
{
case WM_DESTROY:
PostQuitMessage(0);
break;
case WM_PAINT:
PaintMainWindow( hWnd );
DLGPROC lpproc;
if( show )
break;
show=1;
lpproc = (DLGPROC)MakeProcInstance ((FARPROC)FirstProc, hInst);
if( DialogBox (hInst, MAKEINTRESOURCE(First), hWnd, lpproc) )
MessageBox( hWnd,
"No se ha podido aplicar el jodido crack",
"Error!",
MB_OK );
else
MessageBox( hWnd,
"íEl crack ha sido aplicado!",
"Al Fin...",
MB_OK );
FreeProcInstance ((FARPROC)lpproc);
DestroyWindow( hWnd );
break;
default:
return (DefWindowProc( hWnd, message, wParam, lParam ));
}
return 0L;
}
void PaintMainWindow( HWND hWnd )
{
PAINTSTRUCT ps;
HDC hDC;
HPEN pen, oldpen;
RECT rect;
GetClientRect( hWnd, &rect );
hDC = BeginPaint( hWnd, &ps );
for( int i=rect.top; i<rect.bottom; i++)
{
pen = CreatePen( PS_SOLID, 0, RGB( 0,0, 255-(BYTE)(((float)i/(float)rect.bottom)*255) ) );
oldpen = SelectObject(hDC, pen);
MoveToEx( hDC, rect.left, i, NULL );
LineTo( hDC, rect.right, i );
SelectObject(hDC, oldpen);
DeleteObject(pen);
}
HFONT font, oldfont;
font = CreateFont( 37,
18,
0,
0,
700,
1,
0,
0,
ANSI_CHARSET,
OUT_TT_PRECIS,
CLIP_DEFAULT_PRECIS,
PROOF_QUALITY,
0x04 | FF_DECORATIVE,
"Arial" );
oldfont = SelectObject( hDC, font );
SetTextColor(hDC, RGB(0,0,0));
SetBkMode( hDC, TRANSPARENT );
TextOut( hDC, 14, 28, texto, sizeof(texto)-1 );
SetTextColor(hDC, RGB(255,255,255));
TextOut( hDC, 10, 25, texto, sizeof(texto)-1 );
SelectObject( hDC, oldfont );
DeleteObject( font );
EndPaint( hWnd, &ps );
}
BOOL FAR PASCAL _export FirstProc (HWND hDlg,
UINT message,
WPARAM wParam,
LPARAM)
{
switch (message)
{
case WM_PAINT:
HDC hDC, hdcMemory;
PAINTSTRUCT ps;
HBITMAP hBitmap, hbmpold;
HPEN pen, oldpen;
hDC = BeginPaint( hDlg, &ps );
hBitmap = LoadBitmap( hInst, MAKEINTRESOURCE(BITMAP_2) );
hdcMemory = CreateCompatibleDC(hDC);
hbmpold = SelectObject(hdcMemory, hBitmap);
BitBlt(hDC, 0, 0, 400, 81, hdcMemory, -2, -2, SRCCOPY);
SelectObject(hdcMemory, hbmpold);
DeleteDC( hdcMemory );
DeleteObject( hBitmap );
pen = CreatePen( PS_SOLID, 1, RGB( 100,100, 100 ) );
oldpen = SelectObject(hDC, pen);
MoveToEx( hDC, 2, 80, NULL );
LineTo( hDC, 2, 2 );
LineTo( hDC, 400, 2 );
MoveToEx( hDC, 10, 285, NULL );
LineTo( hDC, 390, 285 );
SelectObject(hDC, oldpen);
DeleteObject(pen);
pen = CreatePen( PS_SOLID, 1, RGB( 255,255, 255 ) );
oldpen = SelectObject(hDC, pen);
MoveToEx( hDC, 10, 286, NULL );
LineTo( hDC, 390,286 );
MoveToEx( hDC, 400, 2, NULL );
LineTo( hDC, 400,80 );
LineTo( hDC, 1,80 );
SelectObject(hDC, oldpen);
DeleteObject(pen);
HFONT font, oldfont;
font = CreateFont( 18,
8,
0,
0,
400,
0,
0,
0,
ANSI_CHARSET,
OUT_TT_PRECIS,
CLIP_DEFAULT_PRECIS,
PROOF_QUALITY,
0x04 | FF_DECORATIVE,
"Arial" );
oldfont = SelectObject( hDC, font );
SetTextColor(hDC, RGB(0,0,0));
SetBkMode( hDC, TRANSPARENT );
TextOut( hDC, 30, 120, texto1, sizeof(texto1)-1 );
TextOut( hDC, 50, 142, texto2, sizeof(texto2)-1 );
TextOut( hDC, 50, 164, texto3, sizeof(texto3)-1 );
TextOut( hDC, 50, 186, texto4, sizeof(texto4)-1 );
TextOut( hDC, 50, 208, texto5, sizeof(texto5)-1 );
SelectObject( hDC, oldfont );
DeleteObject( font );
EndPaint( hDlg, &ps );
case WM_SYSCOMMAND:
switch( wParam & 0xfff0 )
{
case SC_MOVE:
return TRUE;
default:
return FALSE;
}
case WM_SHOWWINDOW:
RECT wrect;
GetWindowRect( hWnd, &wrect );
MoveWindow( hDlg,
(wrect.right/2) - 205,
(wrect.bottom/2) - 200,
410,
350,
1 );
break;
case WM_COMMAND:
switch( wParam )
{
case IDC_SEGUIR:
OPENFILENAME ofnTemp;
ofnTemp.lStructSize = sizeof( OPENFILENAME );
ofnTemp.hwndOwner = hDlg; // An invalid hWnd causes non-modality
ofnTemp.hInstance = 0;
ofnTemp.lpstrFilter = (LPSTR)szTemp; // See previous note concerning string
ofnTemp.lpstrCustomFilter = NULL;
ofnTemp.nMaxCustFilter = 0;
ofnTemp.nFilterIndex = 1;
ofnTemp.lpstrFile = (LPSTR)szName; // Stores the result in this variable
ofnTemp.nMaxFile = sizeof( szName );
ofnTemp.lpstrFileTitle = NULL;
ofnTemp.nMaxFileTitle = 0;
ofnTemp.lpstrInitialDir = NULL;
ofnTemp.lpstrTitle = "Abrir"; // Title for dialog
ofnTemp.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_PATHMUSTEXIST;
ofnTemp.nFileOffset = 0;
ofnTemp.nFileExtension = 0;
ofnTemp.lpstrDefExt = "*";
ofnTemp.lCustData = 0L;
ofnTemp.lpfnHook = NULL;
ofnTemp.lpTemplateName = NULL;
if( GetOpenFileName( &ofnTemp ) )
{
HANDLE hfile;
SECURITY_ATTRIBUTES info;
info.nLength = sizeof(SECURITY_ATTRIBUTES);
if( (hfile = CreateFile(ofnTemp.lpstrFile,
GENERIC_READ | GENERIC_WRITE,
0,
&info,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS,
NULL ))==INVALID_HANDLE_VALUE)
MessageBox( hWnd,
"Algo anda mal... Intentelo nuevamente.",
"Error!",
MB_OK );
else
{
unsigned long tam;
char temp[256];
sprintf(temp, "El Archivo %s no es el correcto.", ofnTemp.lpstrFile);
tam = GetFileSize (hfile, (LPDWORD)NULL);
if (tam != filelen)
{
MessageBox( hWnd, temp, "Error!", MB_OK );
CloseHandle( hfile );
break;
}
SetFilePointer( hfile, 0x201792L, NULL, FILE_BEGIN );
WriteFile( hfile, data4, 4, &tam, NULL );
SetFilePointer( hfile, 0x20179BL, NULL, FILE_BEGIN );
WriteFile( hfile, data5, 2, &tam, NULL );
SetFilePointer( hfile, 0x20179FL, NULL, FILE_BEGIN );
WriteFile( hfile, data6, 1, &tam, NULL );
SetFilePointer( hfile, 0x2017B8L, NULL, FILE_BEGIN );
WriteFile( hfile, data7, 2, &tam, NULL );
SetFilePointer( hfile, 0x2017eeL, NULL, FILE_BEGIN );
WriteFile( hfile, data8, 6, &tam, NULL );
SetFilePointer( hfile, 0x29b285L, NULL, FILE_BEGIN );
WriteFile( hfile, data1, sizeof(data1), &tam, NULL );
SetFilePointer( hfile, 0x29b2a3L, NULL, FILE_BEGIN );
WriteFile( hfile, data2, sizeof(data2), &tam, NULL );
SetFilePointer( hfile, 0x29b34eL, NULL, FILE_BEGIN );
WriteFile( hfile, data3, sizeof(data3), &tam, NULL );
CloseHandle( hfile );
EndDialog( hDlg, 0 );
}
}
break;
case IDC_CANCELAR:
EndDialog( hDlg, 1 );
break;
}
return TRUE;
}
return FALSE;
}