从 UEFI 劫持启动链实现 Hyper-V 内核读写无需加载驱动
- 未分类
- 2025-12-11
- 6热度
- 0评论
本文档介绍基于 noahware/hyper-reV 的虚拟内存访问类 GuestMemory,以及用于定位目标进程 CR3、EPROCESS、PEB、模块基址的四个内核工具函数。
此项目依赖特定的Windows版本(Windows11 25H2,如果版本不匹配会造成此项目无法运行,请修改GetM中的Offsets &PsActiveProcessHead offset:0xF05790 in Hyper_rw.cpp ) 。
这些函数依赖 PsActiveProcessHead,用于从内核侧定位进程的关键结构。
参数:target_pid, ps_active_process_head
返回:CR3(DirectoryTableBase)
遍历 ActiveProcessLinks,根据 PID 返回该进程的页表基址。
参数:同上
返回:EPROCESS 内核虚址
适合需要访问 Token、HandleTable 等字段时使用。
参数:target_cr3, ps_active_process_head
返回:PEB 用户层虚址
通过 CR3 反查 EPROCESS,再读取 Peb 字段;不依赖 PID。
参数:target_cr3, peb_address, module_name
返回:DllBase
遍历 PEB 的 Ldr 模块链表,查目标 DLL。
GuestMemory 封装 VA→PA 转换、跨页处理,是用户态访问目标进程虚拟内存的主要接口。
GuestMemory mem( target_cr3); // 绑定页表
int hp = 0;
mem.ReadValue<int>(0x7FF70010, hp);
-
获取 PsActiveProcessHead
-
获取目标 CR3
-
初始化 GuestMemory
-
查找 PEB
-
查找目标 DLL
-
使用 GuestMemory 读写目标地址
Copyright (c) [2025], [wz5200]
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
- Source code redistributions must retain the above copyright notice, this list of conditions, and the following disclaimer.
- Binary redistributions must reproduce the above copyright notice, this list of conditions, and the following disclaimer in the documentation and/or other materials provided with the distribution.
- All redistributions must clearly attribute the original author ([wz5200]) in any public or private use of this software.
