病毒分析
点击放大

A simple and easy to use header only library to make the life of a reverse engineer much harder.
IDA output when compiling first line
LI_FN(function_pointer) -> lazy_functionLI_FN_DEF(function_type) -> lazy_functionLI_MODULE(module_name) -> lazy_module---
safe indicates that when function cannot complete its task successfully 0 is returned instead of undefined behaviour manifesting.cached indicates that the result is only computed during the first call and later reused.forwarded indicates that export forwarding will be correctly resolved.#### lazy_module
<table>
<tr>
<th>function</th>
<th>safe</th>
<th>cached</th>
</tr>
<tr>
<td colspan="4">Attempts to find the gi and returns its address</td>
</tr>
<tr>
<td><code>get<T = void*>() -> T</code></td>
<td align="center">:x:</td>
<td align="center">:x:</td>
</tr>
<tr>
<td><code>safe<T = void*>() -> T</code></td>
<td align="center">:white_check_mark:</td>
<td align="center">:x:</td>
</tr>
<tr>
<td><code>cached<T = void*>() -> T</code></td>
<td align="center">:x:</td>
<td align="center">:white_check_mark:</td>
</tr>
<tr>
<td><code>safe_cached<T = void*>() -> T</code></td>
<td align="center">:white_check_mark:</td>
<td align="center">:white_check_mark:</td>
</tr>
<tr>
<td colspan="4">Attemps to find the gi using the gi pointer</td>
</tr>
<tr>
<td><code>in<T = void*, Ldr>(Ldr ldr_entry) -> T</code></td>
<td align="center">:white_check_mark:</td>
<td align="center">:x:</td>
</tr>
<tr>
<td><code>in_cached<T = void*, Ldr>(Ldr ldr_entry) -> T</code></td>
<td align="center">:white_check_mark:</td>
<td align="center">:white_check_mark:</td>
</tr>
</table>
#### lazy_function<F>
<table>
<tr>
<th>function</th>
<th>safe</th>
<th>cached</th>
<th>forwarded</th>
</tr>
<tr>
<td colspan="4">calls resol using gi</td>
</tr>
<tr>
<td><code>operator()(...) -> result_of<F, ...></code></td>
<td align="center">:x:</td>
<td align="center">:x:</td>
<td align="center">:x:</td>
</tr>
<tr>
<td colspan="4">attempts to resolve an export in all loaded modules and returns the function address</td>
</tr>
<tr>
<td><code>get<T = F>() -> T</code></td>
<td align="center">:x:</td>
<td align="center">:x:</td>
<td align="center">:x:</td>
</tr>
<tr>
<td><code>safe<T = F>() -> T</code></td>
<td align="center">:white_check_mark:</td>
<td align="center">:x:</td>
<td align="center">:x:</td>
</tr>
<tr>
<td><code>cached<T = F>() -> T</code></td>
<td align="center">:x:</td>
<td align="center">:white_check_mark:</td>
<td align="center">:x:</td>
</tr>
<tr>
<td><code>safe_cached<T = F>() -> T</code></td>
<td align="center">:white_check_mark:</td>
<td align="center">:white_check_mark:</td>
<td align="center">:x:</td>
</tr>
<tr>
<td><code>forwarded<T = F>() -> T</code></td>
<td align="center">:x:</td>
<td align="center">:x:</td>
<td align="center">:white_check_mark:</td>
</tr>
<tr>
<td><code>forwarded_safe<T = F>() -> T</code></td>
<td align="center">:white_check_mark:</td>
<td align="center">:x:</td>
<td align="center">:white_check_mark:</td>
</tr>
<tr>
<td><code>forwarded_cached<T = F>() -> T</code></td>
<td align="center">:x:</td>
<td align="center">:white_check_mark:</td>
<td align="center">:white_check_mark:</td>
</tr>
<tr>
<td><code>forwarded_safe_cached<T = F>() -> T</code></td>
<td align="center">:white_check_mark:</td>
<td align="center">:white_check_mark:</td>
<td align="center">:white_check_mark:</td>
</tr>
<tr>
<td colspan="4">attempts to resolve an export in the gi and returns the function address</td>
</tr>
<tr>
<td><code>in<T = F, A>(A module_address) -> T</code></td>
<td align="center">:x:</td>
<td align="center">:x:</td>
<td align="center">:x:</td>
</tr>
<tr>
<td><code>in_safe<T = F, A>(A module_address) -> T</code></td>
<td align="center">:white_check_mark:</td>
<td align="center">:x:</td>
<td align="center">:x:</td>
</tr>
<tr>
<td><code>in_cached<T = F, A>(A module_address) -> T</code></td>
<td align="center">:x:</td>
<td align="center">:white_check_mark:</td>
<td align="center">:x:</td>
</tr>
<tr>
<td><code>in_safe_cached<T = F, A>(A module_address) -> T</code></td>
<td align="center">:white_check_mark:</td>
<td align="center">:white_check_mark:</td>
<td align="center">:x:</td>
</tr>
<tr>
<td colspan="4">attempts to resolve an export in <code>ntdll</code> and returns the function address</td>
</tr>
<tr>
<td><code>nt<T = F>() -> T</code></td>
<td align="center">:x:</td>
<td align="center">:x:</td>
<td align="center">:x:</td>
</tr>
<tr>
<td><code>nt_safe<T = F>() -> T</code></td>
<td align="center">:white_check_mark:</td>
<td align="center">:x:</td>
<td align="center">:x:</td>
</tr>
<tr>
<td><code>nt_cached<T = F>() -> T</code></td>
<td align="center">:x:</td>
<td align="center">:white_check_mark:</td>
<td align="center">:x:</td>
</tr>
<tr>
<td><code>nt_safe_cached<T = F>() -> T</code></td>
<td align="center">:white_check_mark:</td>
<td align="center">:white_check_mark:</td>
<td align="center">:x:</td>
</tr>
</table>
#### extra configuration
| #define | effects |
| ----------------------------------------- | --------------------------------------------------------------------------------------- |
| LAZY_IMPORTER_NO_FORCEINLINE | disables force inlining |
| LAZY_IMPORTER_CASE_INSENSITIVE | enables case insensiti. Might be required for forwarded export resolution. |
| LAZY_IMPORTER_CACHE_OPERATOR_PARENS | uses cached() instead of get() in operator() of lazy_function |
| LAZY_IMPORTER_RESOL | uses forwarded() in get(). WARNING does not apply to nt() and in(). |
| LAZY_IMPORTER_HARDENED_MODULE_CHECKS | adds extra sanity checks to module enumeration. |
| LAZY_IMPORTER_NO_CPP_FORWARD | Remo on <utility> c++ header. |
*
*
开发语言:C++
Star 数:1929
该项目属于病毒分析方向的开源资源,代码结构清晰,适合安全研究人员学习参考。项目围绕library for importing functions from dlls in a hidden, reverse engineer unfriendly way展开,提供了可运行的实现,对理解相关安全机制、工具原理与攻防技术具有较高的研究价值。
从技术实现角度看,此类项目的核心在于对底层原理的深入理解与工程化落地。开发者在研究过程中可以结合官方文档与社区讨论,梳理项目的初始化流程、核心模块职责与数据流转,逐步掌握其中的技术细节与设计思路。
1. 下载源码压缩包,解压到本地环境。
2. 根据项目类型准备对应的运行环境与依赖。
3. 按照 README 中的步骤完成配置与部署。
4. 在隔离的测试环境中运行验证,避免影响生产系统。
本资源来源于开源社区,仅供安全研究、技术学习与合法授权范围内的攻防演练使用,请勿用于任何非法或侵害他人权益的用途。使用本项目产生的一切后果由使用者自行承担。
| 资源标题 | lazy_importer - library for importing functions from dlls in a hid |
| 所属分类 | 病毒分析 |
| 发布作者 | admin |
| 发布时间 | 2026-10-05 23:12:11 |
| 下载权限 | 免费下载 |
| 附件数量 | 2 个下载链接 |
| 浏览次数 | 406 |
| 讨论数量 | 0 |
| 主题状态 | 正常讨论中 |