浅析Award BIOS密码的破解
2007-01-12 20:13:32 来源:WEB开发网核心提示: 源程序:#include <math.h>#include <conio.h>#define ON 0#define OFF 1void change(unsigned char x,unsigned char y){outportb(0x70,x);outport
源程序:
#include <math.h>
#include <conio.h>
#define ON 0
#define OFF 1
void change(unsigned char x,unsigned char y)
{
outportb(0x70,x);
outportb(0x71,y);
}
unsigned int sum()
{
int i;
unsigned int s=0;
for(i=0x10;i<=0x2d;i++)
{
outportb(0x70,i);
s+=inportb(0x71);
}
return(s);
}
void chsum()
{
unsigned int s;
s=sum();
change(0x2e,s>>8);
change(0x2f,s<<8>>8);
}
void clear()
{
unsigned char a;
outportb(0x70,0x11);
a=inportb(0x71)-0xc0;
change(0x11,0xc0);
chsum();
outportb(0x70,0x62);
if(inportb(0x71)==0xff)
{
outportb(0x71,0xff-a);
outportb(0x70,0x7b);
a=inportb(0x71)-a;
change(0x7b,a);
}
}
void display()
{
int i,j=0;
printf("Your Bios Mem at 0x10--0x7f:
");
for(i=0x10;i<=0x7f;i++)
{
outportb(0x70,i);
printf("%4x",inportb(0x71));
j++;
if(j%16==0) printf("
");
}
}
int code(char str[8])
{short i=0,ren;
int bin;
bin=str[i++];
while(str[i])
{
bin=bin<<2;
ren=str[i++];
bin+=ren;
}
return bin;
}
void chpass(char str[8])
{
change(0x1c,code(str)%0x100);
change(0x1d,code(str)/0x100);
chsum();
}
unsigned int getpass1(char i)
{
unsigned int a,b,p;
unsigned char x;
if(i==0) x=0x1c;
if(i==1) x=0x63;
outportb(0x70,x);
a=inportb(0x71);
outportb(0x70,x+1);
b=inportb(0x71);
p=(b<<8)+a;
return(p);
}
unsigned char *crack(char f)
{
char i=0,j=0,k=1;
unsigned int p,s=0,a=1,t;
unsigned char *b;
p=getpass1(f);
do
{
s+=a;
t=floor(p/s);
i++;
a*=4;
}
while(t<32||t>126);
b[0]=t;
for(i=i-1;i>0;i--)
{
p-=b[j++]*pow(4,i);
s-=pow(4,i);
b[k++]=floor(p/s);
}
b[k]=0;
return(b);
}
main()
{
unsigned char *p;
clrscr();
textmode(3);
printf("Award Bios Password Crack v2.0
Written By Yuky (Add:97091B2,NCIT)
");
display();
p=crack(0);
printf("Your BIOS Superviosr Password:");
textcolor(RED+BLINK);
cprintf("%s
",p);
printf("
");
printf("Your BIOS User Password:");
textcolor(GREEN+BLINK);
cprintf("%s",crack(1));
}
更多精彩
赞助商链接