中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net  论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

游客:  注册 | 登录 | 命令行 | 会员 | 搜索 | 上传 | 帮助 »
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » 一个锁硬盘的小程序,让硬盘不能写,只能读
作者:
标题: 一个锁硬盘的小程序,让硬盘不能写,只能读 上一主题 | 下一主题
kickout
高级用户




积分 667
发帖 135
注册 2002-10-25
状态 离线
『楼 主』:  一个锁硬盘的小程序,让硬盘不能写,只能读

这是我以前练习时自己编得玩的,编译成EXE文件后。。。不要轻易去试啊,到时出了意外我不负责。。。
=======================================
     .model tiny
      .code
diskio equ 13h
video equ 10h
org 200h
getpassword proc
passbegin:
myroutine:
          push cs
          pop ds
          mov di,offset headmsg
          call put_str
          mov di,offset pswbuffer
          call readstr
          mov si,offset pswbuffer
          mov di,offset password
          xor ch,ch
          mov cl,byte ptr [di]
          repe cmpsb
          jz right
          mov di, offset errormsg
          call put_str
deadloop :
          jmp deadloop
right:
          ret
readstr proc near
          push es
          push di
          push cs
          pop es
          inc di
          mov plength,0
next:
          cmp plength,15
          jge @l1
          mov ah,1
          int 16h
          jz next
          mov ax,0
          int 16h
          cmp al,0
          je next
          cmp al,08
          je @l2
          cmp al,13
          je @l1
          sub al,20
          or al,80h
          stosb
          mov al,'X'
          mov bx,0
          mov ah,0eh
          int 10h
          inc plength
          jmp next
@l2:
          cmp plength,0
          je next
          dec di
          mov al,00h
          stosb
          mov ah,03h
          mov bh,00h
          int 10h
          dec dx
          mov ah,02h
          int 10h
          mov al,' '
          mov ah,0eh
          int 10h
          mov ah,02h
          int 10h
          dec plength
          dec di
          jmp next
   @l1:
          pop di
          mov al,byte ptr plength
          mov byte ptr [di],al
          pop es
          ret
   readstr endp
  ;
  put_str proc
          mov al,cs:[di]
          cmp al,'$'
          je a1
          mov ah,0eh
          mov bx,0003h
          int video
          inc di
          jmp put_str
   a1:
         ret
  put_str endp
  plength db 0
  headmsg db"圹鄄膊北卑鞍   PASS WORD FOR HD SYSTEM     鞍氨北膊槽圹",0AH,0DH
          db"****** PassWord is: MASTER ******(NOT  master!!!!)",0ah,0dh
          db"****** I am Sorry harddisk is write protect!!!!!",0ah,0dh
          db"****** BUT You Can type the password to visit drive C:",0ah,0dh
          db"圹鄄膊北卑鞍 Please input Password(MASTER) 鞍氨北膊槽圹",0ah,0dh
          db  0ah,0dh
          db 'Password:','$'
  passtail:
  passlen  equ 1024-(passtail-passbegin)
           db passlen dup(0)
           org passbegin+1024
  getpassword    endp
   org 600h
   getpass proc
   pbegin:
          push ax
          push cx
          push ds
          push es
          push si
          push di
          xor ax,ax
          mov ds,ax
          mov es,ax
          mov ax,ds:[3f0h]
          mov ds,ax
          mov es,ax
          mov di,offset pswbuffer
          call preadstr
          mov si,offset pswbuffer
          mov di,offset password
          xor ch,ch
          mov cl,byte ptr[di]
          repe cmpsb
          mov ax,1075h
          mov cx,5
          jz right2
$t1:
          add ax,200h
          call music
          call delay
          loop $t1
          call nosound
          pop di
          pop si
          pop es
          pop ds
          pop cx
          pop ax
          stc
          ret
right2:
          mov ax,2275h
$t4:
          sub ax,200h
          call music
          call delay
          loop $t4
          call nosound
          pop di
          pop si
          pop es
          pop ds
          pop cx
          pop ax
          clc
          ret
