# Re: 虽然不太可能...还是

Posted by Honey on April 27, 1999 at 23:35:09:

In Reply to: Re: 虽然不太可能...还是 posted by adan on April 26, 1999 at 23:23:11:

: 感谢honey支持,但是很多人使用者的名称都是设为abc或者123等等的,可自由设定,所以可行性可能不高
: 至于密码,我猜微软在存于登录资料库时可能有编码过,这倒无所谓,只要独一无二即可,其实连线帐号之帐号name也可以(有编码过也可),唯独在登录资料库我一直找不到这东西
windows 序号放在
HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION
中 ProductID 的值
而微软密码也的确编码过放在
HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\Network\LanMan
中Parmlenc是完全存取密码 ,Parm2enc是唯读密码
而解码方式提供你以下程式
#include
#define BUFFER 30
int DecodeCharOne(unsigned char *);
int DecodeCharTwo(unsigned char *);
int DecodeCharThree(unsigned char *);
int DecodeCharFour(unsigned char *);
int DecodeCharFive(unsigned char *);
int DecodeCharSix(unsigned char *);
int DecodeCharSeven(unsigned char *);
int DecodeCharEight(unsigned char *);

main() {

int i;
int eocc = 0;
unsigned char mybytes[] = { 0x15, 0xba, 0x6d, 0x86, 0x73, 0x89, 0xf4, 0x4a };
unsigned short tempshort;
int goupto = 0;
/* 输入密码 */
char inpt[BUFFER];
char *inptptr;
printf("Input the byte code in hex (ex: 76 d5 09 e3): ");
fgets(inpt, BUFFER, stdin); inptptr = strtok(inpt, " "); if (inpt[0] != '\n') while ((inptptr != NULL) && (goupto < 8)) {
sscanf(inptptr, "%hx", &tempshort);
mybytes[goupto++] = tempshort;
inptptr = strtok(NULL, " ");
}
/* 开始解码 */
if (!DecodeCharOne(&mybytes[0])) eocc = 1;
if (!DecodeCharTwo(&mybytes[1])) eocc = 1;
if (!DecodeCharThree(&mybytes[2])) eocc = 1;
if (!DecodeCharFour(&mybytes[3])) eocc = 1;
if (!DecodeCharFive(&mybytes[4])) eocc = 1;
if (!DecodeCharSix(&mybytes[5])) eocc = 1;
if (!DecodeCharSeven(&mybytes[6])) eocc = 1;
if (!DecodeCharEight(&mybytes[7])) eocc = 1;

/* If the password could be decoded, print it */
if (eocc) printf("The encrypted password is invalid.\n");
else {
printf("The decoded password is: \"");
for (i = 0; i < goupto; i++) printf("%c",mybytes[i]);
printf("\"\n");
}
}
int DecodeCharOne(unsigned char *mychar) {
int i = 0;
int cletter = 1;
int blockl1 = 1; int blockl2 = 1; int retval = 1; unsigned char code = 0x15;
while((i<256) && (code != *mychar)) {
switch (cletter) {
case 1:
code--; cletter++; break;
case 2: code += 3; cletter++; break;
case 3:
code--; cletter++; break;
case 4:
code -= 5; cletter++; break;
case 5:
code--; cletter++; break;
case 6:
code+=3; cletter++; break;
case 7:
code--; cletter++; break;
case 8:
cletter = 1; switch (blockl1) {
case 1: code += 11; blockl1++; break; case 2: code -= 21; blockl1++; break; case 3:
code += 11; blockl1++; break; case 4:
blockl1 = 1;
switch (blockl2) {
case 1: code = 0x75; blockl2++; break; case 2: code = 0x55; blockl2++; break; case 3:
code = 0xb5; blockl2++; break; case 4:
code = 0x15; blockl2 = 1; break; } break;
}
break; } i++; } if (i == 256) retval = 0;
else *mychar = i + 32;
return retval;
}

int DecodeCharTwo(unsigned char *mychar) {
int i = 0;
int cletter = 1;
int blockl1 = 1;
int blockl2 = 1;
int retval = 1;
unsigned char code = 0xba; /* The code for a space */
while((i<256) && (code != *mychar)) {
switch (cletter) {
case 1:
code++; cletter++; break;
case 2:
code -= 3; cletter++; break;
case 3: code++; cletter++; break;
case 4: code += 5; cletter++; break;
case 5: code++; cletter++; break;
case 6:
code -= 3; cletter++; break;
case 7:
code++; cletter++; break;
case 8:
cletter = 1; switch (blockl1) {
case 1:
code -= 11; blockl1++; break;
case 2:
code -= 11; blockl1++; break;
case 3:
code -= 11; blockl1++; break; case 4:
blockl1 = 1;
switch (blockl2) { case 1:
code = 0xda; blockl2++; break; case 2:
code = 0xfa; blockl2++; break;
case 3:
code = 0x1a; blockl2++; break; case 4: code = 0xba;
blockl2 = 1; break; } break;
}
break; } i++; } if (i == 256) retval = 0;
else *mychar = i + 32;
return retval;
}

int DecodeCharThree(unsigned char *mychar) {
int i = 0;
int cletter = 1;
int blockl1 = 1;
int blockl2 = 1;
int retval = 1;
unsigned char code = 0x6d; /* The code for a space */
while((i<256) && (code != *mychar)) {
switch (cletter) {
case 1:
code--; cletter++; break;
case 2:
code += 3; cletter++; break;
case 3:
code--; cletter++; break;
case 4: code -= 5; cletter++; break;
case 5: code--; cletter++; break;
case 6: code += 3; cletter++; break;
case 7: code--; cletter++; break;
case 8:
cletter = 1;
switch (blockl1) {
case 1:
code -= 5; blockl1++; break;
case 2:
code += 27; blockl1++; break;
case 3:
code -= 5; blockl1++; break;
case 4: blockl1 = 1;
switch (blockl2) {
case 1:
code = 0x0d; blockl2++; break;
case 2:
code = 0x2d; blockl2++; break;
case 3:
code = 0xcd; blockl2++; break; case 4: code = 0x6d; blockl2 = 1; break; } break; } break;
}
i++;
}
if (i == 256) retval = 0; else *mychar = i + 32;
return retval;
}
int DecodeCharFour(unsigned char *mychar) {
int i = 0;
int cletter = 1;
int blockl1 = 1;
int blockl2 = 1;
int retval = 1;
unsigned char code = 0x86; /* The code for a space */
while((i<256) && (code != *mychar)) {
switch (cletter) {
case 1:
code++; cletter++; break;
case 2:
code -= 3; cletter++; break;
case 3:
code++; cletter++; break;
case 4:
code -= 3; cletter++; break;
case 5: code++; cletter++; break;
case 6: code -= 3; cletter++; break;
case 7: code++; cletter++; break;
case 8: cletter = 1;
switch (blockl1) {
case 1: code += 13; blockl1++; break;
case 2: code += 13; blockl1++; break; case 3: code += 13; blockl1++; break;
case 4:
blockl1 = 1;
switch (blockl2) {
case 1: code = 0xe6; blockl2++; break;
case 2: code = 0xc6; blockl2++; break;
case 3: code = 0x26; blockl2++; break;
case 4:
code = 0x86; blockl2 = 1; break; } break; }
break;
} i++; } if (i == 256) retval = 0;
else *mychar = i + 32;
return retval;} int DecodeCharFive(unsigned char *mychar) {
int i = 0; int cletter = 1; int blockl1 = 1;
int blockl2 = 1;
int retval = 1;
unsigned char code = 0x73; /* The code for a space */
while((i<256) && (code != *mychar)) {
switch (cletter) {
case 1:
code--; cletter++; break;
case 2:
code--; cletter++; break;
case 3:
code--; cletter++; break;
case 4:
code += 7; cletter++; break;
case 5:
code--; cletter++; break;
case 6: code--; cletter++; break;
case 7: code--; cletter++; break;
case 8: cletter = 1;
switch (blockl1) {
case 1: code += 7; blockl1++; break;
case 2:
code -= 25; blockl1++; break;
case 3: code += 7; blockl1++; break;
case 4: blockl1 = 1;
switch (blockl2) {
case 1:
code = 0x13; blockl2++; break;
case 2:
code = 0x33; blockl2++; break;
case 3: code = 0x23; blockl2++; break;
case 4: code = 0x73; blockl2 = 1; break;
}
break;
}
break;
} i++; } if (i == 256) retval = 0;
else *mychar = i + 32; return retval;} int DecodeCharSix(unsigned char *mychar) { int i = 0; int cletter = 1; int blockl1 = 1;
int blockl2 = 1; int retval = 1; unsigned char code = 0x89; /* The code for a space */
while((i<256) && (code != *mychar)) {
switch (cletter) {
case 1:
code--;
cletter++;
break;
case 2:
code += 3;
cletter++;
break;
case 3:
code--;
cletter++;
break;
case 4:
code += 3;
cletter++;
break;
case 5:
code--;
cletter++;
break;
case 6:
code += 3;
cletter++;
break;
case 7:
code--;
cletter++;
break;
case 8:
cletter = 1;
switch (blockl1) {
case 1:
code -= 13;
blockl1++;
break;
case 2:
code += 19;
blockl1++;
break;
case 3:
code -= 13;
blockl1++;
break;
case 4:
blockl1 = 1;
switch (blockl2) {
case 1:
code = 0xe9;
blockl2++;
break;
case 2:
code = 0xc9;
blockl2++;
break;
case 3:
code = 0x29;
blockl2++;
break;
case 4:
code = 0x89;
blockl2 = 1;
break;
}
break;
}
break;
}
i++;
}
if (i == 256) retval = 0;
else *mychar = i + 32;
return retval;
} /* End of DecodeCharSix() */

