Patch Diff Analyzer logo

Patch Diff Analyzer

Organization
HacktronAI
patch-diff-analyzer

Specialized in reverse-engineering compiled binaries (JARs, DLLs). Use this when the user asks to compare versions, find security fixes, or analyze binary patches.

Overview

PublisherHacktronAI
Repositoryskills
Skill namepatch-diff-analyzer
Stars
116
Forks
14
Bundled files
5
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 5 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by HacktronAI on GitHub. Read the source before you install it.

Installation

Install the Patch Diff Analyzer AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/HacktronAI/skills/tree/main/patch-diff-analyzer
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/HacktronAI/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/patch-diff-analyzer .claude/skills/patch-diff-analyzer
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Patch Diff Analyzer in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Patch Diff Analyzer on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Patch Diff Analyzer is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Patch Diff Analyzer

IMPORTANT: Users may request analysis of security patches in compiled binaries (JARs, DLLs, etc.) to understand what vulnerabilities were fixed. This extension helps decompile binaries, generate diffs, and identify security-relevant changes.

Available scripts

The extension have these scripts:

  • setup-workspace.sh <workspace-name>

What it does:

  1. Creates workspace directory
  2. Initializes git repository for diff tracking
  3. Configures git user for commits
  4. Creates subdirectories: decompiled/, output/
  • decompile-jar.sh <app.jar> /decompiled/

What it does:

  1. Creates decompiled directory in workspace dir
  2. Decompiles the jar file in the dir.
  • decompile-dll.sh <app.dll> /decompiled/

What it does:

  1. Creates decompiled directory in workspace dir
  2. Decompiles the dll file in the dir.
  • analyze-diff.sh

What it does:

  1. Verifies git repository has 2+ commits
  2. Identifies unpatched and patched tags (or uses HEAD~1 and HEAD)
  3. Generates diff statistics
  4. Creates patch-analysis.diff file
  5. Creates changed-files.txt list

Workflow Decision Tree

When a user requests patch analysis:

  1. Identifying Binaries: Do you need to determine which file is patched vs unpatched?

  2. File Format: What type of binary are you analyzing?

  3. Analysis Context: Does the user provide vulnerability information?

    • YES (CVE/Description provided) → Focus analysis on related changes
    • NO (Blind analysis) → Perform comprehensive security change analysis

Binary Identification

CRITICAL: Before decompilation, correctly identify which binary is the patched version.

Identification Methods

  1. Explicit Naming:

    • Files named patched.jar / unpatched.jar
    • Files named vulnerable.jar / fixed.jar
    • → Use as specified
  2. Version Numbers:

    • app-1.2.3.jar vs app-1.2.4.jar
    • → Higher version number is typically patched (1.2.4 > 1.2.3)
    • For semantic versioning: major.minor.patch format
  3. File Timestamps:

    bash
    ls -lt *.jar
    • Newer timestamp typically indicates patched version
    • Note: Not reliable if files were copied/moved
  4. When Ambiguous:

    • ALWAYS ask the user for clarification
    • Do not guess if there's any uncertainty

Setup & Decompilation

Workspace Setup Script

Use the provided setup script.


Efficient Extraction (Skip Third-Party Libraries)

CRITICAL: For WAR files or large applications, extract ONLY proprietary code before decompiling. This saves significant time and storage.

Identify Proprietary Code Location

WAR file structure:

application.war
├── WEB-INF/
│   ├── classes/          ← Application code (DECOMPILE THIS)
│   │   └── com/
│   │       └── vendor/   ← Proprietary packages
│   └── lib/              ← Third-party JARs (SKIP THESE)
│       ├── jackson-*.jar
│       ├── spring-*.jar
│       └── hibernate-*.jar
└── META-INF/

Extract Proprietary Code Only

bash
# 1. List WAR contents to identify proprietary packages
unzip -l unpatched.war | grep "WEB-INF/classes" | grep "\.class$" | head -30

# Look for company-specific packages:
# WEB-INF/classes/com/acme/
# WEB-INF/classes/com/vendor/
# WEB-INF/classes/org/internal/

# 2. Extract ONLY proprietary classes
mkdir -p temp-unpatched
unzip unpatched.war "WEB-INF/classes/com/vendor/*" -d temp-unpatched/
unzip unpatched.war "WEB-INF/classes/com/acme/*" -d temp-unpatched/

# 3. Create JAR from extracted classes
cd temp-unpatched/WEB-INF/classes
jar cf ../../../vendor-unpatched.jar .
cd ../../..

