Skip to main content
Glama
Heretek-RE

re-patch

by Heretek-RE

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
check_patchA

Return server status + version. Always status: OKre-patch has no external system dependencies (pure Python stdlib + mcp / pydantic).

sha256_manifestA

Compute the SHA-256 manifest of path.

Args: path: file to hash

Returns::

{
  "path": "...",
  "size": N,
  "sha256": "<64 hex chars>",
}

Use this to record the canonical SHA-256 of the original binary before any patch is applied. The hash is the rollback key: restore_original(original, target, expected_sha256=...) will refuse to proceed if the original's hash has drifted.

apply_patchA

Copy src to dst, then splice new_bytes_b64 at offset.

This is the on-disk patch primitive. The original bytes at src are never modified; the patch is written to a copy at dst. The function returns both the pre-patch and post-patch SHA-256 so the analyst can record the patch's net effect in the report.

Args: src: source file (the original; never modified) dst: destination file (created or overwritten with the patched copy) offset: byte offset into dst at which to write (0-based) new_bytes_b64: base64-encoded bytes to splice in confirm_legal: free-text justification (the audit trail; the server does not enforce policy)

Returns::

{
  "src": "...",
  "dst": "...",
  "src_sha256": "<original>",
  "dst_sha256": "<patched>",
  "src_size": N,
  "dst_size": N,
  "offset": N,
  "patched_bytes": M,
  "confirm_legal": "...",
}

Override-scope contract: this tool is gated behind the run's policy override (see override-scope.md of the active run). The override authorizes on-disk patches only inside Output/<run-id>/patches/; the confirm_legal text must reference the override file and the rationale.

restore_originalA

Copy original back to restore_target, optionally verifying the original's SHA-256 against expected_sha256 first.

This is the rollback primitive. The function:

  1. Computes the SHA-256 of original.

  2. If expected_sha256 is non-empty, verifies the computed hash matches (refuses to proceed otherwise).

  3. Copies original to restore_target (overwriting).

Args: original: file whose bytes are the canonical "original" (typically the source the patch was applied from) restore_target: file to write the original bytes to (typically the patched copy) expected_sha256: optional hex-encoded SHA-256 to verify original against confirm_legal: free-text justification (audit trail)

Returns::

{
  "original": "...",
  "restore_target": "...",
  "original_sha256": "<hash>",
  "expected_sha256": "<hash>" or null,
  "verified": bool,
  "confirm_legal": "...",
}

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Heretek-RE/re-patch'

If you have feedback or need assistance with the MCP directory API, please join our Discord server