|
[分享][分享]重定向API总结
《windows编程循序渐进》这本书我没有看过, 但是书上的东西不一定是对的。 代码我再看了一遍, //pThunk指向原始的IAT表,说实话我真不清楚什么叫原始IAT表 if ( pIID->OriginalFirstThunk ) pThunk = (PIMAGE_THUNK_DATA)( dwBaseImage + pIID->OriginalFirstThunk ) ; else pThunk = pIAT ; // 遍历IAT DWORD dwThunkValue = 0 ; //dwThunkValue存放原始的IAT表中函数的虚拟地址 while ( ( dwThunkValue = *((DWORD*)pThunk) ) != 0 ) { if ( ( dwThunkValue & IMAGE_ORDINAL_FLAG32 ) == 0 ) { 这几句代码可能很多人不太明白,我讲解一下吧。 PE导入表中OriginalFirstThunk和FirstThunk都是指向PIMAGE_THUNK_DATA一个结构数组。 FirstThunk的PIMAGE_THUNK_DATA是iat,位于 _IMAGE_IMPORT_DESCRIPTOR结构前面, OriginalFirstThunk的PIMAGE_THUNK_DATA是int,位于 _IMAGE_IMPORT_DESCRIPTOR结构后面面, 一开始iat和int数据内容是相同的, PE加载到内存后系统会根据int和dll名找到相应dll模块加载的基址计算出int里的实际虚拟地址并 填写到iat结构。如果int为空系统没有找到要导入的名称表,不会填充iat地址表, 这样地址表iat就保存了初始状态的int内容。 也就是这里为什么有: if ( pIID->OriginalFirstThunk ) pThunk = (PIMAGE_THUNK_DATA)( dwBaseImage + pIID->OriginalFirstThunk ) ; else pThunk = pIAT ; 这几句代码。 if ( ( dwThunkValue & IMAGE_ORDINAL_FLAG32 ) == 0 ) 这句条件判断也就是判断每个 _IMAGE_THUNK_DATA 结构最高二进制位和1进行与运算, 如果结果等于0,那最高位是0,说明导入表是以函数名称方式导入的, 如果结果等于1则表示以序号的方式导入,这里是iat hook, 故判断等于0, 如果 if ( ( dwThunkValue & IMAGE_ORDINAL_FLAG32 ) == 0 ) 这句不太理解, 可以这么写或许更容易懂: if( IMAGE_SNAP_BY_ORDINAL32( pThunk->u1.Ordinal ) ) 希望对大家有帮助! |
|
[求助]ring3下怎样将NT路径转成DOS路径?
不明白你说的DOS路径指什么? 你是说dos模式下短路径吗?? 下面的api不知道对你有没有帮助.......... GetShortPathName The GetShortPathName function retrieves the short path form of a specified input path. DWORD GetShortPathName( LPCTSTR lpszLongPath, // null-terminated path string LPTSTR lpszShortPath, // short form buffer DWORD cchBuffer // size of short form buffer ); |
|
[求助]现在大家用什么查壳工具啊?OD用什么版本的啊?
用peid0.96都好几年了, 你还在用0.95? |
|
[原创]放个能用的 OD2.01_PLUG_SDK
等官方的消息吧,官方说了现在的2.0是过度版本很多问题暂时官方暂时不支持插件功能~ |
|
DLL加载到进程中,如何计算函数地址
在你的程序用GetModuleHandle获取被装入到内存的相应dll句柄,返回的句柄就是dll模块的基址, 再根据add()方法的rav或文件偏移计算实际虚拟地址 |
|
|
|
|
|
[分享][分享]重定向API总结
看了一下代码,写的还不错, 但是有一个地方写错了, // 修改IAT项 DWORD dwOldProtect = 0 ; VirtualProtect ( pIAT, 4, PAGE_READWRITE, &dwOldProtect ) ; *((DWORD*)pIAT) = dwNewProc ; VirtualProtect ( pIAT, 4, PAGE_READWRITE, &dwOldProtect ) ; 应改为: // 修改IAT项 DWORD dwOldProtect = 0 ; VirtualProtect ( pIAT, 4, PAGE_READWRITE, &dwOldProtect ) ; *((DWORD*)pIAT) = dwNewProc ; VirtualProtect ( pIAT, 4, dwOldProtect, &dwOldProtect ) ; 其它没发现什么问题 。 |
|
[原创]大牛的小bug,对某Windows x64 shellcode的一点改进
厉害啊,收藏了~~ |
|
[原创]一次艰难的渗透纪实
楼主说了已经拿下ftp了! 引用文章内容 “就这样我得到了a.111.com的ftp账户和密码,并成功把其拿下。 由于主目标www.aaa.com只开80,也无法用这个ftp密码去尝试它,并且再用这个密码尝试其论坛管理员的密码又无结果,只能继续嗅探了。 0×0b php嗅探目标管理员密码 拿下a.111.com后,还是有一些惊喜的。我看到了www.111.com的早期的论坛数据库存在于a.111.com的库中,” 引用: “我找到a.111.com的前台和后台登陆口添加了下面的代码。 $username1 = $this->Username; $password1 = $this->Password; ” 也拥有写脚本权限了吧? |
|
[转帖]olly plugins
几十年前的东西? |
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值