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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

Supported by

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