|
[原创]内核态调用Nt*函数
okdodo是在DriverEntry中调用的吧 ? |
|
|
|
[讨论]驱动问题...还是在线等...
第一个问题 可以用VC配合VC助手 第二个问题 可以用Quicksys 生成驱动开发环境 可以看到哪里错误的 第三个问题 驱动是对内核的操作 很容易的蓝屏的 可以单步调试的 |
|
[原创]内核态调用Nt*函数
要是这样子,需要分析下,如果是inline hook的话,那还是被监控了.所以,你可以先恢复inline hook, 本文说的是SSDT hook,如果有inline hook的话 的确需要先恢复inline hook. 但是不管有没有什么hook ,如果想直接调用Nt*的话 还是要先设置PreviousMode为Kernel的 而对于要定位函数的地址的话,也很简单,在内存里能够执行的是PE文件,你按照PE文件的格式去定 举一个例子 NtSetValueKey |
|
[原创]内核态调用Nt*函数
还有4楼 如果函数在ntoskrnl中没有导出的话 通过MmGetSystemRoutineAddress也是得不到地址的 因此最稳定的办法还是要从ntoskrnl.exe中得到地址 |
|
[原创]内核态调用Nt*函数
可能是我表达的不够清楚 不过楼上的认识也是有错误的 The NtXxxx version of the native system service is the name of the function itself. Thus, when a Kernel Mode component calls the NtXxxx version of the system service, whatever is presently set into previous mode is unchanged. Thus, it is quite possible that the Kernel component could be running on an arbitrary User stack, with the requestor mode set to User. The system service will not know any better, attempt to validate the request parameters, possibly using the credentials of the arbitrary User Mode thread, and thus possibly fail the request. Another problem here is that one step in the validation process for a User Mode request is that all passed in buffers have either ProbeForRead or ProbeForWrite executed on them, depending on the buffer’s usage. These routines raise exceptions if executed on Kernel Mode addresses. Therefore, if you pass in Kernel Mode buffers with your request mode set to User, your calls into the native API return STATUS_ACCESS_VIOLATION. 内核组件是可能运行在任意线程的上下文中的 在Nt*函数中会检查PreviousMode 而 这个PreViousMode从哪里来? 看Nt*函数的代码 PAGE:004990D8 ; NTSTATUS __stdcall NtReadFile(HANDLE FileHandle,HANDLE Event,PIO_APC_ROUTINE ApcRoutine,PVOID ApcContext,PIO_STATUS_BLOCK IoStatusBlock,PVOID Buffer,ULONG Length,PLARGE_INTEGER ByteOffset,PULONG Key) PAGE:004990D8 push 68h PAGE:004990DA push offset stru_418748 PAGE:004990DF call __SEH_prolog PAGE:004990E4 xor esi, esi PAGE:004990E6 mov [ebp+var_20], esi PAGE:004990E9 mov [ebp+var_34], esi PAGE:004990EC mov [ebp+var_70], esi PAGE:004990EF mov [ebp+var_6C], esi PAGE:004990F2 mov eax, large fs:124h ;内核态fs指向KPCR /* ;fs:120为KPRCB lkd> dt _kprcb nt!_KPRCB +0x000 MinorVersion : Uint2B +0x002 MajorVersion : Uint2B +0x004 CurrentThread : Ptr32 _KTHREAD ;fs:124 +0x008 NextThread */ PAGE:004990F8 mov [ebp+var_58], eax PAGE:004990FB mov al, [eax+140h] /* lkd> dt _kthread nt!_KTHREAD +0x000 Header : _DISPATCHER_HEADER +0x010 MutantListHead : _LIST_ENTRY +0x018 InitialStack : Ptr32 Void +0x01c StackLimit : Ptr32 Void ........ +0x140 PreviousMode : Char ;al =PreviousMode 我已经注释的很清楚了 Nt*会根据这个PreviousMode来判断调是否需要参数检查 而现在的问题就是如果我们调用的是Zw*函数的话 Zw*函数会把PreviousMode设置为KernelMode 然后再调用Nt*函数 因此在Nt*函数中就不会进行参数检查 而如果我们直接调用Nt*函数的话(it is quite possible that the Kernel component could be running on an arbitrary User stack, with the requestor mode set to User) ,我们必须自己将PreviousMode设置为KernelMode,否则PreviousMode很可能仍然是User , 这样的话 Nt*函数就会认为对它的调用来自用户态,从而做一些检查,这时就会产生问题了(不明白的话,再看一篇那段英文)......因此我们要自己调用Nt*的话必须先将PreviousMode设为KernelMode. 谢谢楼上的回复 对我的表达能力深表抱歉!!!! 楼上如果还有疑问 ,欢迎与我继续讨论....................:p |
|
[原创]内核态调用Nt*函数
楼上得到函数地址的方法也可以 |
|
[讨论]虚函数表的作用?
[QUOTE=szdbg;374149]在逆向分析C++类的虚函数时,会发现每一个有虚函数的类均有一个虚函数表,在进行虚函数调用时,均会进入类似如下的调用: 00401084 mov eax,dword ptr [ebp-20h] ;取出虚函数表地址 00401087 lea ecx,...[/QUOTE] 运行时绑定 .. |
|
|
|
[求助]XP SP1 DDK [已解决]
http://hi.baidu.com/tshack/blog/item/f61709f7aa98c523730eec64.html |
|
[原创]发一个汇编写的“QQ性别名称任意修改器”
已经解决 谢谢 |
|
[原创]发一个汇编写的“QQ性别名称任意修改器”
试过了,强啊!有的地方不明白,能否解释下啊! CTEXT("#32770"),还有1343,1345,1356几个数据是怎么来的啊?恕我愚昧。 还有,那个修改的数据应该会返回保存到服务器上吧? 这个我也不明白 希望楼主能解释下 ? 我用spy++ 看不到control identifier 1343 1345 1356啊 .... |
|
Some Tricks To Cracking VB Programs
Thank you !!!! |
|
Some Tricks To Cracking VB Programs
Good job !!! |
|
The Blogs In English You Must Read Every Month
It's good !! |
|
[求助]这个程序到底是用什么加密的?
不清楚 !!!! |
|
[求助]电脑装了系统后出现了两个问题(winXP2)系统
第二个应该不会是系统的问题吧 都关机了 难道系统还起作用 |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值