;abd 3.0 key disk-emu program(lockup) code segment 'code' assume cs:code alt equ 038h tab equ 0fh int_num equ 0d0h int_vec equ int_num*4h magic_key proc far org 100h start:jmp begin newirq0 db int_num file db 'key.dat',0 buff db 3072 dup(?) int0e_begin proc near push ds push es push ax push bx mov ax,0 ;out 21h,al mov es,ax ;mov ax,es:[200h] ;mov es:[4],ax ;mov ax,es:[202h] ;mov es:[6],ax ;pushf ;pop ax ;or ax,300h ;push ax ;popf ;nop ;nop ;nop ;nop ;nop ;nop ;nop cli mov al,11h out 20h,al jmp d1 d1: mov al,8 out 21h,al jmp d2 d2: mov al,4 out 21h,al jmp d3 d3: mov al,1 out 21h,al jmp d4 d4: mov al,0 out 21h,al sti mov byte ptr cs:[0e92h],90h mov byte ptr cs:[0e93h],90h mov byte ptr cs:[0e94h],90h mov ax,cs mov es:[6h],ax lea ax,cs:int13_begin mov es:[4h],ax pop bx pop ax pop es pop ds ret int0e_begin endp int13_begin: cmp dl,0 jz b1 jmp zz b1:cmp ax,0201h jz read cmp ax,0202h jz b2 jmp zz b2:cmp cx,0001h jz b3 jmp zz b3: push cx push si push di push ds push cs pop ds mov di,bx mov si,offset buff mov cx,1024 rep movsb pop ds pop di pop si pop cx jmp quit read: cmp cx,1801h jnz a1 jmp r1801 a1:cmp cx,1802h jnz a2 jmp r1802 a2:cmp cx,1803h jnz a3 jmp r1803 a3:cmp cx,1804h jnz a4 jmp r1804 a4:cmp cx,1805h jnz a5 jmp r1805 a5:cmp cx,1806h jnz a6 jmp r1806 a6:cmp cx,1807h jnz a7 jmp r1807 a7:cmp cx,1808h jnz a8 jmp r1808 a8:cmp cx,1809h jnz a9 jmp r1809 a9:cmp cx,180ah jnz aa jmp r180a aa:cmp cx,180bh jnz ab jmp r180b ab:cmp cx,180ch jnz ac jmp r180c ac:cmp cx,180dh jnz ad jmp r180d ad:cmp cx,180eh jnz ae jmp r180e ae:cmp cx,180fh jnz af jmp r180f af:cmp cx,1810h jnz aaa jmp r1810 aaa:cmp cx,18aah jmp r18aa jmp zz ;;;;;;;;;;;;;;1;;;;;;;;;; r1801: push ax push cx push di mov di,bx mov ax,1111h stosw mov ax,0 mov cx,510 rep stosb pop di pop cx pop ax mov ax,1 jmp quit ;;;;;;;;;;;;;;2;;;;;;;;;; r1802: r1803: r1804: r1805: r1806: r1807: r1808: r1809: r180a: r180b: r180c: r180d: r180e: r180f: r1810: push ax push cx push di mov di,bx mov ax,0 mov cx,512 rep stosb pop di pop cx pop ax mov ax,1 jmp quit ;;;;;;;;;;;;;;aah;;;;;;;;;; r18aa: push cx push si push di push ds push cs pop ds mov di,bx mov si,offset buff+1024 mov cx,2048 rep movsb pop ds pop di pop si pop cx mov ax,1000h jmp quit zz: jmp dword ptr cs:old_int13 quit: iret old_int13 dw ? a dw ? newirqvec dw int_vec irq0:int 08h iret irq1:int 09h iret irq2:int 0ah iret irq3:int 0bh iret irq4:int 0ch iret irq5:int 0dh iret irq6: call int0e_begin int 0eh ;push ax ;push cx ;push si ;push di ;push es ;push ds ;mov ax,0b800h ;mov es,ax ;mov si,0 ;mov di,0 ;mov cx,100h ;rep movsb ;mov ax,0 ;mov ds,ax ;mov ax,8000h ;mov es,ax ;mov cx,400h ;mov di,0 ;mov si,0 ;rep movsb ;pop ds ;pop es ;pop di ;pop si ;pop cx ;pop ax iret irq7:int 0fh iret set_irq proc mov si,cs:newirqvec mov ax,0 mov es,ax lea ax,irq0 mov es:[si],ax mov es:[si+2h],cs lea ax,irq1 mov es:[si+4h],ax mov es:[si+6h],cs lea ax,irq2 mov es:[si+8h],ax mov es:[si+0ah],cs lea ax,irq3 mov es:[si+0ch],ax mov es:[si+0eh],cs lea ax,irq4 mov es:[si+10h],ax mov es:[si+12h],cs lea ax,irq5 mov es:[si+14h],ax mov es:[si+16h],cs lea ax,irq6 mov es:[si+18h],ax mov es:[si+1ah],cs lea ax,irq7 mov es:[si+1ch],ax mov es:[si+1eh],cs cli mov al,11h out 20h,al jmp de1 de1: mov al,cs:newirq0 out 21h,al jmp de2 de2: mov al,4 out 21h,al jmp de3 de3: mov al,1 out 21h,al jmp de4 de4: mov al,0 out 21h,al sti ret set_irq endp begin: push cs pop ds mov dx,offset file mov ax,3d00h int 21h mov bx,ax mov ax,3f00h mov cx,3072 mov dx,offset buff int 21h mov ah,3eh int 21h push es push cs pop ds call set_irq pop es mov ax,cs mov ds,ax mov ah,35h mov al,40h int 21h mov ax,es mov old_int13,bx mov old_int13+2,ax lea dx,end_add add dx,101h int 27h end_add: magic_key endp code ends end start