首页
社区
课程
招聘
找来一个简单的crackme,给初学者练习用
发表于: 2008-6-17 09:32 32814

找来一个简单的crackme,给初学者练习用

2008-6-17 09:32
32814
收藏
免费 0
支持
分享
最新回复 (64)
雪    币: 207
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
51
#include<stdio.h>
#include <memory.h>
#include <string.h>

int Count(char * name)
{
  int sum =0;
  unsigned int i = 0;
  
  for(;i<strlen(name);i++)
    sum += name[i];
  return sum;
}

unsigned long GetNum(char * username ,int namelen)
{
  unsigned long num =namelen;
  unsigned int i;
  int temp=0;
  for(i=namelen;i>0;i--)
  {
                         //不能写成一个表达式,- -!
                //貌似因为temp 与num寄存器有冲突,会丢失数据
                //不知道有谁遇到过?知道为什么的?分享下?
    temp= i*((temp&0xFFFFFF00)|(int(*(username+i-1))));
    num +=temp;

  }

  return num;
}

int KeyGen(char * username)
{
  
  int i;
  int namelen;
  char Rcode[22] = {0};
  long  num1 = 0,num2=0,num3=0,num4=0,num5=0;
  long _EAX,_EBX,_ECX,_EDX;
  
  
  
  strcpy(Rcode,"HNT-");
  namelen = strlen(username);
  //5-8
  num3 = (username[0]*username[namelen-1]*username[namelen/2]);
  for(i=7; i!=3; i--)
  {
    Rcode[i] = num3 %0x0A+0x30;
    num3/=0x0A;
   
   
  }
  strcpy(Rcode+8,"-");

  
  
  num1 = GetNum(username,namelen);
  
  //貌似不能转为高级语言?
  _asm
  {
      xor eax,eax
      cpuid
      mov _EAX,eax
      mov _EBX,ebx
      mov _ECX,ecx
      mov _EDX,edx
      
  }

  //10-13
  num1 &=_EBX;
  for(i=12;i!=8;i--)
  {
  
    Rcode[i]  = (num1)%0x0A+0x30;
    num1/=0x0A;
   
  }
  strcpy(Rcode+13,"-");

  num2 = ((Count(username)^_EDX)|_ECX)*username[0]*username[1];

  //15-18
  for(i=17;i!=13;i--)
  {
    Rcode[i] = char(unsigned long (num2) %0x0A+0x30);
    num2 =  unsigned long (num2)/0x0A;
  }

  num5 = GetNum(username,namelen);

  strcpy(Rcode+18,"-");
  Rcode[19] = Count(username)%0x1A+0x41;
  Rcode[20] =  char(unsigned long(num5) %0x1A +0x41);
  strcpy(Rcode+21,"\0");

  printf("\n%s\n",Rcode);

  return 0;

}

int main(void)
{
  char username[30] = {0};

  printf("Input username:");
  scanf("%s",username);

  KeyGen(username);

  return 0;
}
2009-7-17 13:21
0
雪    币: 318
活跃值: (10)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
52
这个程序的算法不是很难,但是算法太长了,估计很少有人来写注册机
2009-7-19 18:06
0
雪    币: 15
活跃值: (16)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
53
下来学习学习。。。。
2009-7-22 20:42
0
雪    币: 233
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
54
出来了   还不清楚怎么回事呢  但还是高兴  嘿嘿
aa
HNT-2673-0261-8655-MH
2009-8-3 10:48
0
雪    币: 200
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
55
Rainbow_7
HNT-1980-3012-7806-OQ
不才,算法还不知道。。。。
2009-8-3 14:00
0
雪    币: 175
活跃值: (40)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
56
用vbs写了个注册机,效率低下。
'不支持双字节字符
Option Explicit

Dim s1, s2, s3, s4, sName, sKey
Dim EBX, ECX ,EDX

sName = InputBox("Name:", "", "MPL")

If sName = "" Then WSH.Quit 1

s1 = IntToStr(f_1(sName))
GetCpuInfo EBX, ECX ,EDX
s2 = IntToStr((f_2(sName) And EBX))
s3 = IntToStr(iMul((f_3(sName) Xor EDX) Or ECX, Asc(Mid(sName, 1, 1)) * Asc(Mid(sName, 2, 1))))
s4 = f_4(f_3(sName)) & f_4(f_2(sName))

sKey = "HNT-" & s1 & "-" & s2 & "-" & s3 & "-" & s4

InputBox "Key:", "", sKey



Function f_1(ByVal s)
Dim iLen
iLen = Len(s)
f_1 = Asc(s) * Asc(Mid(s, iLen, 1)) * Asc(Mid(s, iLen \ 2 + 1, 1))
End Function

