# focus-creative-games/hybridclr

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/focus-creative-games-hybridclr).**

7,863 stars · 741 forks · C++ · MIT

## Links

- GitHub: https://github.com/focus-creative-games/hybridclr
- Homepage: https://code-philosophy.com/
- awesome-repositories: https://awesome-repositories.com/repository/focus-creative-games-hybridclr.md

## Topics

`csharp` `framework` `hot` `hot-update` `hotfix` `hotupdate` `huatuo` `il2cpp` `ios` `unity` `update`

## Description

HybridCLR is a hybrid C# execution engine and assembly loader designed for Unity. It provides a system for hot-updating C# logic across all platforms at runtime without requiring the application to be rebuilt or reinstalled.

The project is distinguished by its mixed-mode execution, which runs unmodified code at native speed while using a high-performance interpreter for updated functions. It includes a generic type resolver that allows hot-updated code to use generic classes and functions regardless of whether they were pre-instantiated in the main binary. To protect proprietary source code, it features a security suite for assembly obfuscation and metadata encryption.

The runtime supports dynamic assembly loading and unloading using byte arrays and integrates with data-oriented frameworks for runtime component updates. It includes capabilities for multithreaded execution, memory optimization for mobile devices, and diagnostic tools for analyzing interpreter stack traces in crash logs.

The project is implemented primarily in C++.

## Tags

### Development Tools & Productivity

