|
|
|
[求助]NtUserBuildHwndList的一点小问题
hwndBuffer必须是ring3的地址,ProbeForWrite是专门用来验证ring3地址的,自己看MSDN好了~~ 如果不是,ProbeForWrite就会引起异常的,不信可以自已看ProbeForWrite的反汇编代码~~ |
|
[原创]垃圾代码发生器[设计+源码]
我来支持一下~ |
|
[求助]NtUserBuildHwndList的一点小问题
呵呵,有收获就好~ |
|
[求助]NtUserBuildHwndList的一点小问题
最简单方法,把pdb和bin放在同一目录,然后IDA菜单里"Load Pdb",就OK了~~ |
|
[求助]NtUserBuildHwndList的一点小问题
先调试找出现错误的地方,然后IDA分析,IDA可以加载pdb符号的啊。。。 |
|
[求助]NtUserBuildHwndList的一点小问题
主要还是调试啊。。。 |
|
[求助]NtUserBuildHwndList的一点小问题
想起来了,它先BuildHwndList的目的是为了告诉你它到底需要多大的缓冲区~~ |
|
[求助]NtUserBuildHwndList的一点小问题
终于搞定这个问题了~~ 根本原因是NtUserBuildHwndList的最后两个参数必须是ring3地址! text:BF830E80 loc_BF830E80: ; CODE XREF: sub_BF830D9F-31j .text:BF830E80 push 4 ; Alignment .text:BF830E82 mov eax, edi .text:BF830E84 shl eax, 2 .text:BF830E87 push eax ; Length .text:BF830E88 push dword ptr [ebp+1Ch] ; Address .text:BF830E8B call ds:ProbeForWrite(x,x,x) //对HwndBuffer验证 .text:BF830E8B .text:BF830E91 mov edx, [ebp+20h] ; pBufSize .text:BF830E94 mov eax, _Win32UserProbeAddress //0x7fff0000 .text:BF830E99 cmp edx, eax .text:BF830E9B jnb loc_BF830D73 ; 若传入的是内核地址,这时将会跳走,然后产生异常 以上就是NtUserBuildHwndList中对参数的验证,对倒数第二个参数使用ProbeForWrite进行检查,显然这必须是一个ring3地址才行。如果检查未通过将产生异常,在异常处理函数里有如下代码: .text:BF830D9F sub_BF830D9F proc near ; DATA XREF: .rdata:BF98B2F8o .text:BF830D9F .text:BF830D9F ; FUNCTION CHUNK AT .text:BF830D38 SIZE 00000050 BYTES .text:BF830D9F ; FUNCTION CHUNK AT .text:BF830EE9 SIZE 00000063 BYTES .text:BF830D9F .text:BF830D9F mov esp, [ebp-18h] .text:BF830DA2 mov edi, 0C0000008h //0xC0000008状态码在这儿 .text:BF830DA7 or dword ptr [ebp-4], 0FFFFFFFFh .text:BF830DAB mov esi, [ebp-20h] .text:BF830DAE jmp loc_BF830EC5 //跳回原函数的收尾部分,edi将赋值给eax,即返回值NTSTATUS 正是以上代码导致了0xC0000008错误码的产生,而不是我上面说的那个检查DesktopHandle的函数。 而接下会对最后一个参数也会进行检查,要求必须小于Win32UserProbeAddress,也就是0x7fff0000,如果这里不满足就会跳走,然后程序会访问0x7fff0000产生一个异常,异常后同样会跳到上面的异常处理代码中,最后产生一个0xC0000008的状态码。 经我测试,把最后两个地址改成ring3的地址就可以成功了,这个地址可以由ring3传来,也可以使用ZwAllocateVirtuelMemory申请,总之是ring3的地址就行了~~ 后面附上我的一个测试代码. 使用方法:打开DbgView,先加载驱动,然后运行exe,点击"Help"->"About",程序将会向驱动发送一个DeviceIoControl,然后就可以查看结果了~ ps:大概只有我这么蛋疼的人才会花这么多时间去解决这么一个蛋疼的问题吧。。。 不过更蛋疼的是为什么NtUserBuildHwndList会先去BuildHwndList,然后才会检查传入的参数啊。。。 发现参数不正确,然后再FreeHwndList,早知如此,何必当初呢?真是蛋疼的很~~ 而且参数不正确的话,为什么返回的是0xC0000008而不是0xC000000D(STATUS_INVALID_PARAMETER)之类呢? |
|
[求助]NtUserBuildHwndList的一点小问题
ReactOS里面的代码只能当做参考,离真正的Win代码还有很多差距呢~~ 我看了一下,错误可能出在下面这个地方,希望对你有点帮助 NTSTATUS __stdcall ValidateHdesk(HANDLE Handle, KPROCESSOR_MODE Object, ACCESS_MASK DesiredAccess, int a4) { int v4; // eax@1 NTSTATUS laststatus; // edi@1 int v6; // esi@1 NTSTATUS status; // eax@1 char v9; // sf@1 status = ObReferenceObjectByHandle( Handle, DesiredAccess, (POBJECT_TYPE)ExDesktopObjectType, Object, (PVOID *)&Object, 0); v6 = a4; laststatus = status; v9 = status < 0; v4 = Object; *(_DWORD *)a4 = Object; if ( v9 ) { SetLastNtError(laststatus); } else { if ( *(_DWORD *)v4 != gSessionId || *(_BYTE *)(v4 + 23) & 0xE0 ) { laststatus = 0xC0000008u; SetLastNtError(0xC0000008u); ObfDereferenceObject(*(PVOID *)v6); } } return laststatus; } |
|
|
|
[求助]Attach 卷设备后出现IRP混乱的问题 求助
IRP_MN_LOAD_FILE_SYSTEM这个需要你自己来处理吗。。。。 |
|
[求助]NtUserBuildHwndList的一点小问题
句柄是不是有效,得看在哪个进程里,别的进程里的有效句柄在别一个进程里不一定有效 |
|
[求助]在combojiang大侠的rootkit研究中关于IAT Hook的文章中遇到一个关于分页地址的问题
lkd> !pte ffdf0000 VA ffdf0000 PDE at 00000000C0603FF0 PTE at 00000000C07FEF80 contains 0000000000749163 contains 0000000000041163 pfn 749 -G-DA--KWEV pfn 41 -G-DA--KWEV lkd> !pte 7ffe0000 VA 7ffe0000 PDE at 00000000C0601FF8 PTE at 00000000C03FFF00 contains 0000000048C2E867 contains 8000000000041025 pfn 48c2e ---DA--UWEV pfn 41 ----A--UR-V pfn都是0x41~~ |
|
[求助]SUSPENDTHREAD无法挂起线程?
5表示禁止访问,句柄虽然正确,但是可能权限太低了~ |
|
[求助]安装了DNF,但是,只要一加载驱动就蓝
源码里用KdBreakPoint() |
|
[求助]ssdt被hook了,看到反汇编的代码不知如何是好,求救。
把hook函数所在的驱动dump出来,拿IDA上它,注意去掉花指令~ |
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值