Skip to content

ngentood/unity_modding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unity Modding Workspace (BNM Based)

This project is a workspace for modding Il2Cpp-based Unity Android games using the ByNameModding (BNM) library. It features modern dump analysis tools to streamline the mod development process.


🚀 Key Features

1. interactive_search.py (New! Interactive Explorer)

The ultimate interactive tool for navigating your game dump with a pro terminal experience:

  • 󰚌 Smart Class Search: Fast search with Auto-complete suggestions (Press Tab).
  • 󰻶 Reverse Lookup: Search by method or field name to find the owning class.
  • 󰉋 Namespace Browser: Explore the game's architecture by namespace.
  • 󰙰 Multi-Selection: Select multiple methods/fields at once to generate a combined snippet.
  • 󰙨 BNM Utility Cheat Sheet: Quick access to boilerplate code for MonoStrings, Coroutines, Lists, etc.
  • 󰄬 Save to File: Directly append generated snippets to bnm_snippets.cpp.
  • 󰠱 Nerd Font Support: Optimized for terminal users using Nerd Fonts.

2. search_dump.py (Standard Search)

A fast, direct search utility for quick queries:

  • Modern UI (Rich): Clean, colorful table and panel displays.
  • Smart Signature Generator: Generates accurate C++ function pointers for hooks.
  • Type Translation: Maps C# types directly to BNM C++ types.
  • Unity Lifecycle Detector: Automatically identifies methods like Update, FixedUpdate, etc.

🛠 How to Use the Tools

0. How to Get Metadata

To obtain the required dump.json file for this project, you must use the following tool:

After running the tool, place the resulting .json files into the source_dump_json/ directory.

1. Prerequisites

Ensure you have the required libraries installed:

pip install rich questionary

Note: For the best experience with icons, use a terminal font from Nerd Fonts.

2. Running the Tools

Interactive Explorer (Recommended):

python interactive_search.py

Direct Search:

python search_dump.py <keyword>

📖 Directory Structure

  • source_dump_json/: Directory containing .json and .cs dump results.
  • interactive_search.py: Interactive menu-based explorer and snippet generator.
  • search_dump.py: Direct command-line search utility.
  • bnm_snippets.cpp: (Auto-generated) File where saved snippets are stored.
  • TUTORIAL_BNM.md: A comprehensive guide on writing C++ mod code using BNM.
  • GEMINI.md: Contextual instructions for AI development.

💡 Modding Workflow Example

  1. Explore: Run python interactive_search.py.
  2. Find & Pick: Use "Smart Search" to find your class, then "Pick Specific Methods".
  3. Generate: Review the C++ code in the "PRO BNM Snippets" panel.
  4. Save: Choose 'Yes' to save the snippet to bnm_snippets.cpp.
  5. Apply: Copy the code from your file to your main C++ project and implement your logic.

⚠️ Important: Snippet Manual Adjustment

While the snippet generators are highly accurate, the code serves as a template. You MUST:

  • Rename Parameters: Change generic names like arg0 to meaningful ones.
  • Check Instances: Always verify instance != nullptr before use.
  • Hook Method: The script recommends InvokeHook for Unity methods and BasicHook for others.

⚠️ Critical Tips

  • Use Namespaces: Always include the namespace in your BNM code to prevent collisions.
  • C++20 Requirement: BNM (especially Coroutines) requires your project to be compiled with -std=c++20.

About

android

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages