Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ WORKDIR /src
# Copy all files to build
COPY . .

# Publish de4dot targeting net8.0
# Publish both de4dot and the de4dot.mcp server targeting net8.0
RUN dotnet publish -c Release -f net8.0 -o /app/publish/de4dot de4dot/de4dot.csproj
RUN dotnet publish -c Release -f net8.0 -o /app/publish/mcp de4dot.mcp/de4dot.mcp.csproj
RUN rm -rf /app/publish/**/*.pdb /app/publish/**/*.xml

# ==============================================================================
Expand All @@ -44,20 +45,35 @@ RUN rm -rf /app/publish/**/*.pdb /app/publish/**/*.xml
FROM mcr.microsoft.com/dotnet/runtime:8.0 AS runtime
WORKDIR /app

# Install native dependencies required for execution (e.g. globalization)
# Install native dependencies required for execution (e.g. globalization, bash)
RUN apt-get update && apt-get install -y \
libicu-dev \
bash \
&& rm -rf /var/lib/apt/lists/*

# Copy de4dot published folder
# Copy de4dot and MCP published folders
COPY --from=dotnet-builder /app/publish/de4dot ./de4dot
COPY --from=dotnet-builder /app/publish/mcp ./mcp

# Copy compiled libBeaEngine.so from Stage 1 standardized path to system libraries & register
COPY --from=beaengine-builder /app/libBeaEngine.so /usr/local/lib/libBeaEngine.so
RUN ldconfig

# Create symlink for global accessibility
RUN ln -s /app/de4dot/de4dot /usr/local/bin/de4dot
# Create symlinks for global accessibility
RUN ln -s /app/de4dot/de4dot /usr/local/bin/de4dot && \
ln -s /app/mcp/de4dot.mcp /usr/local/bin/de4dot-mcp

ENTRYPOINT ["de4dot"]
# Create a unified entrypoint script inside the final image
RUN printf '#!/bin/bash\n\
if [ "$1" = "--mcp" ] || [ "$1" = "-mcp" ]; then\n\
shift\n\
exec /app/mcp/de4dot.mcp "$@"\n\
else\n\
exec /app/de4dot/de4dot "$@"\n\
fi\n' > /app/entrypoint.sh && chmod +x /app/entrypoint.sh

# Expose HTTP port 8080 (for MCP Web API mode)
EXPOSE 8080

ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["--help"]
70 changes: 66 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ Binaries

Get binaries from the build server [![](https://github.com/GDATAAdvancedAnalytics/de4dotEx/workflows/CI%20build/badge.svg)](https://github.com/GDATAAdvancedAnalytics/de4dotEx/actions).

Docker Support
==============
Docker & MCP Server Support
===========================

de4dotEx now has fully integrated **Docker containerization** support:
de4dotEx now has fully integrated **Docker containerization** and native **Model Context Protocol (MCP)** server support:

* **Docker Container:** Build a single container to run de4dotEx natively or inside a cross-platform headless Wine environment. See the [Docker Containerization](#docker-containerization) section below for build and run instructions.
* **Docker Container:** Build a single container to run de4dotEx natively, as a local stdio MCP server, or as an HTTP Web API microservice. See the [Docker Containerization](#docker-containerization) section below for build and run instructions.
* **MCP Server:** Integrate de4dotEx directly with AI assistants like Claude Desktop, Cursor, or Windsurf to programmatically deobfuscate binaries. See the [Native C# MCP Server](#native-c-mcp-server) section below for configuration instructions.

It's FREE but there's NO SUPPORT
================================
Expand Down Expand Up @@ -353,3 +354,64 @@ If you get a warning saying `DEPRECATED: The legacy builder is deprecated` or an

### Globalization/Localization Issues
* Both images are configured with native globalization components (`libicu`). If you encounter encoding issues with non-ASCII or obfuscated class/method names, make sure your terminal and volume directories are UTF-8 compliant.


Native C# MCP Server
====================

de4dotEx includes a native **Model Context Protocol (MCP)** server built on **.NET 8.0**.

By running de4dotEx as an MCP server, you can connect it directly to AI assistants (such as **Claude Desktop**, **Cursor IDE**, **Windsurf**, or the **VS Code MCP Client**). This allows the AI agent to programmatically and automatically deobfuscate .NET assemblies (EXE and DLL) inside directories it is analyzing!

Exposed MCP Tools
-----------------

### `deobfuscate`
Deobfuscate and unpack a .NET assembly (EXE or DLL) using de4dotEx.

**Arguments:**
* `file_path` (string, **required**): The absolute file path of the .NET assembly to deobfuscate.
* `output_path` (string, *optional*): Custom file path where the cleaned assembly should be written.
* `options` (string, *optional*): Additional CLI options to pass to the engine (e.g. `"--preserve-tokens"` or `"-str delegate"`).

How to Build the MCP Server
---------------------------

You can build the MCP server using the standard `dotnet` CLI:
```bash
dotnet publish -c Release -f net8.0 -o ./publish-net8.0-mcp de4dot.mcp
```
After building, the published files (including the binary and its dependencies) will be placed in the `./publish-net8.0-mcp/` directory.

How to Configure Your AI Client
-------------------------------

To add de4dotEx to your AI assistant, register it in your client's MCP configuration file (typically `claude_desktop_config.json` for Claude Desktop).

### 1. Claude Desktop Configuration
Open your Claude Desktop configuration file:
* **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
* **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`

Add the following block under the `mcpServers` object:
```json
{
"mcpServers": {
"de4dotex": {
"command": "dotnet",
"args": [
"/absolute/path/to/de4dotEx/publish-net8.0-mcp/de4dot.mcp.dll"
]
}
}
}
```
*(Make sure to replace `/absolute/path/to/de4dotEx/` with the actual absolute path to your cloned repository.)*

### 2. Cursor IDE Configuration
1. Open Cursor Settings -> **Features** -> **MCP**.
2. Click **+ Add New MCP Server**.
3. Name: `de4dotex`
4. Type: `stdio`
5. Command: `dotnet /absolute/path/to/de4dotEx/publish-net8.0-mcp/de4dot.mcp.dll`
}
4 changes: 4 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ Remove-Item Release\net48\*.pdb, Release\net48\*.xml, Release\net48\Test.Rename.
dotnet publish -c Release -f net8.0 -o publish-net8.0 de4dot
if ($LASTEXITCODE) { exit $LASTEXITCODE }
Remove-Item publish-net8.0\*.pdb, publish-net8.0\*.xml

dotnet publish -c Release -f net8.0 -o publish-net8.0-mcp de4dot.mcp
if ($LASTEXITCODE) { exit $LASTEXITCODE }
Remove-Item publish-net8.0-mcp\*.pdb, publish-net8.0-mcp\*.xml
Loading
Loading