int DecodeCharSeven(unsigned char *mychar) {
int i = 0;
int cletter = 1;
int blockl1 = 1;
int blockl2 = 1;
int retval = 1;
unsigned char code = 0xf4; /* The code for a space */
while((i<256) && (code != *mychar)) {
switch (cletter) {
case 1:
code++; cletter++; break;
case 2:
code++; cletter++; break;
case 3:
code++; cletter++; break;
case 4:
code -= 7; cletter++; break;
case 5:
code++; cletter++; break;
case 6:
code++; cletter++; break;
case 7:
code++; cletter++; break;
case 8:
cletter = 1;
switch (blockl1) {
case 1:
code += 9; blockl1++; break;
case 2:
code -= 23; blockl1++; break; case 3:
code += 9; blockl1++; break; case 4:
blockl1 = 1;
switch (blockl2) {
case 1: code = 0x94; blockl2++; break;
case 2: code = 0xb4; blockl2++; break;
case 3: code = 0x54; blockl2++; break;
case 4:
code = 0xf4; blockl2 = 1; break;
}
break; } break;
}
i++; } if (i == 256) retval = 0;
else *mychar = i + 32;
return retval;} int DecodeCharEight(unsigned char *mychar) {
int i = 0;
int cletter = 1; int blockl1 = 1; int blockl2 = 1;
int retval = 1; unsigned char code = 0x4a; /* The code for a space */ while((i<256) && (code != *mychar)) {
switch (cletter) { case 1: code++; cletter++; break;
case 2:
code -= 3; cletter++; break;
case 3:
code++; cletter++; break;
case 4:
code += 5; cletter++; break;
case 5:
code++; cletter++; break;
case 6:
code -= 3; cletter++; break;
case 7:
code++; cletter++; break;
case 8:
cletter = 1;
switch (blockl1) { case 1:
code -= 11;
blockl1++;
break;
case 2: code += 21; blockl1++; break;
case 3:
code -= 11; blockl1++; break;
case 4:
blockl1 = 1;
switch (blockl2) {
case 1:
code = 0x2a; blockl2++; break; case 2:
code = 0x0a; blockl2++; break; case 3: code = 0xea; blockl2++; break;
case 4: code = 0x4a; blockl2 = 1; break;
}
break;
}
break;
}
i++;
}
if (i == 256) retval = 0;
else *mychar = i + 32;
return retval;}

Follow Ups: