|
[求助]hook 主线程调用A.dll 32位正常64位崩溃
谢谢 找到一个参照例子 能正常使用 https://www.dllhook.com/post/13.html HOOK原理如下: // HOOK指令长度 #define HOOK_LEN 0xC // 保存原始指令 BYTE Ori_Code[HOOK_LEN] = {0x00}; // Hook代码 /* 方式一 MOV RAX, 0x9090909090909090 PUSH RAX RET */ BYTE HookCode[HOOK_LEN] = { 0x48, 0xB8, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x50, 0xC3 }; /* 方式二 MOV RAX, 0x9090909090909090 JMP RAX */ /* BYTE HookCode[HOOK_LEN] = { 0x48, 0xB8, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0xFF, 0xE0 }; */ VOID HookAPI(); VOID UnHookAPI(); static int (WINAPI *kernel_MessageBoxW)( HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType ) = MessageBoxW; int WINAPI MyMessageBoxW( HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType ) { UnHookAPI(); int ret = kernel_MessageBoxW(hWnd, TEXT("Hooked!!"), TEXT("hi"), MB_OK); HookAPI(); return ret; } VOID HookAPI() { DWORD OldProtect; ::VirtualProtect(kernel_MessageBoxW, HOOK_LEN, PAGE_EXECUTE_READWRITE, &OldProtect); // 得到原始指令 memcpy(Ori_Code, kernel_MessageBoxW, HOOK_LEN); // 填充跳转地址 *(PINT64)(HookCode+2) = (INT64)&MyMessageBoxW; memcpy(kernel_MessageBoxW, &HookCode, sizeof(HookCode)); } VOID UnHookAPI() { memcpy(kernel_MessageBoxW, &Ori_Code, sizeof(HookCode)); } VOID main() { MessageBoxW(NULL, TEXT("hello"), TEXT("P.Y.G"), MB_OK); HookAPI(); MessageBoxW(NULL, TEXT("hello"), TEXT("P.Y.G"), MB_OK); system("pause"); } |
|
[挑战] 连续打卡30天,有好礼相送!
#打卡#[挑战] 高通芯片关键漏洞暴露三星、LG手机上的机密数据,你的密码可被轻松窃取! https://zhuanlan.kanxue.com/article-9773.htm 2019年11月16日 |
|
[挑战] 连续打卡30天,有好礼相送!
#打卡# 黑客通过VPN攻击知名杀毒工具,破坏内部网络 https://zhuanlan.kanxue.com/article-9620.htm |
|
[挑战] 连续打卡30天,有好礼相送!
#打卡# [原创]ollvm源码分析 - Pass之Flattening https://bbs.pediy.com/thread-255130.htm |
|
[挑战] 连续打卡30天,有好礼相送!
#打卡# [原创]动态过DSE代码以及原理 https://bbs.pediy.com/thread-255098.htm |
|
[挑战] 连续打卡30天,有好礼相送!
#打卡# [原创]从shellcode学习到缓冲区溢出实战 https://bbs.pediy.com/thread-255058.htm
最后于 2019-10-21 08:01
被乄羽落编辑
,原因:
|
|
[挑战] 连续打卡30天,有好礼相送!
#打卡# [分享]关于CVE-2019-0708 bluekeep的一些研究和分享 https://bbs.pediy.com/thread-255029.htm |
|
[挑战] 连续打卡30天,有好礼相送!
#打卡# WAV音频文件中隐藏恶意软件 https://zhuanlan.kanxue.com/article-9580.htm 第30天 |
|
[挑战] 连续打卡30天,有好礼相送!
#打卡# [调试逆向] [原创]某P保护的一款音乐类PC游戏的分析之----dump协议号 https://bbs.pediy.com/thread-255051.htm 第29天 |
|
[挑战] 连续打卡30天,有好礼相送!
#打卡# [原创]青藤云安全细述MITRE ATT&CK框架的实施和使用方式 https://bbs.pediy.com 第28天 |
|
[挑战] 连续打卡30天,有好礼相送!
#打卡# XCTF攻防世界int_overflow https://bbs.pediy.com/thread-254851.htm 第28天
最后于 2019-10-16 08:06
被乄羽落编辑
,原因:
|
|
[挑战] 连续打卡30天,有好礼相送!
#打卡# [分享]卸载注入进程的dll https://bbs.pediy.com/thread-217270.htm 第27天 |
|
[挑战] 连续打卡30天,有好礼相送!
#打卡# [调试逆向] [病毒木马] [分享]简单后门分析 https://bbs.pediy.com/thread-227204.htm 第27天 |
|
[挑战] 连续打卡30天,有好礼相送!
#打卡# [分享]cve-2012-0158两种poc分析 https://bbs.pediy.com/thread-217890.htm 第26天 |
|
[挑战] 连续打卡30天,有好礼相送!
#打卡# [分享]堆溢出研究三 https://bbs.pediy.com/thread-217632.htm 第25天 |
|
[挑战] 连续打卡30天,有好礼相送!
#打卡# [分享]堆溢出研究一 https://bbs.pediy.com/thread-217594.htm 第24天 |
|
[挑战] 连续打卡30天,有好礼相送!
#打卡# [分享]堆溢出研究二 https://bbs.pediy.com/thread-217613.htm 第23天 |
|
[挑战] 连续打卡30天,有好礼相送!
#打卡# [分享]pwn姿势三 && 四 https://bbs.pediy.com/thread-217569.htm 第22天 |
|
[挑战] 连续打卡30天,有好礼相送!
#打卡# [分享]pwn小姿势二 https://bbs.pediy.com/thread-217498.htm 第21天 |
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值