Skip to main content

Unity reflection framework

Project description

uniref

中文 | English

uniref 是一个辅助分析 Unity 应用的框架。它可以帮助您获取 Unity 应用中的类、方法、成员变量等的反射信息,让您实时地查看和操作它们。

您可以将您的一些分析结果借助本框架转化为少量的 Python 代码,在一定程度上方便您进行 Unity 应用的插件开发。

特性

  • 支持通过符号获取反射信息
  • 支持实时获取与修改类属性值
  • 支持实时获取与修改类方法实现、调用类方法
  • 在内存中完成修改,无需修改源文件
  • 可以绕过某些代码保护机制(压缩、加密壳等),减少繁琐的逆向分析过程
  • 支持分析 MonoIL2CPP 两种脚本后端(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

开源协议

GNU Affero General Public License v3.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uniref-0.5.2.tar.gz (89.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uniref-0.5.2-py3-none-any.whl (85.9 kB view details)

Uploaded Python 3

File details

Details for the file uniref-0.5.2.tar.gz.

File metadata

  • Download URL: uniref-0.5.2.tar.gz
  • Upload date:
  • Size: 89.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.9

File hashes

Hashes for uniref-0.5.2.tar.gz
Algorithm Hash digest
SHA256 4b70ef31a777ca32366fd24da2e6d43feab0e2ffc0ab0f84a3e4c2c7b6270deb
MD5 3d70053bb5846aa22c1a4b64c7e523f0
BLAKE2b-256 c1fe8bc97f32de1ced1609ea44d74decf3b72ab41d737ab22b34b59c2079c9ad

See more details on using hashes here.

File details

Details for the file uniref-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: uniref-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 85.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.9

File hashes

Hashes for uniref-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 285ac684cd269456663c269bfb350139e274c0cfe4b7d5b35532e4111de44532
MD5 f1a30fa81cb4295212dd304d19f496e8
BLAKE2b-256 f8eb006d722fb73a7b2a3ed520f852333e994e03e16d631dc2a1dfed645f3c76

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page