能力值:
( LV4,RANK:50 )
12 楼
#include<stdio.h>
#include<windows.h>
void convert(char * pwd, long eax){
int len;
long al;
len=strlen(pwd);
al=eax&0x000000ff;
al=al/16;
al=al&0x0f;
al=al+0x30;
if(al>0x39)
al=al+7;
pwd[len]=al;
len=strlen(pwd);
al=eax&0xff;
al=al*16;
al=al/16;
al=al&0x0f;
al=al+0x30;
if(al>0x39)
al=al+7;
pwd[len]=al;
}
int main(){
char str[48]="XP";
char str2[]={0x75, 0x0C, 0x8A, 0x1D, 0x07, 0x12, 0x40, 0x00, 0x80, 0xFB, 0x75, 0x75, 0x03, 0xC3, 0xEB, 0x00, 0x6A, 0x00, 0x68, 0x80, 0x00, 0x00, 0x00, 0x6A, 0x02, 0x6A, 0x00, 0x6A, 0x00, 0x68, 0x00, 0x00, 0x00, 0x40, 0x68, 0x47, 0x31, 0x40, 0x00, 0xE8, 0x37, 0x03, 0x00, 0x00, 0x8B, 0xD8, 0x8D, 0x35, 0x0A, 0x39, 0x40, 0x00, 0x68, 0x04, 0x01, 0x00, 0x00, 0x56, 0x6A, 0x00, 0xE8, 0x3A, 0x03, 0x00, 0x00, 0x56, 0x56, 0xE8, 0xE5, 0x02, 0x00, 0x00, 0x8D, 0x3D, 0x0A, 0x35, 0x40, 0x00, 0x68, 0x47, 0x31, 0x40, 0x00, 0x56, 0x56, 0x68, 0x53, 0x31, 0x40, 0x00, 0x57, 0xE8, 0xC7, 0x02, 0x00, 0x00, 0x83, 0xC4, 0x14, 0x57, 0xE8, 0x3C, 0x03, 0x00, 0x00, 0x8D, 0x15, 0x0E, 0x3A, 0x40, 0x00, 0x6A};
char pwd[100];
char name[30];
TCHAR szHostName[20];
DWORD dwSize=20;
DWORD dwVersion;
int i, len;
long eax, ebx, edi, esi;
memset(pwd, 0x00, sizeof(pwd));
GetComputerName(szHostName, &dwSize);
dwVersion = GetVersion();
str[2]=0x80;
str[3]=0x7C;
str[4]=dwVersion&0xff;
str[5]=dwVersion/0x100;
strcpy(&str[6], szHostName);
printf("请输入用户名:");
scanf("%s", name);
for(i=0; i<strlen(name); i++){
eax=(str[i%4]^0x12)+0x34;
ebx=(name[i]*8-0x20)^0x66;
eax=(eax&0xffffff00)+((eax&0xff)^(ebx&0xff))+ebx;
convert(pwd, eax);
}
pwd[i*2]='-';
for(i=4, eax=0; i<6; i++){
edi='X';
esi=str[i];
edi=edi-esi;
eax=eax+edi;
eax=eax-esi;
eax=eax*16;
}
eax=eax/16;
convert(pwd, eax&0xff);
convert(pwd, eax/0x100);
pwd[strlen(pwd)]='-';
len=strlen(szHostName);
for(i=0; i<len; i++){
eax=szHostName[i];
ebx=str2[i*4+3]*0x1000000+str2[i*4+2]*0x10000+str2[i*4+1]*0x100+str2[i*4];
eax=eax^ebx;
ebx=ebx^len;
ebx=ebx-eax;
ebx=ebx-len;
eax=eax+ebx;
convert(pwd, eax);
}
printf("%s\n", pwd);
getch();
return 0;
}
能力值:
( LV2,RANK:10 )
14 楼
这个CrackMe有一个简单的Anti-Debug需要注意一下,在这里:
004011F3 /$ 68 D1314000 push 004031D1 ; /ProcNameOrOrdinal = "IsDebuggerPresent"
004011F8 |. FF35 F0344000 push dword ptr [4034F0] ; |hModule = 7C805058
004011FE |. E8 8B030000 call <jmp.&kernel32.GetProcAddress> ; \GetProcAddress
00401203 |. FFD0 call eax
00401205 |. 0BC0 or eax, eax
00401207 |. 75 0C jnz short 00401215
这里检查程序是否处于Debug状态,如果是的话执行下的语句:
00401215 |> EB 00 jmp short 00401217
00401217 |> 6A 00 push 0 ; /hTemplateFile = NULL
00401219 |. 68 80000000 push 80 ; |Attributes = NORMAL
0040121E |. 6A 02 push 2 ; |Mode = CREATE_ALWAYS
00401220 |. 6A 00 push 0 ; |pSecurity = NULL
00401222 |. 6A 00 push 0 ; |ShareMode = 0
00401224 |. 68 00000040 push 40000000 ; |Access = GENERIC_WRITE
00401229 |. 68 47314000 push 00403147 ; |FileName = "\ERASER.BAT"
0040122E |. E8 37030000 call <jmp.&kernel32.CreateFileA> ; \CreateFileA
00401233 |. 8BD8 mov ebx, eax
00401235 |. 8D35 0A394000 lea esi, dword ptr [40390A]
0040123B |. 68 04010000 push 104 ; /BufSize = 104 (260.)
00401240 |. 56 push esi ; |PathBuffer => 复件_Cra.0040390A
00401241 |. 6A 00 push 0 ; |hModule = NULL
00401243 |. E8 3A030000 call <jmp.&kernel32.GetModuleFileName>; \GetModuleFileNameA
00401248 |. 56 push esi ; /pDest => 复件_Cra.0040390A
00401249 |. 56 push esi ; |pSrc => ""
0040124A |. E8 E5020000 call <jmp.&user32.CharToOemA> ; \CharToOemA
0040124F |. 8D3D 0A354000 lea edi, dword ptr [40350A]
00401255 |. 68 47314000 push 00403147 ; /<%s> = "\ERASER.BAT"
0040125A |. 56 push esi ; |<%s> => ""
0040125B |. 56 push esi ; |<%s> => ""
0040125C |. 68 53314000 push 00403153 ; |Format = ":LOOP",CR,LF,"DEL ""%s""",CR,LF,"IF EXIST ""%s"" GOTO LOOP",CR,LF,"DEL ""%s"""
00401261 |. 57 push edi ; |s => 复件_Cra.0040350A
00401262 |. E8 C7020000 call <jmp.&user32.wsprintfA> ; \wsprintfA
00401267 |. 83C4 14 add esp, 14
0040126A |. 57 push edi ; /String
0040126B |. E8 3C030000 call <jmp.&kernel32.lstrlenA> ; \lstrlenA
00401270 |. 8D15 0E3A4000 lea edx, dword ptr [403A0E]
00401276 |. 6A 00 push 0 ; /pOverlapped = NULL
00401278 |. 52 push edx ; |pBytesWritten => 复件_Cra.00403A0E
00401279 |. 50 push eax ; |nBytesToWrite
0040127A |. 57 push edi ; |Buffer
0040127B |. 53 push ebx ; |hFile
0040127C |. E8 25030000 call <jmp.&kernel32.WriteFile> ; \WriteFile
00401281 |. 53 push ebx ; /hObject
00401282 |. E8 DD020000 call <jmp.&kernel32.CloseHandle> ; \CloseHandle
00401287 |. 6A 10 push 10 ; /Style = MB_OK|MB_ICONHAND|MB_APPLMODAL
00401289 |. 68 00304000 push 00403000 ; |Title = "Crackme#3 By D4ph1"
0040128E |. 68 86314000 push 00403186 ; |Text = "Debugger found...I think im gonna kill myself!:("
00401293 |. 6A 00 push 0 ; |hOwner = NULL
00401295 |. E8 B2020000 call <jmp.&user32.MessageBoxA> ; \MessageBoxA
0040129A |. 6A 00 push 0 ; /IsShown = 0
0040129C |. 6A 00 push 0 ; |DefDir = NULL
0040129E |. 6A 00 push 0 ; |Parameters = NULL
004012A0 |. 68 47314000 push 00403147 ; |FileName = "\ERASER.BAT"
004012A5 |. 6A 00 push 0 ; |Operation = NULL
004012A7 |. 6A 00 push 0 ; |hWnd = NULL
004012A9 |. E8 04030000 call <jmp.&shell32.ShellExecuteA> ; \ShellExecuteA
004012AE |. 6A 00 push 0 ; /ExitCode = 0
004012B0 \. E8 BB020000 call <jmp.&kernel32.ExitProcess> ; \ExitProcess
这一段代码就是将批处理写入到一个bat文件中,然后调用ShellExecute函数执行改bat文件,将CrackMe和生成的.bat文件删除。
在这里,可以直接将or eax, eax修改为xor eax, eax,简单破解掉。算法使用明码比较,就像楼主分析的一样,兄弟们已经给出注册机了