- [Runtime Logic Hot-Updates](https://awesome-repositories.com/f/development-tools-productivity/client-update-utilities/runtime-logic-hot-updates.md) — Updates game logic and scripts across all platforms at runtime without requiring users to reinstall the application.
- [Hot-Patching Tools](https://awesome-repositories.com/f/development-tools-productivity/hot-patching-tools.md) — Loads assemblies dynamically into a hybrid runtime to update logic across all platforms without rebuilding the binary. ([source](https://www.hybridclr.cn/docs/intro))
- [Game Component Patching](https://awesome-repositories.com/f/development-tools-productivity/hot-patching-tools/game-component-patching.md) — Enables attaching scripts to game objects via code or asset loading to update behavior without rebuilding. ([source](https://www.hybridclr.cn/docs/beginner))

### Programming Languages & Runtimes

- [Mixed-Mode Execution](https://awesome-repositories.com/f/programming-languages-runtimes/mixed-mode-execution.md) — Runs unmodified functions via native compilation and updated functions via an interpreter for high performance. ([source](https://www.hybridclr.cn/docs/7.10.0/intro))
- [Generic Types](https://awesome-repositories.com/f/programming-languages-runtimes/generic-types.md) — Supports the execution of C# generics in dynamically loaded code without restrictions on implementation. ([source](https://www.hybridclr.cn/docs/beginner))
- [Compiled Generic Preservation](https://awesome-repositories.com/f/programming-languages-runtimes/generic-types/compiled-generic-preservation.md) — Maintains the availability of compiled generic types and functions for use within interpreted code segments. ([source](https://www.hybridclr.cn/docs/basic))
- [Hybrid C# Execution Engines](https://awesome-repositories.com/f/programming-languages-runtimes/hybrid-c-execution-engines.md) — Combines native execution for unmodified code with a high-performance interpreter for updated functions.
- [Interpreter Performance Optimizations](https://awesome-repositories.com/f/programming-languages-runtimes/interpreter-performance-optimizations.md) — Uses specialized execution engines to reduce interpreted code overhead and approach native speeds. ([source](https://www.hybridclr.cn/docs/business/intro))
- [Metadata Memory Optimizations](https://awesome-repositories.com/f/programming-languages-runtimes/metadata-memory-optimizations.md) — Reduces the memory footprint required to load assembly metadata for memory-constrained environments. ([source](https://www.hybridclr.cn/docs/business))
- [Mixed-Mode Execution Engines](https://awesome-repositories.com/f/programming-languages-runtimes/mixed-mode-execution-engines.md) — Runs unmodified functions at native speed while using a high-performance interpreter for updated logic.
- [Dynamic Method Invocation](https://awesome-repositories.com/f/programming-languages-runtimes/dynamic-method-invocation.md) — Invokes methods and logic from hot-patched assemblies via reflection from the static main binary. ([source](https://www.hybridclr.cn/docs/beginner/quickstart))
- [Native Function Bridge Definitions](https://awesome-repositories.com/f/programming-languages-runtimes/function-definitions/native-function-bridge-definitions.md) — Provides a mechanism for defining native functions that can be called from hot-updated scripts. ([source](https://www.hybridclr.cn/docs/basic/notsupportedfeatures))
- [Managed-to-Native Callbacks](https://awesome-repositories.com/f/programming-languages-runtimes/function-pointer-callbacks/managed-to-native-callbacks.md) — Facilitates high-speed data exchange between the managed runtime and native languages via a specialized bridge.
- [Native Callbacks](https://awesome-repositories.com/f/programming-languages-runtimes/language-interoperability/foreign-function-interfaces/native-library-integrations/native-callbacks.md) — Implements high-performance callbacks to allow native libraries to trigger logic within the managed runtime. ([source](https://www.hybridclr.cn/docs/7.10.0/intro))
- [Multithreaded Runtime Support](https://awesome-repositories.com/f/programming-languages-runtimes/multithreaded-runtime-support.md) — Executes hot-updated code across multiple threads using volatile, ThreadStatic, and async Task patterns. ([source](https://www.hybridclr.cn/docs/7.6.0/intro))
- [Native-Managed Interop Callbacks](https://awesome-repositories.com/f/programming-languages-runtimes/native-managed-interop-callbacks.md) — Deno X enables bidirectional data exchange between managed code and native languages using a dedicated callback system. ([source](https://cdn.jsdelivr.net/gh/focus-creative-games/hybridclr@main/README.md))
- [Runtime Assembly Unloading](https://awesome-repositories.com/f/programming-languages-runtimes/runtime-assembly-unloading.md) — Completely removes assemblies from memory to allow for a clean replacement and refreshing of logic during execution.

### Part of an Awesome List

- [Assembly Encryption](https://awesome-repositories.com/f/awesome-lists/security/reverse-engineering-and-decompilation/assembly-obfuscators/mobile-assembly-protection/assembly-encryption.md) — Secures binaries and library files used during loading to protect proprietary source code from decompilation. ([source](https://cdn.jsdelivr.net/gh/focus-creative-games/hybridclr@main/README.md))

### DevOps & Infrastructure

- [Assembly Loading](https://awesome-repositories.com/f/devops-infrastructure/distribution-packaging/software-distribution/nuget-based-distributions/assembly-loading.md) — Imports compiled DLLs as byte arrays to update logic at runtime without requiring a binary rebuild.
- [Native-Interpreted Bridging](https://awesome-repositories.com/f/devops-infrastructure/execution-environments/code-execution-runtimes/interpreted-runtimes/native-interpreted-bridging.md) — Facilitates bidirectional communication between pre-compiled native code and dynamically loaded interpreted modules. ([source](https://www.hybridclr.cn/docs/basic))
- [Loading Performance Optimizations](https://awesome-repositories.com/f/devops-infrastructure/distribution-packaging/software-distribution/nuget-based-distributions/assembly-loading/loading-performance-optimizations.md) — Reduces the time spent loading assemblies into the runtime to increase startup and update speeds. ([source](https://www.hybridclr.cn/docs/business))

### Security & Cryptography

- [Metadata Encryption](https://awesome-repositories.com/f/security-cryptography/metadata-encryption.md) — Secures global metadata and hardens code to prevent unauthorized access and reverse engineering. ([source](https://www.hybridclr.cn/docs/business/intro))
- [Code Obfuscators](https://awesome-repositories.com/f/security-cryptography/security/utilities/security-hardening-and-protection/code-obfuscators.md) — Protects proprietary source code and metadata from reverse engineering through encryption and logic masking.

### Software Engineering & Architecture

- [Generic Type Resolution](https://awesome-repositories.com/f/software-engineering-architecture/generic-type-definitions/generic-type-resolution.md) — Provides runtime generic type resolution to allow hot-updated code to use any generic class regardless of pre-instantiation.
- [Mobile-Optimized Memory Management](https://awesome-repositories.com/f/software-engineering-architecture/memory-management-systems/mobile-optimized-memory-management.md) — Reduces the memory footprint of assembly metadata to ensure stability on memory-constrained mobile devices.
- [Interpreter Stack Traces](https://awesome-repositories.com/f/software-engineering-architecture/stacks/stack-trace-formatters/stack-trace-generation/interpreter-stack-traces.md) — Injects detailed virtual stack information into crash logs to pinpoint errors within interpreted code. ([source](https://www.hybridclr.cn/docs/business))

### Web Development

- [.NET Assembly Loaders](https://awesome-repositories.com/f/web-development/dynamic-loading-strategies/dynamic-stylesheet-loading/reflective-loading-mechanisms/net-assembly-loaders.md) — Dynamically loads and unloads C# assemblies into a running Unity process using byte arrays.

### Artificial Intelligence & ML

- [Assembly Unloading](https://awesome-repositories.com/f/artificial-intelligence-ml/memory-optimization/assembly-unloading.md) — Completely unloads existing assemblies from memory to allow for clean replacement of updated code. ([source](https://www.hybridclr.cn/docs/intro))

### Game Development

- [Native Performance Logic](https://awesome-repositories.com/f/game-development/game-logic-scripting/native-performance-logic.md) — Combines native compiled code and interpreted scripts to maintain high execution speed during runtime updates.
- [Dynamic Entity Updates](https://awesome-repositories.com/f/game-development/runtime-object-inspectors/dynamic-entity-updates.md) — Adds and manages scripts and data objects on game entities dynamically during runtime. ([source](https://www.hybridclr.cn/docs/basic))