preadstr proc near
         push es
         push di
         inc di
         mov plength,0
pnext :
         cmp plength ,15
         jge @pl1
         mov ah,1
         int 16h
         jz pnext
         mov ax,0
         int 16h
         cmp al,0
         je pnext
         cmp al,08
         je @pl2
         cmp al,13
         je @pl1
         sub al,20
         or al,80h
         stosb
         inc plength
         jmp pnext
@pl2:
         cmp plength,0
         je pnext
         dec di
         mov al,00h
         stosb
         dec plength
         dec di
         jmp pnext
@pl1:
         pop di
         mov al,byte ptr plength
         mov  byte ptr [di],al
         pop es
         ret
preadstr  endp
timer2 equ 42h
tim_ctr equ 43h
port_b equ 61h
music proc
         push ax
         mov al,10110110b
         out tim_ctr,al
         pop ax
         out timer2,al
         mov al,ah
         out timer2 ,al
         in al,port_b
         or al,00000011b
         out port_b,al
         ret
music endp
nosound proc
         in al,port_b
         and al,11111100b
         out port_b,al
         ret
nosound endp
delay proc
         push si
         mov si,0a000h
  @j1:
         dec si
         cmp si,0
         jnz @j1
         pop si
         ret
  delay endp
  errormsg db 0ah,0dh
           db"鞍氨北膊槽圹 Access Denied 圹鄄膊北卑鞍",0ah,0dh
           db"=========   Unauthorized User =========",0ah,0dh,'$'
  ptail:
  restlen equ 200h-(ptail-pbegin)-32
           db restlen dup (0)
           org pbegin+200h-32
  password db 0,15 dup(0)
  pswbuffer db 0,15 dup(1)
  getpass endp
  end

=====================








================================= kickout
大功告成,打个Kiss!
2002-10-28 00:00
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复
kickout
高级用户




积分 667
发帖 135
注册 2002-10-25
状态 离线
『第 2 楼』:  

这个好像是个中间过程,真正的锁硬盘的小程序是C语言编的。
=====================================
#include
#include
#include
#include
#include
#define MemSize* (unsigned far*)0x00400013
char sector1[512]={
        0xEB,0x64,0x90,0x07,0x1F,0xC3,0x1E,0x06,0x0E,0x0E,0x1F,0x07,
        0xB8,0x01,0x02,0xBB,0x00,0x09,0xB9,0x01,0x00,0xBA,0x80,0x01,
        0xCD,0x13,0x72,0xE7,0xBF,0x1C,0x09,0x80,0x3D,0x06,0x7C,0xDF,
        0xB8,0x01,0x02,0xBB,0x00,0x09,0xB9,0x01,0x00,0xBA,0x80,0x00,
        0xCD,0x13,0x81,0x3E,0x5C,0x09,0x13,0x07,0x74,0xC9,0xBE,0xBE,
        0x0A,0xBF,0xBE,0x0C,0xB9,0x42,0x00,0xE8,0xC3,0xF5,0xB9,0x06,
        0x00,0xBB,0x00,0x01,0xBA,0x80,0x00,0xB8,0x01,0x03,0xCD,0x13,
        0x81,0xC3,0x00,0x02,0xE2,0xF2,0xEB,0xA7,0x13,0x07,0xC5,0x18,
        0xAB,0x17,0xEC,0x02,0x00,0x9F,0x33,0xC0,0x8E,0xD8,0x8E,0xD0,
        0xBC,0x00,0x7C,0xA1,0x4C,0x00,0xA3,0x5E,0x7C,0xA1,0x4E,0x00,
        0xA3,0x60,0x7C,0xA1,0x13,0x04,0x2D,0x04,0x00,0xA3,0x13,0x04,
        0xB1,0x06,0xD3,0xE0,0x8E,0xC0,0xB9,0x00,0x02,0xBE,0x00,0x7C,
        0xBF,0x00,0x0B,0xFC,0xF3,0xA4,0x50,0xB8,0x9C,0x0B,0x50,0xCB,
        0x33,0xC0,0xCD,0x13,0x57,0x33,0xFF,0xBA,0x80,0x00,0xBB,0x00,
        0x07,0x8B,0xCF,0x83,0xC1,0x03,0xB8,0x01,0x02,0xCD,0x13,0x81,
        0xEB,0x00,0x02,0x47,0x83,0xFF,0x04,0x75,0xEC,0xBF,0x4C,0x00,
        0xC7,0x05,0xE8,0x0B,0x8C,0x45,0x02,0x5F,0x2E,0xC6,0x06,0xFC,
        0x0B,0x90,0x33,0xC0,0x8E,0xC0,0xB8,0x01,0x02,0xBB,0x00,0x7C,
        0xB9,0x02,0x00,0xBA,0x80,0x00,0xCD,0x13,0x33,0xC0,0x50,0xB8,
        0x00,0x7C,0x50,0xCB,0x1E,0x06,0x50,0x53,0x52,0x51,0xE8,0x89,
        0x00,0x59,0x5A,0x5B,0x58,0x07,0x1F,0x2E,0xFF,0x2E,0x5E,0x0B,
        0xC3,0xB4,0x03,0xB7,0x00,0xCD,0x10,0x52,0xFE,0xCE,0xFE,0xC2,
        0xB7,0x00,0xB4,0x02,0xCD,0x10,0xB4,0x08,0xCD,0x10,0x3C,0x3E,
        0x75,0x5C,0x1E,0x06,0x0E,0x1F,0x33,0xC0,0x8E,0xC0,0x56,0x57,
        0x26,0xA1,0x84,0x00,0xA3,0x17,0x01,0x26,0xA1,0x86,0x00,0xA3,
        0x19,0x01,0x8C,0x1E,0x64,0x0B,0xC7,0x06,0x62,0x0B,0x4F,0x03,
        0xBE,0x62,0x0B,0xBF,0x84,0x00,0xE8,0xC5,0xF4,0x26,0xA1,0x20,
        0x00,0xA3,0x13,0x01,0x26,0xA1,0x22,0x00,0xA3,0x15,0x01,0x8C,
        0x1E,0x64,0x0B,0xC7,0x06,0x62,0x0B,0xEC,0x02,0xBE,0x62,0x0B,
        0xBF,0x20,0x00,0xE8,0xA4,0xF4,0x5F,0x5E,0x2E,0xC6,0x06,0xFC,
        0x0B,0xC3,0x26,0x83,0x06,0x13,0x04,0x04,0x07,0x1F,0x5A,0xB7,
        0x00,0xB4,0x02,0xCD,0x10,0xC3,0x2E,0x80,0x3E,0xFC,0x0B,0x90,
        0x75,0x04,0xE8,0x77,0xFF,0xC3,0x81,0xFA,0x80,0x00,0x75,0xF9,
        0x80,0xFC,0x02,0x75,0x0E,0xE8,0xFA,0xFB,0x83,0xF9,0x01,0x75,
        0xEC,0x5A,0x59,0x41,0x51,0x52,0xC3,0x80,0xFC,0x03,0x75,0xE1,
        0x57,0xBF,0x06,0x00,0x3B,0xCF,0x74,0x05,0x4F,0x75,0xF9,0x5F,
        0xC3,0x5F,0x83,0xC4,0x0E,0x33,0xC0,0xCF,0x00,0x00,0x00,0x00,
        0x00,0x00,0x80,0x01,0x01,0x00,0x06,0x0F,0x66,0x50,0x26,0x00,
        0x00,0x00,0x3A,0x20,0x03,0x00,0x00,0x00,0x41,0x51,0x05,0x0F,
        0xA6,0xAB,0x60,0x20,0x03,0x00,0x20,0x38,0x03,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x55,0xAA
        };
