|
[下载] AheadLib修改 支持x64支持类/命名空间
.CODE prevFunc proc mov [rsp+38h], rcx mov [rsp+40h], rdx mov [rsp+48h], r8 mov [rsp+50h], r9 ret prevFunc endp setFunc proc mov rax, rcx ret setFunc endp endFunc proc pop r10 add rsp, 28h pop r10 pop rcx pop rdx pop r8 pop r9 sub rsp, 20h push r10 jmp qword ptr [rax] endFunc endp END保存成asm文件加入工程就可以了 |
|
[讨论]吐槽下物流的包装。。。
wx_冰糖鳕鱼 楼主你好 我看《加密与解密》,其中有些windows函数比如CsrClientCallServer还有RtlCreateThreadEx和PsGetContextThread等等,我在msdn上怎么 ...大部分都是未公开函数,MSDN上肯定是没有的,但是网上资料还是比较多的啊 |
|
[征集寄语] 看雪20周年年会 | 感恩有你,一路同行
看雪这一路走来着实不易,始终坚持纯净的技术氛围,给了广大技术爱好者一个学习的园地,我也是在看雪这个大家庭里成长起来的。祝愿看雪越办越好! |
|
[求助]加密与解密中,注入技术这一节,关于第一个例子MsgDll.dll
这一节讲了很多种注入方式,你说的具体是哪个方式哪个例子呢?你使用的操作系统又是什么呢?编译器应该不会是问题,示例程序是可以用VC6编译的 |
|
[求助]有关于第8章,调试SEH的部分
第一个问题,为什么下断点在KiUserExceptionDispatcher?
还是例子中的这个程序,它有一段异常处理程序: ;异常处理回调函数 myHandler proc C uses ebx esi edi pExcept,pFrame,pContext,pDispatch invoke MessageBox,0,addr messuc,addr szTit,MB_APPLMODAL or MB_OK invoke ExitProcess,0 myHandler endp 用Windbg载入后,在MessageBoxA函数下断点,然后g命令开始运行,此时第一次会因为内存访问异常中断到调试器,输入gn命令让调试器忽略这个异常,让程序自己去处理,它就会调用myHandler,并调用到MessageBoxA函数,此时用kvn命令查看栈回调,是这个样子的: 0:000> kvn # ChildEBP RetAddr Args to Child 00 0018f9bc 00401019 00000000 00403003 00403000 USER32!MessageBoxA (FPO: [Non-Fpo]) WARNING: Stack unwind information not available. Following frames may be wrong. 01 0018f9e0 7ded34c1 0018facc 0018ff80 0018fb1c image00400000+0x1019 02 0018fa04 7ded3493 0018facc 0018ff80 0018fb1c ntdll!ExecuteHandler2+0x26 (FPO: [Uses EBP] [5,3,1]) 03 0018fa28 7ded3434 0018facc 0018ff80 0018fb1c ntdll!ExecuteHandler+0x24 (FPO: [5,0,3]) 04 0018fab4 7de80163 0018facc 0018fb1c 0018facc ntdll!RtlDispatchException+0x127 (FPO: [Non-Fpo]) 05 0018fab4 00000000 0018facc 0018fb1c 0018facc ntdll!KiUserExceptionDispatcher+0xf (FPO: [2,0,0]) (CONTEXT @ 00000008) 从栈中的函数名字可以大概看得出来,是系统模块ntdll在执行异常处理函数,最底层的函数就是KiUserExceptionDispatcher,是用户部分异常处理函数执行的第一步,所以在这里下断点。该函数的原型可以在Wrk中找到(研究Win系统必看资料): 函数原型可以看得很清楚,当执行到这个函数时,栈顶就是它的两个参数。对于一般函数来说,在函数头中断的时候,栈顶肯定是返回地址,然后才是参数,但是由于这个函数是从内核回调回来的, 不同于一般的普通函数调用,所以栈顶直接就是参数。 关于你的第二个问题,
CONTEXT位置为什么不一样的问题,我看了一下,这个应该是操作系统版本不同导致的区别。在我写这一章时,我是在Win7系统上调试的,相应的结果在WinXP上也是一样的。EXCEPTION_RECORD结构的定义是这样的: typedef struct _EXCEPTION_RECORD { DWORD ExceptionCode; DWORD ExceptionFlags; struct _EXCEPTION_RECORD *ExceptionRecord; PVOID ExceptionAddress; DWORD NumberParameters; ULONG_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]; } EXCEPTION_RECORD; 它的最后一个成员,定义是ULONG_PTR ExceptionInformation[15],在32位系统上,ULONG_PTR和ULONG一样都是4字节,最大是15个,你用Windbg看到的大小是0x50并没有错,实际上0x50 = 0x14 + 4*15。在Win7系统上,系统在构造
EXCEPTION_RECORD结构时是按需分配内存大小的,在本例程序中, 系统并没有使用全部的15个元素,实际使用的NumberParameters是2,也就是用了2个元素,所以计算它实际使用的空间是0x14 + 4*2 = 0x1C。这种结构的最后一个元素是变长的现象在Windows中非常常见。而在你的系统中,虽然
NumberParameters也是2,但是系统分配了全部的空间(中间有大片的0),所以此时
EXCEPTION_RECORD结构 的大小是完整的大小0x50,而
0019fa48 + 0x50 = 0019fa98 ,所以实际上跟书上讲的是一致的,它们在内存中的布局仍然是紧挨着的。所以,我猜你的系统肯定不是Win7。 建议以后再提类似的问题,把自己的操作系统版本信息一并报上来,系统版本的差别确实会造成这样的现象,这样也方便别人进行分析。书上也很难把所有的情况都讲到,都是深入一两个现象讲原理,理解了原理,得出以上结论并上难。 |
|
[求助]关于kernel32符号文件加载的问题
书上是在调试应用程序,你这个是内核调试,默认只会从驱动列表里面查找模块,当然没有啦 |
|
[注意]《加密与解密(第4版)》勘误收集
EXCEPTION_POINTERS Structure typedef struct _EXCEPTION_POINTERS { PEXCEPTION_RECORD ExceptionRecord; PCONTEXT ContextRecord; } EXCEPTION_POINTERS, *PEXCEPTION_POINTERS; 注意看上面的定义, _EXCEPTION_POINTERS结构包含的是两个结构体指针,而不是两个结构体。 此时,从栈顶往下依次是 _EXCEPTION_POINTERS结构体、EXCEPTION_RECORD结构体、CONTEXT结构体 在本例中, esp = 12fcc8 , _EXCEPTION_POINTERS结构体的起始地址是esp, EXCEPTION_RECORD结构体的起始地址是esp+sizeof( _EXCEPTION_POINTERS ),也就是12fcc8 + 8 = 12fcd0,这与栈顶的 _EXCEPTION_POINTERS结构体的第一个成员是对应的,此时满足 esp +8 = [esp] ,所以原文没有写错。 我本来要表达的意思是这几个结构在内存布局位置上的相互关系,所以使用的是esp+8,而不是[esp],虽然它们确实是相等的。
最后于 2018-11-25 20:58
被achillis编辑
,原因:
|
|
[求助]当一个线程触发异常进入异常处理函数期间,其他线程会执行吗?
其它平台不清楚,Win平台上仍然会各跑各的 |
|
[注意]《加密与解密(第4版)》勘误收集
wx_clay P322 L-17 D1 原文:ExceptionRecord=esp+8 更正 ExceptionRecord=[esp]我是作者,这一处并没有错误,原文的意思说的很明确,_EXCEPTION_POINTERS后面跟EXCEPTION_RECORD结构,所以EXCEPTION_RECORD的位置是esp+sizeof(_EXCEPTION_POINTERS),也就是esp+8。你结合后面看一下就知道了
最后于 2018-11-23 19:51
被achillis编辑
,原因:
|
|
[注意]《加密与解密(第4版)》勘误收集
P345 图8.12和图8.13 D1 原文图片是彩色的,适合电子屏幕观看,但是印刷为黑白版面后显得颜色过深,不利于阅读
最后于 2018-11-5 13:36
被achillis编辑
,原因:
|
|
[注意]《加密与解密(第4版)》勘误收集
P222 小节5.9 常用断点设置技巧的表格 D1 这里有几个疑问: 1.字符串类里的函数GetWindowWord似乎与字符串并没有关系? 2.很多函数都有A/W两个版本,有的写出来了,有的没有写出来,比如GetDriveType、GetSystemDirectory,建议统一 3.很多函数还有带Ex的版本,比如SetFilePointerEx、RegCreateKeyEx、RegQueryValueEx,这里没有列出来
|
|
[注意]《加密与解密(第4版)》勘误收集
P221 L-4 D1 原文:if GetLastError<>ERROR_ALREADY_EXISTS 更正: if GetLastError() != ERROR_ALREADY_EXISTS C风格的伪代码突然出现一个VB的<>符号,感觉有点怪异。。。 |
|
[注意]《加密与解密(第4版)》勘误收集
P312 L8 D1 原文:因为System进程一般不会加载win32k.sys 更正: System进程和smss.exe进程不会加载win32k.sys,其它进程均可 |
|
[注意]《加密与解密(第4版)》勘误收集
P304 L-19 D1 指令中16进制表示问题 原文:mov eax, dword ptr fs:[30] ;fs:[30]里存放的即为PEB地址 更正:mov eax, dword ptr fs:[30h] ;fs:[30h]里存放的即为PEB地址 |
|
|
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值