• Hello
Search Results for

    Show / Hide Table of Contents

    Error Stack Window

    This window is used to deobfuscate stack traces when you have a StackTrace and want to know the original class and method names. This file explains the usage and provides step-by-step instructions for converting obfuscated error messages back to their readable form.

    Understanding the Problem

    One side effect of obfuscation is the difficulty in debugging obfuscated code. User-generated and reported exceptions usually contain obfuscated method and class names, making it difficult to trace the stack trace back to the source code.

    GuardingPearSoftware's Obfuscator addresses this issue by generating a detailed mapping of obfuscated entities and their original names.

    Step 1: Enable Mapping Generation

    Before you can deobfuscate stack traces, you need to enable mapping generation in the obfuscator settings:

    1. Open Project Settings in Unity
    2. Navigate to GuardingPearSoftware → Obfuscator
    3. Go to the Optional-Tab in the Renaming Component
    4. Enable the mapping generation option
    5. Set the output path where the mapping file will be saved

    Figure 1 - Activate the saving of the renaming mapping.

    Step 2: Build with Mapping Enabled

    When you build your game with the obfuscator activated and renaming mapping enabled, a JSON-based mapping file will be created at the location you have selected. This file contains the relationships between original and obfuscated names.

    Step 3: Access the Deobfuscation Tool

    To load the mapping and use it for deobfuscation:

    1. Open Unity Editor
    2. Navigate to Window → GuardingPearSoftware → Obfuscator → ErrorStack
    3. The "Error Stack - Obfuscator" window will open

    Figure 2 - The stack trace deobfuscation tool.

    Step 4: Using the Deobfuscation Interface

    Loading the Mapping File

    1. Mapping File Path: Enter the full path to your mapping JSON file, or click "Browse" to select it
    2. The mapping file is typically named something like obfuscation_mapping.json

    Entering the Stack Trace

    1. StackTrace: Paste your obfuscated stack trace into the large text area
    2. The tool expects stack traces in the standard format: at ObjectModel.Character.bju()[0x00003] in D:\...\bju.cs:55 at GameItems.bsr(Game.ObjectModel.g a, ObjectModel.ud b, cy c)[0x000e6] in D:\...\bsr.cs:523 at ho`2[a, b].bwx(System.Int32 a, System.Int32 b, System.Int32 c, System.Boolean d)[0x00075] in D:\...\bwx.cs:209

    Processing the Stack Trace

    1. Click the "Deobfuscate" button
    2. The deobfuscated result will appear in the "Deobfuscated StackTrace" section below

    Figure 3 - Deobfuscated stack trace.

    Example Workflow

    1. Enable mapping in Project Settings → GuardingPearSoftware → Obfuscator → Optional-Tab
    2. Build your project with obfuscation enabled
    3. Collect the mapping file from your specified output location
    4. When you receive an obfuscated error report from users:
      • Open the ErrorStack window
      • Load your mapping file
      • Paste the obfuscated stack trace
      • Click "Deobfuscate"
      • Get readable class and method names for debugging

    Supported Stack Trace Formats

    The tool supports standard Unity stack trace formats including:

    • Method calls with parameters
    • Generic types and methods
    • Nested classes
    • File paths and line numbers (preserved in output)

    Important Notes

    • Keep your mapping files: Store mapping files alongside your builds for future debugging
    • Version matching: Use the correct mapping file that corresponds to the specific build version
    • File security: Mapping files contain your original code structure - store them securely
    • Multiple mappings: Different builds require different mapping files

    Troubleshooting

    • "No valid mapping" error: Verify the mapping file path and ensure it's a valid JSON file
    • Incomplete deobfuscation: Some names may not be obfuscated and will remain unchanged
    • File not found: Check that the mapping file exists at the specified path
    • Parsing errors: Ensure the stack trace format matches the expected Unity format
    In This Article
    Back to top GuardingPearSoftware documentation