char sector2[1536]={
        0xEB,0x64,0x90,0x07,0x1F,0xC3,0x1E,0x06,0x0E,0x0E,0x1F,0x07,
        0xB8,0x01,0x02,0xBB,0x00,0x09,0xB9,0x01,0x00,0xBA,0x80,0x01,
        0xCD,0x13,0x72,0xE7,0xBF,0x1C,0x09,0x80,0x3D,0x06,0x7C,0xDF,
        0xB8,0x01,0x02,0xBB,0x00,0x09,0xB9,0x01,0x00,0xBA,0x80,0x00,
        0xCD,0x13,0x81,0x3E,0x5C,0x09,0x13,0x07,0x74,0xC9,0xBE,0xBE,
        0x0A,0xBF,0xBE,0x0C,0xB9,0x42,0x00,0xE8,0xC3,0xF5,0xB9,0x06,
        0x00,0xBB,0x00,0x01,0xBA,0x80,0x00,0xB8,0x01,0x03,0xCD,0x13,
        0x81,0xC3,0x00,0x02,0xE2,0xF2,0xEB,0xA7,0x13,0x07,0xC5,0x18,
        0xAB,0x17,0xEC,0x02,0x00,0x9F,0x33,0xC0,0x8E,0xD8,0x8E,0xD0,
        0xBC,0x00,0x7C,0xA1,0x4C,0x00,0xA3,0x5E,0x7C,0xA1,0x4E,0x00,
        0xA3,0x60,0x7C,0xA1,0x13,0x04,0x2D,0x04,0x00,0xA3,0x13,0x04,
        0xB1,0x06,0xD3,0xE0,0x8E,0xC0,0xB9,0x00,0x02,0xBE,0x00,0x7C,
        0xBF,0x00,0x0B,0xFC,0xF3,0xA4,0x50,0xB8,0x9C,0x0B,0x50,0xCB,
        0x33,0xC0,0xCD,0x13,0x57,0x33,0xFF,0xBA,0x80,0x00,0xBB,0x00,
        0x07,0x8B,0xCF,0x83,0xC1,0x03,0xB8,0x01,0x02,0xCD,0x13,0x81,
        0xEB,0x00,0x02,0x47,0x83,0xFF,0x04,0x75,0xEC,0xBF,0x4C,0x00,
        0xC7,0x05,0xE8,0x0B,0x8C,0x45,0x02,0x5F,0x2E,0xC6,0x06,0xFC,
        0x0B,0x90,0x33,0xC0,0x8E,0xC0,0xB8,0x01,0x02,0xBB,0x00,0x7C,
        0xB9,0x02,0x00,0xBA,0x80,0x00,0xCD,0x13,0x33,0xC0,0x50,0xB8,
        0x00,0x7C,0x50,0xCB,0x1E,0x06,0x50,0x53,0x52,0x51,0xE8,0x89,
        0x00,0x59,0x5A,0x5B,0x58,0x07,0x1F,0x2E,0xFF,0x2E,0x5E,0x0B,
        0xC3,0xB4,0x03,0xB7,0x00,0xCD,0x10,0x52,0xFE,0xCE,0xFE,0xC2,
        0xB7,0x00,0xB4,0x02,0xCD,0x10,0xB4,0x08,0xCD,0x10,0x3C,0x3E,
        0x75,0x5C,0x1E,0x06,0x0E,0x1F,0x33,0xC0,0x8E,0xC0,0x56,0x57,
        0x26,0xA1,0x84,0x00,0xA3,0x17,0x01,0x26,0xA1,0x86,0x00,0xA3,
        0x19,0x01,0x8C,0x1E,0x64,0x0B,0xC7,0x06,0x62,0x0B,0x4F,0x03,
        0xBE,0x62,0x0B,0xBF,0x84,0x00,0xE8,0xC5,0xF4,0x26,0xA1,0x20,
        0x00,0xA3,0x13,0x01,0x26,0xA1,0x22,0x00,0xA3,0x15,0x01,0x8C,
        0x1E,0x64,0x0B,0xC7,0x06,0x62,0x0B,0xEC,0x02,0xBE,0x62,0x0B,
        0xBF,0x20,0x00,0xE8,0xA4,0xF4,0x5F,0x5E,0x2E,0xC6,0x06,0xFC,
        0x0B,0xC3,0x26,0x83,0x06,0x13,0x04,0x04,0x07,0x1F,0x5A,0xB7,
        0x00,0xB4,0x02,0xCD,0x10,0xC3,0x2E,0x80,0x3E,0xFC,0x0B,0x90,
        0x75,0x04,0xE8,0x77,0xFF,0xC3,0x81,0xFA,0x80,0x00,0x75,0xF9,
        0x80,0xFC,0x02,0x75,0x0E,0xE8,0xFA,0xFB,0x83,0xF9,0x01,0x75,
        0xEC,0x5A,0x59,0x41,0x51,0x52,0xC3,0x80,0xFC,0x03,0x75,0xE1,
        0x57,0xBF,0x06,0x00,0x3B,0xCF,0x74,0x05,0x4F,0x75,0xF9,0x5F,
        0xC3,0x5F,0x83,0xC4,0x0E,0x33,0xC0,0xCF,0x00,0x00,0x00,0x00,
        0x00,0x00,0x80,0x01,0x01,0x00,0x06,0x0F,0x66,0x50,0x26,0x00,
        0x00,0x00,0x3A,0x20,0x03,0x00,0x00,0x00,0x41,0x51,0x05,0x0F,
        0xA6,0xAB,0x60,0x20,0x03,0x00,0x20,0x38,0x03,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x55,0xAA,
        0xEB,0x64,0x90,0x07,0x1F,0xC3,0x1E,0x06,0x0E,0x0E,0x1F,0x07,
        0xB8,0x01,0x02,0xBB,0x00,0x09,0xB9,0x01,0x00,0xBA,0x80,0x01,
        0xCD,0x13,0x72,0xE7,0xBF,0x1C,0x09,0x80,0x3D,0x06,0x7C,0xDF,
        0xB8,0x01,0x02,0xBB,0x00,0x09,0xB9,0x01,0x00,0xBA,0x80,0x00,
        0xCD,0x13,0x81,0x3E,0x5C,0x09,0x13,0x07,0x74,0xC9,0xBE,0xBE,
        0x0A,0xBF,0xBE,0x0C,0xB9,0x42,0x00,0xE8,0xC3,0xF5,0xB9,0x06,
        0x00,0xBB,0x00,0x01,0xBA,0x80,0x00,0xB8,0x01,0x03,0xCD,0x13,
        0x81,0xC3,0x00,0x02,0xE2,0xF2,0xEB,0xA7,0x13,0x07,0xC5,0x18,
        0xAB,0x17,0xEC,0x02,0x00,0x9F,0x33,0xC0,0x8E,0xD8,0x8E,0xD0,
        0xBC,0x00,0x7C,0xA1,0x4C,0x00,0xA3,0x5E,0x7C,0xA1,0x4E,0x00,
        0xA3,0x60,0x7C,0xA1,0x13,0x04,0x2D,0x04,0x00,0xA3,0x13,0x04,
        0xB1,0x06,0xD3,0xE0,0x8E,0xC0,0xB9,0x00,0x02,0xBE,0x00,0x7C,
        0xBF,0x00,0x0B,0xFC,0xF3,0xA4,0x50,0xB8,0x9C,0x0B,0x50,0xCB,
        0x33,0xC0,0xCD,0x13,0x57,0x33,0xFF,0xBA,0x80,0x00,0xBB,0x00,
        0x07,0x8B,0xCF,0x83,0xC1,0x03,0xB8,0x01,0x02,0xCD,0x13,0x81,
        0xEB,0x00,0x02,0x47,0x83,0xFF,0x04,0x75,0xEC,0xBF,0x4C,0x00,
        0xC7,0x05,0xE8,0x0B,0x8C,0x45,0x02,0x5F,0x2E,0xC6,0x06,0xFC,
        0x0B,0x90,0x33,0xC0,0x8E,0xC0,0xB8,0x01,0x02,0xBB,0x00,0x7C,
        0xB9,0x02,0x00,0xBA,0x80,0x00,0xCD,0x13,0x33,0xC0,0x50,0xB8,
        0x00,0x7C,0x50,0xCB,0x1E,0x06,0x50,0x53,0x52,0x51,0xE8,0x89,
        0x00,0x59,0x5A,0x5B,0x58,0x07,0x1F,0x2E,0xFF,0x2E,0x5E,0x0B,
        0xC3,0xB4,0x03,0xB7,0x00,0xCD,0x10,0x52,0xFE,0xCE,0xFE,0xC2,
        0xB7,0x00,0xB4,0x02,0xCD,0x10,0xB4,0x08,0xCD,0x10,0x3C,0x3E,
        0x75,0x5C,0x1E,0x06,0x0E,0x1F,0x33,0xC0,0x8E,0xC0,0x56,0x57,
        0x26,0xA1,0x84,0x00,0xA3,0x17,0x01,0x26,0xA1,0x86,0x00,0xA3,
        0x19,0x01,0x8C,0x1E,0x64,0x0B,0xC7,0x06,0x62,0x0B,0x4F,0x03,
        0xBE,0x62,0x0B,0xBF,0x84,0x00,0xE8,0xC5,0xF4,0x26,0xA1,0x20,
        0x00,0xA3,0x13,0x01,0x26,0xA1,0x22,0x00,0xA3,0x15,0x01,0x8C,
        0x1E,0x64,0x0B,0xC7,0x06,0x62,0x0B,0xEC,0x02,0xBE,0x62,0x0B,
        0xBF,0x20,0x00,0xE8,0xA4,0xF4,0x5F,0x5E,0x2E,0xC6,0x06,0xFC,
        0x0B,0xC3,0x26,0x83,0x06,0x13,0x04,0x04,0x07,0x1F,0x5A,0xB7,
        0x00,0xB4,0x02,0xCD,0x10,0xC3,0x2E,0x80,0x3E,0xFC,0x0B,0x90,
        0x75,0x04,0xE8,0x77,0xFF,0xC3,0x81,0xFA,0x80,0x00,0x75,0xF9,
        0x80,0xFC,0x02,0x75,0x0E,0xE8,0xFA,0xFB,0x83,0xF9,0x01,0x75,
        0xEC,0x5A,0x59,0x41,0x51,0x52,0xC3,0x80,0xFC,0x03,0x75,0xE1,
        0x57,0xBF,0x06,0x00,0x3B,0xCF,0x74,0x05,0x4F,0x75,0xF9,0x5F,
        0xC3,0x5F,0x83,0xC4,0x0E,0x33,0xC0,0xCF,0x00,0x00,0x00,0x00,
        0x00,0x00,0x80,0x01,0x01,0x00,0x06,0x0F,0x66,0x50,0x26,0x00,
        0x00,0x00,0x3A,0x20,0x03,0x00,0x00,0x00,0x41,0x51,0x05,0x0F,
        0xA6,0xAB,0x60,0x20,0x03,0x00,0x20,0x38,0x03,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x55,0xAA,
        0xEB,0x64,0x90,0x07,0x1F,0xC3,0x1E,0x06,0x0E,0x0E,0x1F,0x07,
        0xB8,0x01,0x02,0xBB,0x00,0x09,0xB9,0x01,0x00,0xBA,0x80,0x01,
        0xCD,0x13,0x72,0xE7,0xBF,0x1C,0x09,0x80,0x3D,0x06,0x7C,0xDF,
        0xB8,0x01,0x02,0xBB,0x00,0x09,0xB9,0x01,0x00,0xBA,0x80,0x00,
        0xCD,0x13,0x81,0x3E,0x5C,0x09,0x13,0x07,0x74,0xC9,0xBE,0xBE,
        0x0A,0xBF,0xBE,0x0C,0xB9,0x42,0x00,0xE8,0xC3,0xF5,0xB9,0x06,
        0x00,0xBB,0x00,0x01,0xBA,0x80,0x00,0xB8,0x01,0x03,0xCD,0x13,
        0x81,0xC3,0x00,0x02,0xE2,0xF2,0xEB,0xA7,0x13,0x07,0xC5,0x18,
        0xAB,0x17,0xEC,0x02,0x00,0x9F,0x33,0xC0,0x8E,0xD8,0x8E,0xD0,
        0xBC,0x00,0x7C,0xA1,0x4C,0x00,0xA3,0x5E,0x7C,0xA1,0x4E,0x00,
        0xA3,0x60,0x7C,0xA1,0x13,0x04,0x2D,0x04,0x00,0xA3,0x13,0x04,
        0xB1,0x06,0xD3,0xE0,0x8E,0xC0,0xB9,0x00,0x02,0xBE,0x00,0x7C,
        0xBF,0x00,0x0B,0xFC,0xF3,0xA4,0x50,0xB8,0x9C,0x0B,0x50,0xCB,
        0x33,0xC0,0xCD,0x13,0x57,0x33,0xFF,0xBA,0x80,0x00,0xBB,0x00,
        0x07,0x8B,0xCF,0x83,0xC1,0x03,0xB8,0x01,0x02,0xCD,0x13,0x81,
        0xEB,0x00,0x02,0x47,0x83,0xFF,0x04,0x75,0xEC,0xBF,0x4C,0x00,
        0xC7,0x05,0xE8,0x0B,0x8C,0x45,0x02,0x5F,0x2E,0xC6,0x06,0xFC,
        0x0B,0x90,0x33,0xC0,0x8E,0xC0,0xB8,0x01,0x02,0xBB,0x00,0x7C,
        0xB9,0x02,0x00,0xBA,0x80,0x00,0xCD,0x13,0x33,0xC0,0x50,0xB8,
        0x00,0x7C,0x50,0xCB,0x1E,0x06,0x50,0x53,0x52,0x51,0xE8,0x89,
        0x00,0x59,0x5A,0x5B,0x58,0x07,0x1F,0x2E,0xFF,0x2E,0x5E,0x0B,
        0xC3,0xB4,0x03,0xB7,0x00,0xCD,0x10,0x52,0xFE,0xCE,0xFE,0xC2,
        0xB7,0x00,0xB4,0x02,0xCD,0x10,0xB4,0x08,0xCD,0x10,0x3C,0x3E,
        0x75,0x5C,0x1E,0x06,0x0E,0x1F,0x33,0xC0,0x8E,0xC0,0x56,0x57,
        0x26,0xA1,0x84,0x00,0xA3,0x17,0x01,0x26,0xA1,0x86,0x00,0xA3,
        0x19,0x01,0x8C,0x1E,0x64,0x0B,0xC7,0x06,0x62,0x0B,0x4F,0x03,
        0xBE,0x62,0x0B,0xBF,0x84,0x00,0xE8,0xC5,0xF4,0x26,0xA1,0x20,
        0x00,0xA3,0x13,0x01,0x26,0xA1,0x22,0x00,0xA3,0x15,0x01,0x8C,
        0x1E,0x64,0x0B,0xC7,0x06,0x62,0x0B,0xEC,0x02,0xBE,0x62,0x0B,
        0xBF,0x20,0x00,0xE8,0xA4,0xF4,0x5F,0x5E,0x2E,0xC6,0x06,0xFC,
        0x0B,0xC3,0x26,0x83,0x06,0x13,0x04,0x04,0x07,0x1F,0x5A,0xB7,
        0x00,0xB4,0x02,0xCD,0x10,0xC3,0x2E,0x80,0x3E,0xFC,0x0B,0x90,
        0x75,0x04,0xE8,0x77,0xFF,0xC3,0x81,0xFA,0x80,0x00,0x75,0xF9,
        0x80,0xFC,0x02,0x75,0x0E,0xE8,0xFA,0xFB,0x83,0xF9,0x01,0x75,
        0xEC,0x5A,0x59,0x41,0x51,0x52,0xC3,0x80,0xFC,0x03,0x75,0xE1,
        0x57,0xBF,0x06,0x00,0x3B,0xCF,0x74,0x05,0x4F,0x75,0xF9,0x5F,
        0xC3,0x5F,0x83,0xC4,0x0E,0x33,0xC0,0xCF,0x00,0x00,0x00,0x00,
        0x00,0x00,0x80,0x01,0x01,0x00,0x06,0x0F,0x66,0x50,0x26,0x00,
        0x00,0x00,0x3A,0x20,0x03,0x00,0x00,0x00,0x41,0x51,0x05,0x0F,
        0xA6,0xAB,0x60,0x20,0x03,0x00,0x20,0x38,0x03,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x55,0xAA
               };