Function f_2(ByVal s)
Dim i, iLen, iResult, iEdx
iLen = Len(s)
iResult = 0
iEdx = 0
For i = iLen To 1 Step -1
iEdx = ((iEdx \ &H100) * &H100 + Asc(Mid(s, i, 1))) * i
iResult = iResult + iEdx
Next
f_2 = iResult + iLen
End Function

Sub GetCpuInfo(EBX, ECX, EDX)
Dim s, oCPU
For Each oCPU In GetObject("winmgmts:\\.\root\cimv2:Win32_Processor").instances_
s = oCPU.Manufacturer
Exit For
Next
EBX = StrToInt(Left(s, 4))
EDX = StrToInt(Mid(s, 5, 4))
ECX = StrToInt(Right(s, 4))
End Sub

Function StrToInt(ByVal s)
Dim i, iResult
iResult = 0
For i = 1 To Len(s)
iResult = iResult + Asc(Mid(s, i, 1)) * &H100 ^ (i - 1)
Next
StrToInt = iResult
End Function

Function f_3(ByVal s)
Dim i, iResult
iResult = 0
For i = 1 To Len(s)
iResult = iResult + Asc(Mid(s, i, 1))
Next
f_3 = iResult
End Function

Function iMul(ByVal iA, ByVal iB)
Dim sA, sB, sResult
Dim i, j, acc, n
Dim aA(7), aB(7), arr(7, 7), aResult(7)
sA = Right("00000000" & HexEx(iA), 8)
sB = Right("00000000" & HexEx(iB), 8)

For i = 0 To 7
aA(i) = Eval("&H" & Mid(sA, 8 - i, 1))
aB(i) = Eval("&H" & Mid(sB, 8 - i, 1))
Next

For i = 0 To 7
For j = 0 To 7
arr(i, j) = 0
Next
Next

For i = 0 To 7
acc = 0
For j = 0 To 7
If i + j > 7 Then Exit For
n = aA(j) * aB(i) + acc
arr(i, i + j) = n Mod &H10
acc = n \ &H10
Next
Next

acc = 0
For i = 0 To 7
n = 0
For j = 0 To 7
n = n + arr(j, i)
Next
n = n + acc
aResult(i) = Hex(n Mod &H10)
acc = n \ &H10
Next

sResult = ""
For i = 0 To 7
sResult = aResult(i) & sResult
Next

iMul = CStr(Eval("&H" & Right(sResult, 7)) + Eval("&H" & Left(sResult, 1)) * 16 ^ 7)
End Function

Function HexEx(ByVal iNum)
Dim a(), i, s, sResult
If iNum = 0 Then
sResult = "0"
Else
s = "0123456789ABCDEF"
i = -1
Do
i = i + 1
ReDim Preserve a(i)
If iNum < 1 Then
a(i) = 0
Else
a(i) = Split(CStr(iNum), ".")(0)
iNum = iNum / 16
End If
Loop Until a(i) = 0

sResult = ""
For i = UBound(a) To 1 Step -1
sResult = sResult & Mid(s, a(i - 1) - a(i) * 16 + 1, 1)
Next
End If

HexEx = sResult
End Function

Function f_4(ByVal n)
f_4 = Chr(Eval("&H" & Right(Hex(n Mod &H1A + &H41), 2)))
End Function

Function IntToStr(ByVal n)
' Dim i, sResult
' sResult = ""
' For i = 1 To 4
' sResult = CStr(n Mod 10) & sResult
' n = n \ 10
' Next
' IntToStr = sResult
IntToStr = Right("0000" & CStr(n), 4)
End Function
2009-8-7 08:37
0
雪    币: 222
活跃值: (11)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
57
挺牛的..呵
2009-8-18 11:17
0
雪    币: 21
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
58
stary
HNT-9755-0256-9800-RY
不会写 注册机
2009-8-19 16:35
0
雪    币: 231
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
59
看看啊,呵呵
2009-8-19 18:15
0
雪    币: 203
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
60
最好教下写注册机   很像学的
2009-8-19 21:27
0
雪    币: 96
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
61
Name:gujifly
Code:HNT-8615-0337-4269-IF

------------------------------------------------------------
00401237   .  E8 FC000000   CALL Crackme.00401338
寄存器:EAX
------------------------------------------------------------

呵呵,算法部分看得有点晕,还是写内存注册机算了。
2009-8-25 13:24
0
雪    币: 222
活跃值: (11)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
62
serverking
HNT-0330-2499-5857-WR
这个也太明显了吧....
2009-8-25 16:03
0
雪    币: 203
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
63
name:  yangshuyuan
key:     HNT-4240-4535-8327-QJ
2009-8-25 17:09
0
雪    币: 150
活跃值: (22)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
64
呵呵,都不错
2013-7-12 11:48
0
雪    币: 21
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
65
感谢这个CrackME,独立破解,收获不小。此题跟CPU有关,同样的用户名,Intel和AMD的密码是不一样的,请注意了。
2013-7-23 04:02
0
游客
登录 | 注册 方可回帖
返回
//