爱问知识人 爱问教育 医院库

inline hook疑问 ,为什么蓝?

首页

inline hook疑问 ,为什么蓝?

源代码如下:
MyNtGetContextThread proc ThreadHandle,ThreadContext
ret
MyNtGetContextThread endp
OldNtGetContextThread proc ThreadHandle,ThreadContext
        nop
        nop
        mov eax,NtGetContextThread_Addr
        add eax,5
        jmp eax

OldNtGetContextThread endp
DriverEntry proc pDriverObject:PDRIVER_OBJECT,pRegistryPath:PUNICODE_STRING

        pushad
        cli 
        mov eax, cr0 
        and eax,0fffeffffh
        mov cr0, eax 
        
        invoke KeRaiseIrqlToDpcLevel
        mov oldIrql,eax
        
invoke MmGetSystemRoutineAddress,$CCOUNTED_UNICODE_STRING("NtGetContextThread")
        
        mov NtGetContextThread_Addr,eax
        mov ecx,5
        mov esi,eax
        mov edi,offset OldNtGetContextThread
        rep movsb
        mov edx,offset MyNtGetContextThread
        sub edx,eax
        sub edx,5
        mov byte ptr [eax],0e9h
        xchg [eax+1],edx
        
        invoke KeLowerIrql,oldIrql
        
        mov eax, cr0
        or eax,10000h
        mov cr0, eax 
        sti 
        
        mov eax,pDriverObject
        assume eax:ptr DRIVER_OBJECT
        mov [eax].DriverUnload,offset DriverUnload
        assume eax:nothing


        popad
        mov eax,STATUS_SUCCESS
        ret

DriverEntry endp

end DriverEntry
我想知道为什么蓝

提交回答
好评回答
  • 2011-01-06 10:41:35
    mov NtGetContextThread_Addr,eax
            mov ecx,5
            mov esi,eax
            mov edi,offset OldNtGetContextThread
            rep movsb
    复制5个字节..
    OldNtGetContextThread proc ThreadHandle,ThreadContext
            nop
            nop
    但这只有两个字节..
    lz,可以测试下.. 

    周***

    2011-01-06 10:41:35

类似问题

换一换
  • 软件 相关知识

  • 电脑网络技术
  • 电脑网络

相关推荐

正在加载...
最新问答 推荐信息 热门专题 热点推荐
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200

热点检索

  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
返回
顶部
帮助 意见
反馈

确定举报此问题

举报原因(必选):