char buffer[512];
void readstr(char*str)
{
unsigned char plength =1;
unsigned xx,yy,x;
union REGS r;
xx=wherex();yy=wherey();
x=xx;
do
{
gotoxy(xx,yy);
r.h.ah=0;
int86(0x16,&r,&r);
if((r.h.ah!=28)&&(r.h.ah!=14)&&(r.h.ah!=1))
{*(str+plength)=(r.h.al-20)|0x80;
gotoxy(xx,yy);
putch('x');
xx++;plength++;
}
else if(r.h.ah==14)
{xx--;
if(xx1)plength--;
}
else if (r.h.ah==1)plength=0;
}while((r.h.ah!=28)&&(r.h.ah!=1)&&(plength0)
{
if(*(src+plength)!=*(dest+plength))
return -1;
plength--;
}
return 1;
}
int copypass(char*src,char*dest)
{
char plength;
plength=*(src+0);
while(plength>=0)
{*(dest+plength)=*(src+plength);
plength--;
}
}
void title()
{/*puts("\n┠履履履履?); */
puts("圹鄄膊北卑鞍HD password system鞍氨北膊槽圹 ";
}
void reboot (void)
{void (far*reboot_ptr)(void);
unsigned int far*i_ptr;
clrscr();
i_ptr=MK_FP(0x0040,0x0072);
*i_ptr=0x1234;
reboot_ptr=MK_FP(0xf000,0xfffe);
reboot_ptr();}
main ()
{
char *pass;
char passwd1[16];
char passwd2[16];
char *buffer;
char filename[20];
int fp;

{
puts("Hard Disk Lock Installed or Virus infected!!!";
exit(1);
}
title();
printf("\nPassword:";
readstr(passwd1);
printf("\nVerify:";
readstr(passwd2);
if (checkpass(passwd1,passwd2)!=1)
{printf("\nPassword verify error!";
exit(1);}
pass=sector2+0x600-32;
copypass(passwd1,pass);
printf("\nBackp Filename:";
scanf("%s",filename);
fp=open(filename,O_CREAT|O_BINARY,S_IREAD|S_IWRITE);
if (fp==-1){puts("\nFile open error ";exit(1);}

buffer=(char*)malloc(512);
while((biosdisk(0x02,0x80,0,0,1,1,buffer))!=0);
while((biosdisk(0x03,0x80,0,0,3,1,buffer))!=0);
while((biosdisk(0x03,0x80,0,0,7,1,buffer))!=0);
while((biosdisk(0x03,0x80,0,0,1,1,sector1))!=0);
while((biosdisk(0x03,0x80,0,0,4,3,sector2))!=0);
write(fp,buffer,512);
close(fp);
free(buffer);
puts("\nInstall O.K.!";
printf("\nPress anykey to reboot system...............%c",0x07);
getch();
reboot();
}
===================================
真的要小心啊。。。万一不行了,用kv300(或kv3000)的修复引导扇区的功能可恢复。











================================= kickout
大功告成,打个Kiss!
2002-10-28 00:00
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复

请注意:您目前尚未注册或登录,请您注册登录以使用论坛的各项功能,例如发表和回复帖子等。


可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题



论坛跳转: