uniref
中文 | English
uniref 是一个辅助分析 Unity 应用的框架。它可以帮助您获取 Unity 应用中的类、方法、成员变量等的反射信息,让您实时地查看和操作它们。
您可以将您的一些分析结果借助本框架转化为少量的 Python 代码,在一定程度上方便您进行 Unity 应用的插件开发。
特性
- 支持通过符号获取反射信息
- 支持实时获取与修改类属性值
- 支持实时获取与修改类方法实现、调用类方法
- 在内存中完成修改,无需修改源文件
- 可以绕过某些代码保护机制(压缩、加密壳等),减少繁琐的逆向分析过程
- 支持分析
Mono和IL2CPP两种脚本后端(Unity scripting backend) - 支持分析 Windows x86 64 位与Android ARM架构上运行的 32 / 64 位 Unity 应用
安装
uniref 需要 Windows Python 3.7+(64 位)的运行环境,您可以通过 pip 完成安装:
pip install -U uniref
示例
下方给出了一段使用 uniref 框架完成的代码,其解决了 MRCTF2021 的一道逆向赛题。
from uniref import WinUniRef
ref = WinUniRef("GameHack.exe")
class_GetFlag = ref.find_class_in_image("Assembly-CSharp.dll", "Platformer.Flag.GetFlag")
class_GetFlag.find_field("goHome").value = True
class_GetFlag.find_field("findAlien").value = True
class_GetFlag.find_field("eatCookie").value = True
method_EatTokenUpdateKey = class_GetFlag.find_method("EatTokenUpdateKey")
for i in range(105):
method_EatTokenUpdateKey()
文档 中还给出了分析 森林之子、鹅鸭杀、Dream Blast、神庙逃亡等应用的示例代码。
参与进来
如果您有什么建议或需求,欢迎提 issue 。
当然,如果您有兴趣一起完善这个框架,欢迎提交 Pull requests 。
开源协议
Metadata
Release files for uniref 0.5.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| uniref-0.5.2.tar.gz | 89.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| uniref-0.5.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 175.6 kB
Release files / uniref-0.5.2.tar.gz
| Download URL | uniref-0.5.2.tar.gz |
|---|---|
| Size | 89.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4b70ef31a777ca32366fd24da2e6d43feab0e2ffc0ab0f84a3e4c2c7b6270deb
|
|
BLAKE2b-256 checksum How to use checksums |
c1fe8bc97f32de1ced1609ea44d74decf3b72ab41d737ab22b34b59c2079c9ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.9
|
Release files / uniref-0.5.2-py3-none-any.whl
| Download URL | uniref-0.5.2-py3-none-any.whl |
|---|---|
| Size | 85.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
285ac684cd269456663c269bfb350139e274c0cfe4b7d5b35532e4111de44532
|
|
BLAKE2b-256 checksum How to use checksums |
f8eb006d722fb73a7b2a3ed520f852333e994e03e16d631dc2a1dfed645f3c76
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.9
|