# 4. Repeat for patched version
mkdir -p temp-patched
unzip patched.war "WEB-INF/classes/com/vendor/*" -d temp-patched/
unzip patched.war "WEB-INF/classes/com/acme/*" -d temp-patched/
cd temp-patched/WEB-INF/classes
jar cf ../../../vendor-patched.jar .
cd ../../..

# Now decompile ONLY proprietary code (much faster!)

JAR Decompilation Workflow

Step 1: Decompile Unpatched Version (Proprietary Code)

  • Use the JAR decompilation script provided with extension to decompile the JAR.

Step 2: Commit Unpatched Version

bash
cd <workspace>
git add -A
git commit -m "Unpatched version"
git tag unpatched

CRITICAL: The unpatched tag is used by the diff analysis script.

Step 3: Decompile Patched Version

IMPORTANT: Clear the decompiled directory first to avoid mixing files.

bash
rm -rf <workspace>/decompiled/*

Step 4: Commit Patched Version

bash
cd <workspace>
git add -A
git commit -m "Patched version"
git tag patched

CRITICAL: The patched tag is used by the diff analysis script.


.NET Decompilation Workflow

Step 1: Decompile Unpatched Version

  • Use the DLL decompilation script provided with extension to decompile the DLL.

Step 2-4: Same as JAR Workflow

Follow the same git commit process as the JAR workflow:

  1. Commit unpatched with tag
  2. Clear directory
  3. Decompile patched
  4. Commit patched with tag

Diff Generation & Analysis

Generate Diff

  • Use analyze-diff.sh <workspace> to generate patch-analysis.diff and changed-files.txt list

Read and Analyze Diff

MANDATORY: Read the generated diff file completely.

DO NOT use grep or pattern matching. The LLM must read and reason about the actual code changes.


Security Analysis

CRITICAL: This is where you apply security expertise to understand the vulnerability fix.

Step 1: Filter Third-Party Libraries

MANDATORY FIRST STEP: Before analyzing changes, separate proprietary code from third-party libraries.

Why This Matters:

  • Third-party library updates are expected and well-documented (Jackson, Spring, Hibernate, etc.)
  • Proprietary code changes indicate application-specific security fixes
  • Custom vulnerabilities are more interesting than known library CVEs
  • Focusing on proprietary code reveals unique attack vectors

Step 2: Analysis Process

  1. Read Every Change: Don't skip any modifications, even small ones
  2. Understand Context: Look at surrounding code, not just the diff lines
  3. Identify Security Changes: Distinguish security fixes from refactoring/features
  4. Reason About Vulnerability: What attack was possible before? What does the fix prevent?
  5. Assess Completeness: Is the fix comprehensive or could there be bypasses?

What to Look For

High-Priority Indicators:

  • Input validation added where none existed
  • Sanitization/encoding of user-controlled data
  • Authentication/authorization checks introduced
  • Bounds checking before array/buffer access
  • Type checking or casting changes
  • Canonicalization of file paths
  • Parameterized queries replacing string concatenation
  • Deserialization filters or whitelists
  • Resource limits (size, timeout, rate)

Reporting Findings

Report Structure

MANDATORY: Use this structure for your analysis report:

markdown
# Patch Analysis Summary

## Overview
[Brief description of what was analyzed]

## Vulnerability Identified: [Type/CVE]

**Severity**: [Critical/High/Medium/Low]

## Detailed Analysis

### File: [path/to/file.java:line-range]

[Detailed analysis following the framework above]

## Completeness Assessment

[Is the fix complete? Any potential bypasses? Additional recommendations?]

## Confidence Level

Overall confidence: [HIGH/MEDIUM/LOW] ([percentage]%)

Error Messages & Solutions

"No decompiler found"

Solution: Install jadx (for JAR) or ilspycmd (for DLL)

"Not a git repository"

Solution: Run setup-workspace.sh script first

"Need at least 2 commits"

Solution: Ensure both unpatched and patched versions were committed

"No differences found"

Solution:

  • Verify you decompiled different versions
  • Check git log to see commits
  • May indicate files are identical

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Patch Diff Analyzer AI skill do?

Specialized in reverse-engineering compiled binaries (JARs, DLLs). Use this when the user asks to compare versions, find security fixes, or analyze binary patches.

Why use Patch Diff Analyzer on TypingMind?

Because you install it once and use it with any model. Patch Diff Analyzer is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Patch Diff Analyzer in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/HacktronAI/skills/tree/main/patch-diff-analyzer. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Patch Diff Analyzer?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Patch Diff Analyzer?

As many as you like. As long as a model supports skills, you can use Patch Diff Analyzer with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Patch Diff Analyzer AI skill free?

Yes. It is published on GitHub by HacktronAI under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