Skip to content

feat: Add native .NET 8.0 MCP server and unified Docker configuration#32

Closed
doomedraven wants to merge 2 commits into
GDATAAdvancedAnalytics:masterfrom
doomedraven:feat/mcp-docker-support
Closed

feat: Add native .NET 8.0 MCP server and unified Docker configuration#32
doomedraven wants to merge 2 commits into
GDATAAdvancedAnalytics:masterfrom
doomedraven:feat/mcp-docker-support

Conversation

@doomedraven

Copy link
Copy Markdown

Summary

This PR adds native cross-platform Docker containerization and native C# Model Context Protocol (MCP) server capabilities to de4dotEx. It also includes critical reliability safeguards for the control flow emulator and assembly writer to prevent crashes on modern, aggressively obfuscated binaries.

Key Changes

  1. Native C# MCP & Web API Server (de4dot.mcp):

    • Implements a native, zero-dependency .NET 8.0 MCP server over stdin/stdout.
    • Integrates an in-process ASP.NET Core Kestrel Web API on port 8080 (via POST /deobfuscate file uploads) that processes assemblies in-process and downloads the output directly.
    • Isolates standard out logging into a string capture buffer to prevent stream pollution during JSON-RPC exchanges.
  2. Unified Multi-Stage Dockerization (Dockerfile):

    • Strategy A (Native .NET 8.0): Compiles the native C++ BeaEngine disassembler library inside the container (libBeaEngine.so) and deploys both standard CLI and MCP/Web API modes, handled by a unified routing entrypoint script.
    • Strategy B (Wine + .NET 4.8): A secondary Dockerfile.wine providing full emulation compatibility for advanced JIT-hook protectors (ILProtector, Agile.NET).
  3. Critical Emulator and Writer Safeguards:

    • CF Emulator Null-Target Fix: Catches null-target exceptions (e.g. from orphan blocks or dead-code traps) inside BlockCflowDeobfuscator.cs and gracefully skips them rather than aborting the entire run.
    • Global KeepOldMaxStack Save Optimization: Forces MetadataFlags.KeepOldMaxStack inside ObfuscatedFile.cs to eliminate metadata writer calculation crashes on complex obfuscated code, guaranteeing execution safety under the .NET JIT.
  4. Integration Guides & Clients:

    • Consolidates comprehensive installation, configuration, and troubleshooting documentation directly into the primary README.md.
    • Adds test_api.sh bash script to easily verify the local Web API.

@doomedraven
doomedraven force-pushed the feat/mcp-docker-support branch 3 times, most recently from 6ba4a9c to d436f4e Compare July 23, 2026 17:13
- Implement a native C# MCP server inside the new `de4dot.mcp` project, supporting both stdio-based JSON-RPC and an in-process Kestrel HTTP Web API on port 8080.

- Create a multi-stage `Dockerfile` that builds the native BeaEngine C++ disassembler library, publishes de4dotEx, and deploys them alongside a unified bash entrypoint supporting CLI, Stdio MCP, and HTTP REST modes.

- Write a secondary `Dockerfile.wine` for Wine-based execution with full Windows .NET Framework 4.8 JIT-hook dynamic unpacking parity.

- Resolve a cflow emulator crash by catching invalid branch target exceptions (null fall-throughs) inside `BlockCflowDeobfuscator.cs`, allowing the process to gracefully skip corrupted traps instead of aborting.

- Add `MetadataFlags.KeepOldMaxStack` as a global save fallback inside `ObfuscatedFile.cs` to eliminate metadata writer stack-depth recalculation warnings and crashes on heavily obfuscated code.

- Add `test_api.sh` client utility script for local testing.

- Consolidate all Docker and MCP configuration and troubleshooting documentation directly into the primary `README.md` file.
@doomedraven
doomedraven force-pushed the feat/mcp-docker-support branch from d436f4e to c83a706 Compare July 23, 2026 18:07
- Implement a native C# MCP server inside the new `de4dot.mcp` project, supporting both stdio-based JSON-RPC and an in-process Kestrel HTTP Web API on port 8080.

- Create a multi-stage `Dockerfile` that builds the native BeaEngine C++ disassembler library, publishes de4dotEx, and deploys them alongside a unified bash entrypoint supporting CLI, Stdio MCP, and HTTP REST modes.

- Write a secondary `Dockerfile.wine` for Wine-based execution with full Windows .NET Framework 4.8 JIT-hook dynamic unpacking parity.

- Resolve a cflow emulator crash by catching invalid branch target exceptions (null fall-throughs) inside `BlockCflowDeobfuscator.cs`, allowing the process to gracefully skip corrupted traps instead of aborting.

- Add `MetadataFlags.KeepOldMaxStack` as a global save fallback inside `ObfuscatedFile.cs` to eliminate metadata writer stack-depth recalculation warnings and crashes on heavily obfuscated code.

- Add `test_api.sh` client utility script for local testing.

- Consolidate all Docker and MCP configuration and troubleshooting documentation directly into the primary `README.md` file.

- Create and install a custom Gemini CLI Skill `dotnet-deobfuscate` to provide native, expert-level deobfuscation guidelines inside the agent context.
@doomedraven
doomedraven force-pushed the feat/mcp-docker-support branch from 3411076 to 8fac013 Compare July 23, 2026 18:32
@doomedraven

Copy link
Copy Markdown
Author

i will split this PR into smallers for easier review

@doomedraven
doomedraven deleted the feat/mcp-docker-support branch July 23, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant