|
Eagle的破文:(重写)FlashGet1.65的算号器
) D3 |: j) i0 n! r$ ]: b
! b; ^; q6 A. L再次声明:本破文曾发表于www.chinadfcg.com& B& C7 I( n: l6 w; Y
声明:上次写完1.60A的算号器,LeNgHost告诉我,FlashGet会在一段时间后验证第四段KEY,所以现在针对最新的FlashGet重写了算号破文。谢谢大家的支持。其实,这个算号器算出来的号还不是正版的。只能用一段时间,因为最后的几段的算法我没有时间去找了。$ {* s2 `3 H5 |9 _& n9 u- W" j
& e: F" N/ o1 @( r( }% v+ `, F8 g
【破解作者】 Eagle
* u! t3 R; n: Y, x: L# \【作者邮箱】 eagle_twenty@163.com c! g5 p* e. `6 p' y; } Q
【使用工具】 OllyDbg1.09
) x( h9 i+ u3 N, d; s; b" [9 E1 b【破解平台】 WinXP
6 f3 z* ~3 C5 ^% C; r1 q【软件名称】 FlashGet1.652 r% G' B$ t3 n3 Q: [. f
【加壳方式】 无壳 l: T6 g8 ^) D3 m2 q2 y& V
【破解声明】 ( d' Q) b9 q8 S6 t8 r
--------------------------------------------------------------------------------1 a& f% B/ O1 n2 F
【破解内容】 {, ]2 G' k' v! u2 q4 r' o1 p4 o
2 \+ n3 `2 w3 h+ z: N5 F- @8 n- Q
4 B7 [) f" p: b# ?, k! S8 q- X
安装FlashGet1.60A并运行,输入完注册码的时候,它会提示重新启动软件来检测是否注册成功,同时用RegMoniter监视到FlashGet1.60A写入注册表项RegPass, RegName等。用PEID侦壳:无。0 v) B+ P, a1 K8 O. [
6 E0 n' V# ?: `/ }1.用OD加载FlashGet1.60A,查找参考字符串,在涉及RegPass的地方下断,运行' \1 O. y# [0 `- ?. d
2.程序第一次即中断在此,从上下文来看,这段代码有大量的跳转,有很大可能是注册码验证代码
/ ~; [5 M0 s9 R5 X0041DCE6 |. 68 98E55200 PUSH flashget.0052E598 ; ASCII "RegPass"
# F5 s0 p" R8 X8 b; b- }0041DCEB |. 8D4C24 1C LEA ECX,DWORD PTR SS:[ESP+1C], p2 {; W5 I4 a! ~+ b. }
0041DCEF |. 68 A0C15200 PUSH flashget.0052C1A0 ; ASCII "General"
) W1 ^. c: k: [+ U0041DCF4 |. 51 PUSH ECX1 N5 K' i( Q/ T( I; D" `
0041DCF5 |. 8BCD MOV ECX,EBP/ g6 {$ O8 C7 N* H
;这个CALL将从注册表中读入注册码9 ?8 e& B, R. l' ]
0041DCF7 |. E8 54C70C00 CALL flashget.004EA450
# v' X4 C' M2 X- I, x7 g& Z
* I1 G/ F8 N! h; K
) q8 W& \$ ]! ` C9 _% [分析下面一段代码,可以发现每个条件跳转都跳向flashget.0041DE7B,可以那儿就是验证失败后的跳转方向) @& O& g) t% }& n, p0 N
……
# Z& h+ @8 V; E* f/ `" C0041DD27 |. 0F84 4E010000 JE flashget.0041DE7B3 h$ B- K- b# U# {: O
……1 p/ M, o( o& {7 j
0041DD35 |. 0F84 40010000 JE flashget.0041DE7B! O1 i$ D" ?7 X: ?. y
……
$ X. f# [3 [4 C2 O7 p0041DD4F |. 0F8E 26010000 JLE flashget.0041DE7B: S6 r! |: {7 y2 q
……* K$ b$ w: X& N" {; y
0041DD63 |. 0F8C 12010000 JL flashget.0041DE7B9 H6 @" c' i0 A5 f
……
* d" u* T3 K+ X$ Z" V6 C! q2 w3 @0041DD77 |. 0F8C FE000000 JL flashget.0041DE7B" c: |( {4 [$ M4 e4 Q0 s
……
! b! B2 A" r" y8 I! ]# ^7 };下面这个CALL是计算KEY的长度的,要求的KEY的长度为0x2C,也就是44位5 @2 W. P$ `+ o/ l' `
0041DD86 |. E8 F4200B00 CALL flashget.004CFE7F% n9 b# I) P4 r" B- G
0041DD8B |. 8B55 00 MOV EDX,DWORD PTR SS:[EBP]
' R$ ]% B4 C9 t8 h) @% i0041DD8E |. 8B42 F8 MOV EAX,DWORD PTR DS:[EDX-8]2 N0 _! |5 [- A8 h- n
0041DD91 |. 83F8 2C CMP EAX,2C
4 O, V0 B. `, N& [( W2 u0041DD94 |. 0F85 E1000000 JNZ flashget.0041DE7B
" ]( \9 d4 S0 p- t1 x
% d9 E. O ]5 ^! R2 J3 E, z;下面是验证注册码的类型的,fgc-和fgf-两种KEY的验证算法是一的,
v0 }$ [9 {$ ? K! f. W' z;但用来对KEY进行解密的密钥是不一样的,我们可以看到密钥类型的标志是存入DWORD PTR SS:[ESP+10]# R6 I* C, K/ A6 ~. x
;这次破解我们用的是fgf-的类型的密钥. Y/ C( m# Z0 {# ~4 c {) m; Z- b
0041DD9A |. 68 B0E55200 PUSH flashget.0052E5B0 ; ASCII "fgc-"0 t- c1 q( Y& e
0041DD9F |. 8BCD MOV ECX,EBP
! H4 E! O$ `) G7 X" F0041DDA1 |. E8 401D0B00 CALL flashget.004CFAE67 r1 b4 G+ u0 n U; }$ a
0041DDA6 |. 85C0 TEST EAX,EAX7 V, w2 h: k6 O, l' O* ^' S
0041DDA8 |. 75 06 JNZ SHORT flashget.0041DDB0. F) J6 y8 j) J0 T3 ~4 k: [
0041DDAA |. 895C24 10 MOV DWORD PTR SS:[ESP+10],EBX: Y# L4 Y2 {, [8 y
0041DDAE |. EB 18 JMP SHORT flashget.0041DDC8, s" Z& ~# j, r
0041DDB0 |> 68 A8E55200 PUSH flashget.0052E5A8 ; ASCII "fgf-"
/ D' ?* s' b1 M" I$ N3 l- U0041DDB5 |. 8BCD MOV ECX,EBP. C+ Z9 \' r& b' g u; G6 ^6 J
0041DDB7 |. E8 2A1D0B00 CALL flashget.004CFAE6
% X" ?$ Z$ E# b- ?% x" Z0041DDBC |. 85C0 TEST EAX,EAX
6 R% b6 ]" I' m0041DDBE |. 0F85 B7000000 JNZ flashget.0041DE7B
- |9 u& o* |+ e, T/ p+ M0041DDC4 |. 894424 10 MOV DWORD PTR SS:[ESP+10],EAX7 U+ n' U; I1 c7 y3 ~# ]
* v4 u% C% L, M* R
: B! ?) L* x C4 G, I, b1 {;下面是对KEY的验证算法
/ v5 f0 }* A/ D: ^) s0 x0041DDC8 |> 6A 2C PUSH 2C
- `5 k6 a6 Y# K0041DDCA |. 8BCD MOV ECX,EBP V1 c8 v z' [) d0 N
0041DDCC |. E8 7A680B00 CALL flashget.004D464B
. |9 D4 m3 N, F5 N0041DDD1 |. 8BF8 MOV EDI,EAX6 f% I% T4 L R$ b- c
0041DDD3 |. 33C9 XOR ECX,ECX
- p$ q3 [6 t+ W$ A( \0 U0041DDD5 |. 83C7 04 ADD EDI,4
2 ^% {) m9 @8 f6 i3 ~/ M0041DDD8 |. 33F6 XOR ESI,ESI$ J3 H9 z5 J- p& \$ C
% K9 X! X4 Q$ Q$ F
' O$ @& w9 l: L) j# `' M" f P+ u分析下面一个循环,我们把每一段KEY的四们定义成ABCD,则有
- q) |* J) O. ?6 u! M* ~0041DDDA |> 8B07 /MOV EAX,DWORD PTR DS:[EDI]
+ w7 x+ ^" F. O& d0041DDDC |. 8BD6 |MOV EDX,ESI
. P. G6 }- O- H" Y/ u- E$ y0041DDDE |. 83C7 04 |ADD EDI,4
9 N s, w( ?& Z* [' y1 w" ^0041DDE1 |. 83EA 00 |SUB EDX,0 ; Switch (cases 0..2)
/ M1 X* k$ ] s j3 [/ d; a0041DDE4 |. 894424 1C |MOV DWORD PTR SS:[ESP+1C],EAX, X0 ~! Y9 O4 {4 A# q) B
0041DDE8 |. 74 26 |JE SHORT flashget.0041DE10) Z& E* n$ {9 }1 m) X m' h( f$ _
0041DDEA |. 4A |DEC EDX: _6 U3 B- O! B1 z+ }
0041DDEB |. 74 17 |JE SHORT flashget.0041DE04
+ m" B8 n# q3 y: r* k0041DDED |. 4A |DEC EDX' H9 c3 l3 G+ D- x" F. t2 J
0041DDEE |. 75 38 |JNZ SHORT flashget.0041DE28
4 X/ X: t% x6 m, }9 k
+ ?) ?& ]* y! B0041DDF0 |. 0FBE4C24 1E |MOVSX ECX,BYTE PTR SS:[ESP+1E] ; Case 2 of switch 0041DDE1
7 o$ ^- [$ @ v5 E1 t+ v0041DDF5 |. 0FBED4 |MOVSX EDX,AH# _% x" u& G4 Y5 M7 y
0041DDF8 |. 0FAFCA |IMUL ECX,EDX
$ f5 M' Q4 O$ Y( _+ x1 ^& G0041DDFB |. 0FBE5424 1F |MOVSX EDX,BYTE PTR SS:[ESP+1F]0 ~$ ]# |# j' m
0041DE00 |. 03CA |ADD ECX,EDX, ] b5 a, K9 \
0041DE02 |. EB 1F |JMP SHORT flashget.0041DE23( ]$ W+ y. k3 Z; p! ~2 \5 y
;ECX = B * C + D
8 C/ A# b, P u# S( g+ [
8 _5 @& {# e6 u: {5 Q& W# w- u8 E, }- H/ A
0041DE04 |> 0FBE4C24 1E |MOVSX ECX,BYTE PTR SS:[ESP+1E] ; Case 1 of switch 0041DDE1% x& e( d( S0 S$ p# V/ x1 [4 P5 Z
0041DE09 |. 0FBED4 |MOVSX EDX,AH) A5 ]5 y5 d* v, t
0041DE0C |. 23CA |AND ECX,EDX, p) D" [: }. Y a, B: }
0041DE0E |. EB 0B |JMP SHORT flashget.0041DE1B0 a3 M, D& P8 Z1 @
;ECX = C AND B8 M8 @- S; X y' D' }. D: o
/ L. p, R+ [, I, n" {+ h n1 ^4 O$ p' _: c: G5 j: S
0041DE10 |> 8A4C24 1E |MOV CL,BYTE PTR SS:[ESP+1E] ; Case 0 of switch 0041DDE1/ ~$ ` j4 ?+ U: X ?! J% R8 Q1 Q( \4 o
0041DE14 |. 8AD4 |MOV DL,AH" r4 A6 u! k+ G2 K5 y
0041DE16 |. 33CA |XOR ECX,EDX
" g" n/ z- ?" F/ ~% R2 |8 k$ C$ r0041DE18 |. 83E1 7F |AND ECX,7F
+ J% D% }" ~! B; B' O8 @" P6 J0 \;ECX = C XOR B,不要被后面的那个AND ECX,7F迷惑了,它只不过是用来把高位屏蔽的
1 ~7 l' ^1 e# n' V' w7 w2 D
) s1 D% k1 V. @6 q3 t* k0 E& t
9 G; q8 a' ?0 Y0041DE1B |> 0FBE5424 1F |MOVSX EDX,BYTE PTR SS:[ESP+1F]9 r4 q: C* K! |3 L+ `5 Q- A P
0041DE20 |. 0FAFCA |IMUL ECX,EDX- p* f" W: f9 X
;ECX = ECX * D& V( X m* v& {1 j
6 z2 \8 @" x9 C9 Z9 m
Q8 V; Z3 }3 I+ n$ K b0 y' N. v0041DE23 |> 0FBEC0 |MOVSX EAX,AL
/ h6 S7 M# o5 I$ X0041DE26 |. 03C8 |ADD ECX,EAX
( s3 R2 G* S2 `;ECX = ECX + A
}* I3 N4 i: y6 D;处理后那些跳转,可以得到
0 ^$ G, R6 B! b) D;Case 0:ECX = (C XOR B) * D + A
b" O" j! ^4 b: ^* ]' ]$ n;Case 1:ECX = (C AND B) * D + A0 B# i* w; J; V# r( Q
;Case 2:ECX = B * C + D + A+ \6 C" i: g% C
$ r- L% T& F; U* s0 d* q5 L# F
1 x& X" s( U( O
7 ~/ r" X* [ [0 k U2 z;下面是用验证密钥来对算得的ECX值进行验证,我们来看它的密钥获取方法. v! ^: T9 d1 S& V4 Q) e# h1 u
;密钥存放在DS:[52C72B]起始的一段空间,为kevinhyx12345,8 Y A' d8 @2 W2 O6 L/ ^
;如果KEY的第一段为fgf-,运算所用到的密钥是顺序从这个字符串中读取的,
6 D% y0 `1 E3 H* ^;如果KEY的第一段是fgc-,运算所用到的密钥是顺序在Case 2的时候会从DS:[52C72B]中读取,即密钥的第四位: i
2 ]& n6 ?* F# @. s8 e0041DE28 |> 8B4424 10 |MOV EAX,DWORD PTR SS:[ESP+10] ; Default case of switch 0041DDE1% Z Q: e( Y* ~$ r$ O l
0041DE2C |. 85C0 |TEST EAX,EAX
. C# x9 E( n" y- s9 i0041DE2E |. 74 0C |JE SHORT flashget.0041DE3C
8 L9 F6 L5 l' o$ T0041DE30 |. 0FBE1D 2BC7520>|MOVSX EBX,BYTE PTR DS:[52C72B]$ n/ s! D& A$ r# j
0041DE37 |. 83FE 02 |CMP ESI,2
0 ]7 h$ j y% X2 p0041DE3A |. 74 07 |JE SHORT flashget.0041DE43
{0 X5 q- H9 E1 g2 c# l3 Y! S0041DE3C |> 0FBE9E 28C7520>|MOVSX EBX,BYTE PTR DS:[ESI+52C728]
3 n' Y0 w. y h/ C6 U
, q0 B' P: e2 w ?% w;对于运算结果的验证也很简单,只是用密钥的ASC码来除ECX中的值,余数在EDX中。9 W) L, X$ p1 y% S- K. o$ s! v
0041DE43 |> 8BC1 |MOV EAX,ECX( }& }( |2 ?$ l
0041DE45 |. 33D2 |XOR EDX,EDX
0 ` l# P; f! d: p4 C0041DE47 |. F7F3 |DIV EBX& Y/ m( m& V7 l# O3 y/ b9 x
0 N r4 r& _" T: F0 S2 M$ J( C% x: C
8 v/ j% R3 }4 ^;以上是对指定段的KEY的验证运算,下面是对结果的判断7 `" e1 J4 L/ p+ F# d3 b
0041DE49 |. 8BC6 |MOV EAX,ESI
, Y8 {/ p: \! e" T0041DE4B |. 83E8 00 |SUB EAX,0 ; Switch (cases 0..2)
5 V" U4 n/ u' L' ^) [+ _0041DE4E |. 74 13 |JE SHORT flashget.0041DE63 P; r0 J& _! k& Z
0041DE50 |. 48 |DEC EAX
4 t( a4 e3 t8 G% X9 T: n, {0041DE51 |. 74 09 |JE SHORT flashget.0041DE5C
7 f. v. R- N) E9 s/ A0041DE53 |. 48 |DEC EAX
8 Z6 F1 W8 N8 h; T+ X0041DE54 |. 75 11 |JNZ SHORT flashget.0041DE67
1 C' S7 s% f; R( I c, w- f9 \* r* [' Y! G6 o `% ^6 b# M
;余数是否为02 V) S6 H6 F" P# M1 }! o- }/ I" B
0041DE56 |. 85D2 |TEST EDX,EDX ; Case 2 of switch 0041DE4B6 s) C b% c! s4 W/ j
0041DE58 |. 75 18 |JNZ SHORT flashget.0041DE72
; E" z6 G, d; P1 y0041DE5A |. EB 0B |JMP SHORT flashget.0041DE67( D( p4 J: ?/ I$ K) d; d
9 r% [3 A& Q% u0 N( b4 j5 N;余数是否为8
% h( ]$ @! g& {% n U# H5 v& [, [0041DE5C |> 83FA 08 |CMP EDX,8 ; Case 1 of switch 0041DE4B
|; ^/ m( n" x4 x# C" i0 q( K0041DE5F |. 75 11 |JNZ SHORT flashget.0041DE72' ] f7 L9 V8 m; s! ?6 Z" \* q
0041DE61 |. EB 04 |JMP SHORT flashget.0041DE67
1 O1 I% x' Z# O0 N7 z, L: d' g' b& j# T( I9 s3 ~% r
;余数是否为0
2 {# u9 i; j- Z! x' y! o0041DE63 |> 85D2 |TEST EDX,EDX ; Case 0 of switch 0041DE4B
) k6 n% P. g9 X/ f. T% m1 T0041DE65 |. 75 0B |JNZ SHORT flashget.0041DE72! i6 e: m- }" |5 B8 \( o
+ h# x% O7 ^% ]0 h
0041DE67 |> 46 |INC ESI ; Default case of switch 0041DE4B
; j, Q- q+ S- P/ [0041DE68 |. 83FE 03 |CMP ESI,3
1 L7 ], ]' D! U! y6 D2 G& q0041DE6B |. 7D 23 |JGE SHORT flashget.0041DE90
- w" w/ F( L) C1 h. u& ~& [# T+ E) t0041DE6D |.^E9 68FFFFFF \JMP flashget.0041DDDA
7 `5 G2 w4 m( Q- B- i9 ~. _% o( y3 {! d U
所以这三段的KEY的验证算法是:
! J% T& X( A: aCase 0(B XOR C) * D + A) MOD X = 0,这儿X是'k'
% c: j- a, i5 P0 r6 M2 l, v6 O. B1 eCase 1(B AND C) * D + A) MOD X = 0,这儿X是'e'
9 E$ q' s( r' ?Case 2B * C + D + A) MOD X = 0,对于fgf-类的KEY,这儿X是'v';对于fgc-类的KEY,这儿X是'i'
8 d/ D$ U7 D* @ U E5 }6 W4 A8 P# p3 i q$ ^. h
LeNgHost告诉我,FlashGet会在一段时间后验证第四段KEY,于是我就在程序正常运行后在那段已经读入内存的KEY上下了内存断点,并在RegPass也下了断点。出去逛完一个下午后……中断成功了……
9 ^$ H% z$ z! U4 F1 u8 W) N' l8 Q0042514C |. 8B48 10 MOV ECX,DWORD PTR DS:[EAX+10]" G0 K9 k% o' |, l$ u4 r
0042514F |. 83C0 10 ADD EAX,10; J: h9 k- I0 b9 w
00425152 |. 894C24 08 MOV DWORD PTR SS:[ESP+8],ECX" D i4 d! F# d6 k7 Z
00425156 |. 6A FF PUSH -1( D Q6 |2 ]1 t; H$ d, Q* ]
00425158 |. 0FBE4424 0E MOVSX EAX,BYTE PTR SS:[ESP+E]
" s! _5 f$ C4 S) G& }/ e# }0042515D |. 0FBED5 MOVSX EDX,CH
/ i0 F8 I) s4 |2 p6 L- @7 |. K00425160 |. 0BC2 OR EAX,EDX' s4 P2 T9 b7 N- \
00425162 |. 0FBE5424 0F MOVSX EDX,BYTE PTR SS:[ESP+F]
% ~* n" l: ]) R( g00425167 |. 0FAFC2 IMUL EAX,EDX
) Q# }/ b! f9 S0042516A |. 0FBEC9 MOVSX ECX,CL6 t. [: @. a% e$ b) w
0042516D |. 03C1 ADD EAX,ECX& Q) _' r* Q( f/ \4 A- q9 J9 r
;跟踪分析得EAX = (B OR C) * D + A# E' P3 `% r3 b7 e: ^6 U ^
6 M; ?8 A Z$ Y7 N
0042516F |. 33D2 XOR EDX,EDX) x) z$ }+ x+ {2 y# c8 ^$ r
% y2 C H# w9 j- R) H+ d! \6 d! _;验证用的密钥直接来自DS:[52C72B],哈哈,就是'i'
3 B9 d8 a4 }" S: x2 P- e0 r00425171 |. 0FBE0D 2BC7520>MOVSX ECX,BYTE PTR DS:[52C72B]4 c+ Z% a& ^$ h6 q; R2 |6 S
00425178 |. F7F1 DIV ECX
( h( _/ q- u: [+ E% n/ ~0042517A |. 8BCE MOV ECX,ESI
/ ?* p, ?3 ?5 g1 v8 a) |
" I# f/ O u, T8 @7 T;判断余数是否为0
* X. K; v1 X2 t8 l0042517C |. 85D2 TEST EDX,EDX) @7 y ?6 ~' ?; c3 ?
0042517E |. 74 1E JE SHORT flashget.0042519E
! F$ C$ T+ \: T) a k Q; x, ]6 K' c6 i* U
所以这一段的算法是((B OR C) * D + A) MOD X = 0,这儿X是'i': G/ _% |3 S$ N: c/ u: I2 F
; G, a0 e+ A; j+ c# d! S; S
$ U# {( z8 x6 Z8 Q: `) G/ I2 f只要KEY能符合这四个条件就可以了。我用VB做出了对应的算号器代码:
9 H) l- G: O V' ?' u! q: d( R Randomize
1 e& n" l: i" d; n% ? Dim intEbx As Integer Y7 F# T. @/ P: U. ?% g) R
Dim i As Integer, j As Integer, k As Integer, intChar As Integer
4 h& A3 B0 }( y: K2 S Dim strCode As String
7 ]- R8 _5 d0 a* N/ e
: Z# Y1 W& @6 @# g: y+ r( C) c: M If fgf Then
8 F! ?( t& R5 Z, k2 H strCode = "fgf-"
/ V$ Z% I% p" x; P intEbx = 118" V+ a4 y4 M8 s8 i5 ^9 ~
Else- f6 `5 \2 Z G( Q5 ?: J
strCode = "fgc-"! v0 ^, }- S1 O+ K6 }' X2 Q7 ?
intEbx = 105; i2 z9 x) B: L- ~$ B5 ~- @: }
End If
! R# e7 w6 q4 A# D 4 Z* d9 E7 \4 S$ f5 Y
Do
. {, C6 [( B8 A, K" [ intChar = 97 + Int(Rnd() * 25): d5 z. I& x c1 V/ @
For i = 48 To 574 D( |, E8 H$ O8 M7 p5 F
For j = 48 To 571 x4 t' [3 Y, q3 F% H
For k = 48 To 574 j M- W& y/ E _# f k+ m
If (((i Xor j) And 127) * k + intChar) Mod 107 = 0 Then2 o. h/ u) N. ~: J4 u- B
strCode = strCode & Chr(intChar) & Chr(i) & Chr(j) & Chr(k)* C3 H1 |, o; R2 u8 R
Exit Do
- ^! Z. ~* `: F9 s End If+ y% `) F6 X1 [" F k" ~* G6 R
Next k0 x: E5 r1 \% S6 N5 b5 @- {8 C
Next j
% ?8 ^" G$ }. U5 U3 i* E" t Next i3 q0 O# `* G0 S, m% F
Loop/ `' U; T @& i( T5 `7 J
: x4 q! f9 R7 Q& n; [
Do0 q+ ]* y8 w: n7 q6 G7 e- ]4 R
intChar = 97 + Int(Rnd() * 25)
3 i Y, w _# ?) ~1 o0 U3 O For i = 48 To 57, P# b% d: {$ U" w, _' A% g8 a
For j = 48 To 577 ?3 z1 K! w! e# Y: k1 i& @
For k = 48 To 574 P! o% _1 i/ {1 y' k. N
If ((i And j) * k + intChar) Mod 101 = 8 Then# X- @6 B: _: N0 c* s# o3 e' a
strCode = strCode & Chr(intChar) & Chr(i) & Chr(j) & Chr(k)
( M* j2 `+ z/ w Exit Do
. N3 |8 H l3 S End If
' @( h8 H* I' V+ W( `* r Next k
* M Q9 A9 b+ t3 k Next j6 H! K( p& e2 I% q: c% C
Next i8 V s4 F3 w: D$ I
Loop
5 [7 G4 N& j; n( T w8 s/ A3 l$ b$ T* g8 H2 E o; |8 e9 q
Do" @; Q; d; a- `( G& l$ m) Y
intChar = 97 + Int(Rnd() * 25)* m6 a( |6 B! I, f
For i = 48 To 57
. |0 c6 p3 p( c+ }4 l) m5 O For j = 48 To 57
/ A$ F" @- B8 i u3 c1 S For k = 48 To 57# \3 a U) i6 [
If (i * j + k + intChar) Mod intEbx = 0 Then1 o; g t" }# \
strCode = strCode & Chr(intChar) & Chr(i) & Chr(j) & Chr(k)
/ y4 F) V6 b6 k Exit Do* l$ v1 a$ F" i+ U4 M. H! i
End If
6 \8 }7 t& P8 p& T/ `1 p Next k
$ d! D& O+ m: }. f# x( } Next j
! @+ I5 l: y+ D Next i+ D. t) j1 c% \( D0 |& ^0 F
Loop5 d5 {: Y: T. p. r/ r, q
5 r4 H9 k+ a% \+ z
Do" j( c2 }( L. k+ s' E; u* q% v
intChar = 97 + Int(Rnd() * 25); P2 X M8 {$ v6 q2 [
For i = 48 To 579 ?; h# V: v' s
For j = 48 To 57
. g9 C+ L; b ^1 S9 Z! |# O; Z7 w For k = 48 To 57
% _) S8 @3 J. k6 ~# W If ((i Or j) * k + intChar) Mod 105 = 0 Then
9 X2 ]4 d9 f F) u3 }, H strCode = strCode & Chr(intChar) & Chr(i) & Chr(j) & Chr(k)
: ~! a* m4 } d& N8 b4 ~" \ Exit Do
* }; o6 U9 J! N8 F3 ]! F, C' u End If
( \& r) g) d2 u4 l; O Next k
; H# t3 A' g8 r9 ` Next j
" L; b. Y* R6 t" c0 }: x9 z S Next i3 q/ V$ E2 R/ Q7 r8 h
Loop. t6 Z/ ^7 M+ M7 F- ?
/ u/ }( d' m% d8 U2 J2 |: I: p7 A8 j, W
'后面的24位随机生成。
% P6 X ^0 _. Q( b$ }3 i* N7 B+ Y For i = 1 To 6
. s/ W6 `8 K3 S, v6 u2 V) C intChar = 97 + Int(Rnd() * 25)
5 _* [% |2 u' q( \4 t strCode = strCode & Chr(intChar)& Q# I* k' V' r4 ]0 K
For j = 1 To 3
" k. E# v0 [# L' O& J intChar = 48 + Int(Rnd() * 9)+ U- e2 v) m" g" P
strCode = strCode & Chr(intChar)8 s: J+ m: s. U1 \) w& k
Next j
, w* \0 O! z, w& {, c5 l$ M0 q3 q Next i
/ a, d) g) t$ S$ m# C( R T0 o" }" W' d4 k; B) t+ V. [! o4 P
- m! Z1 P9 f6 \1 J/ ~% ~! w最后字符串strCode就是所要求的KEY |
|