能力值:
( LV2,RANK:10 )
28 楼
--------------------Configuration: 1 - Win32 Debug--------------------
Compiling...
1.cpp
E:\Microsoft Visual Studio\MyProjects\2\1.cpp(36) : error C2629: unexpected 'volatile int ('
E:\Microsoft Visual Studio\MyProjects\2\1.cpp(39) : error C2143: syntax error : missing ')' before '}'
E:\Microsoft Visual Studio\MyProjects\2\1.cpp(39) : error C2143: syntax error : missing ';' before ')'
E:\Microsoft Visual Studio\MyProjects\2\1.cpp(54) : error C2629: unexpected 'volatile int ('
E:\Microsoft Visual Studio\MyProjects\2\1.cpp(57) : error C2143: syntax error : missing ')' before '}'
E:\Microsoft Visual Studio\MyProjects\2\1.cpp(57) : error C2143: syntax error : missing ';' before ')'
E:\Microsoft Visual Studio\MyProjects\2\1.cpp(103) : warning C4508: 'main' : function should return a value; 'void' return type assumed
执行 cl.exe 时出错.
1.exe - 1 error(s), 0 warning(s)
能力值:
( LV2,RANK:10 )
29 楼
我来学习了。。。。。。。。。
能力值:
(RANK:860 )
31 楼
改成。C也不行啊。。。
还是有错误。。。
呵呵。。
算法没有看懂。。。
能力值:
(RANK:860 )
32 楼
请教下
你是怎么发现这个算法的哦。。
我看了好长时间的代码都没有看出来。。
脑壳都是昏的。。
能力值:
( LV2,RANK:10 )
33 楼
说明一下,因为安装VC太大,我没在机器上安装VC,所以此源码是用GCC编写编译的,如果用VC编译请把下列行改一下:
原: asm volatile ("xor %%eax,%%eax;cpuid;movl %%ebx,%0":"=m"(b));
改为:
asm {
xor eax,eax;
cpuid;
mov b,ebx;
}
原: asm volatile ("xor %%eax,%%eax;cpuid;movl %%edx,%0;movl %%ecx,%1":"=m"(d),"=m"(c));
改为:
asm {
xor eax,eax;
cpuid;
mov d,edx;
mov c,ecx;
}
因为高级语言没发写低级的代码,只能用插入汇编方式。这也是为什么汇编还是需要学。
分析时,请与20楼的一起看,就清楚了。
能力值:
( LV2,RANK:10 )
35 楼
有没有详细的破解过程,让小弟学一下
能力值:
( LV2,RANK:10 )
36 楼
谢谢搂主的Crackme了,刚学破解,正合适我,排除万难,终于写出注册机了
// Register.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
void Get1Code( char * ARegvar , DWORD AVar)
{
ARegvar --;
for(int i=4; i>=1; i--){
BYTE Mod;
Mod = AVar % 0x0A + 0x30;
AVar = AVar / 0x0A ;
* (char *) (ARegvar+ i) = Mod;
}
}
DWORD getEax(char * ARegvar)
{
DWORD nSize , nEdx,nEax;
nSize = strlen(ARegvar);
ARegvar--;
nEdx = 0;
nEax = nSize;
for( int i=nSize; i>=1 ; i--){
BYTE nChar;
nChar = *(char *) (ARegvar+i);
//printf(" nEdx = %08X\n" , nEdx);
nEdx = (nEdx & 0xFFFFFF00);
nEdx = nEdx + nChar;
//*((BYTE*)(&nEdx)) = nChar;
nEdx = nEdx * i ;
nEax = nEax + nEdx;
}
return nEax;
}
DWORD GetAscII(char *str)
{
DWORD nRst;
nRst = 0;
for(int i=0; i<=strlen(str) -1 ;i++){
nRst += str[i];
}
return nRst;
}
int _tmain(int argc, _TCHAR * argv[])
{
if( argc <=1 ){
printf("no file!\n");
return 0;
}
DWORD dwcpuID1,dwcpuID2,dwcpuID3;
DWORD D1,D2,D3,D4;
char szFactory[20];
__asm pushad
__asm xor eax,eax
//__asm mov eax,1
__asm cpuid
__asm mov dwcpuID1, ebx
__asm mov dwcpuID2, edx
__asm mov dwcpuID3, ecx
__asm mov D1,eax
__asm mov D2,ebx
__asm mov D3,ecx
__asm mov D4,edx
__asm popad
/**(DWORD*) (&szFactory[0]) = dwcpuID1;
*(DWORD*) (&szFactory[4]) = dwcpuID2;
*(DWORD*) (&szFactory[8]) = dwcpuID3;
szFactory[12] ='\0';*/
*(DWORD*) (&szFactory[0]) = D1;
*(DWORD*) (&szFactory[4]) = D2;
*(DWORD*) (&szFactory[8]) = D3;
*(DWORD*) (&szFactory[12]) = D4;
szFactory[16] ='\0';
printf("cpuID =%04X%04X%04X%04X \n" ,D1,D2,D3,D4);
//getchar();
//return 0; char RegisterCode[100],szName[50];
DWORD dwVar , dwVar1 ,dwVar3,dwVar4;
strcpy(szName, argv[1]);
dwVar = szName[0] * szName[ strlen(szName) -1 ]* szName[ strlen(szName)/2 ];
*( DWORD *) RegisterCode = 0x2D544E48;
printf("1 ----- dwVar = %08X , RegisterCode = %s \n", dwVar, RegisterCode);
Get1Code(&RegisterCode[4],dwVar);
printf("2 ----- dwVar = %08X , RegisterCode = %s \n", dwVar, RegisterCode);
dwVar1 = getEax(szName);
printf("UserName = %s, dwVar1 = %08X \n", szName , dwVar1);
dwVar1 = dwVar1 & dwcpuID1;
RegisterCode[8] = 0x2D;
Get1Code(&RegisterCode[9],dwVar1);
printf("3 ----- dwVar = %08X , RegisterCode = %s \n", dwVar1, RegisterCode); dwVar3 = GetAscII(szName);
printf("1. ASCII of Wang = %08X\n" ,dwVar3);
dwVar3 ^= dwcpuID2;
printf("2. ASCII of Wang = %08X\n" ,dwVar3);
dwVar3 |= dwcpuID3;
printf("3. ASCII of Wang = %08X\n" ,dwVar3);
dwVar3 = dwVar3 * szName[0]*szName[1] ;
printf("4. ASCII of Wang = %08X\n" ,dwVar3);
RegisterCode[13] = 0x2D;
Get1Code(&RegisterCode[14],dwVar3);
printf("4 ----- dwVar3 = %08X , RegisterCode = %s \n", dwVar3, RegisterCode);
dwVar4 = GetAscII(szName);
dwVar4 %= 0x1A;
dwVar4 += 0x41;
RegisterCode[18] = 0x2D;
RegisterCode[19] = dwVar4 & 0x000000FF;
printf("5 ----- dwVar4 = %08X , RegisterCode = %s \n", dwVar4, RegisterCode);
dwVar4 = getEax(szName);
dwVar4 %= 0x1A;
dwVar4 += 0x41;
RegisterCode[20] = dwVar4 & 0x000000FF;
RegisterCode[21] =0;
printf("6 ----- dwVar4 = %08X , RegisterCode = %s \n", dwVar4, RegisterCode);
//cout << "FileName \n" << argv[0];
printf ("FileName = %s \n ", argv[0]);
printf ("Param = %s \n ", argv[1]);
getchar();
return 0;
}
能力值:
( LV2,RANK:10 )
39 楼
无意发现 xxymg HNT-5560-0263-7712-BZ
能力值:
( LV2,RANK:10 )
40 楼
[QUOTE=;]...[/QUOTE]
admin HNT-3030-0263-7880-BX
能力值:
( LV2,RANK:10 )
41 楼
[QUOTE=;]...[/QUOTE]
004020B0 admin HNT-3030-0263-7880-BX
能力值:
( LV2,RANK:10 )
42 楼
[QUOTE=;]...[/QUOTE]
感谢楼主 但是现在还刚刚开始逆向 只能得到注册码 但是不知道改如何分析 希望能够楼主能给出算法分析
能力值:
( LV2,RANK:10 )
43 楼
111111
HNT-7649-6643-9807-IV
能力值:
( LV2,RANK:10 )
44 楼
研究了一天根据反汇编的代码写出的注册机, 本来想WINDOWS程序下的,但是那些空间的API不大熟悉,所以就写了个console下的,代码有点乱,高手不要笑啊
#include <iostream>
#include <cstring>
#include <stdio.h>
#include <windows.h>
int Count_Num(unsigned int n)
{
int sum = 0;
int multi = 1;
for (int index = 0; index < 4; index++)
{
sum += n % 10 * multi;
n = n / 10;
multi *= 10;
}
return sum;
}
void Count_Serial(char* serial, const char* name)
{
int sum1, sum2;
strcat(serial, "HNT-");
int len = strlen(name);
int temp = name[0] * name[len - 1] * name[len / 2];
temp = Count_Num(temp);
sprintf(serial + 4, "%04d", temp);
//char buffer[30];
//unsigned long size = 30;
//GetComputerName(buffer, &size);
temp = strlen(name);
int n = 0;
for (const char* p = name + temp - 1; p - name >= 0; p--)
{
*((char*)&n) = *p;
n *= p - name + 1;
temp += n;
}
sum1 = temp;
int _ecx, _edx;
_asm
{
XOR EAX, EAX
CPUID
AND temp, EBX
MOV _ecx, ECX
MOV _edx, EDX
}
temp = Count_Num(temp);
sprintf(serial + 8, "-%04d", temp);
temp = 0;
for (p = name; *p; p++)
temp += *p;
sum2 = temp;
temp ^= _edx;
temp |= _ecx;
temp *= name[0] * name[1];
temp = Count_Num(temp);
sprintf(serial + 12 + 1, "-%04d", temp);
sprintf(serial + 16 + 2, "-%c%c", 65 + sum2 % 26, 65 + sum1 % 26);
}
int main()
{
using namespace std;
char name[45];
char serial[80];
memset((void*)serial, 0, 80);
cout << "请输入用户名:(最长45个字节) ";
cin.getline(name, 45);
Count_Serial(serial, name);
cout << "你的序列号为: " << serial << endl;
return 0;
}
能力值:
( LV2,RANK:10 )
45 楼
看了5篇新手区的OLLYDBG教程, 呵呵
能力值:
( LV2,RANK:10 )
47 楼
写这个注册机是不是要看代码整体看懂?
能力值:
( LV2,RANK:10 )
48 楼
123
hnt-4950-0257-6334-ut
能力值:
( LV4,RANK:50 )
49 楼
看了几个小时,终于看懂了,写了一个注册机,不过看上面的各位大侠都把注册机的代码贴出来了,我也就不献丑了。作为偶写的第一个注册机,回复纪念下。
能力值:
( LV2,RANK:10 )
50 楼
tom23409
HNT-7212-6544-7620-WU
不知道是否正确,这个程序要算计算机名的