README
¶
CyberPatchMaker
Update your software smarter, not harder.
CyberPatchMaker creates tiny update files for large applications. Instead of downloading a whole 5GB app again, download just a few megabytes of changes.
Why Use CyberPatchMaker?
Imagine you have a 5GB application. You make some small changes and release version 1.0.1. Without CyberPatchMaker, users download the entire 5GB again. With CyberPatchMaker, they download only a few MB patch file that contains just the changes.
Real-world example:
- Version 1.0.0: 5GB application
- Version 1.0.1: 5GB application (only a few files changed)
- Traditional update: Download 5GB again
- With CyberPatchMaker: Download 5MB patch file
Perfect for:
- Game developers releasing updates
- Software companies with large applications
- Anyone who wants to save bandwidth and user time
Key Features
- Safe & Reliable - Automatic verification and rollback if anything goes wrong
- Efficient - Smart compression reduces patch sizes by ~60%
- Bidirectional - Generate both upgrade and downgrade patches for version flexibility
- Cross-Platform - Works on Windows, macOS, and Linux
- Developer-Friendly - Simple command-line tools
- Production-Ready - Built-in backup and recovery systems
- Self-Contained Executables - Create standalone
.exefiles for easy end-user distribution - Smart File Exclusion - Use
.cyberignoreto exclude sensitive files and reduce patch size - Scan Caching - Cache directory scans for instant patch generation (15+ min → <1 sec for large projects)
- Simple Mode for End Users - Simplified interface for non-technical users with basic options
- Silent Mode - Fully automatic patching with zero user interaction, automatic log file generation (CLI only)
- Large File Handling - Automatic memory-optimized processing for files >1GB, prevents memory exhaustion
- Multi-Part Patches - Automatic splitting of patches >4GB into manageable parts (prevents memory exhaustion with 18GB+ patches)
- Parallel Processing - Multi-threaded patch generation using multiple CPU cores for faster processing
- Advanced Compression - Multiple compression algorithms (zstd, gzip) with configurable levels
Quick Start
Installation
Requirements: Go 1.24.0 or later
# Clone and build
git clone https://github.com/cyberofficial/CyberPatchMaker.git
cd CyberPatchMaker
go build -o patch-gen ./cmd/generator
go build -o patch-apply ./cmd/applier
Detailed setup: See Development Setup Guide
Basic Usage
Creating a Patch
Generate patches for a new version of your software:
patch-gen --versions-dir ./versions --new-version 1.0.3 --output ./patches
This automatically creates patch files from all previous versions to version 1.0.3.
Applying a Patch
Update your application with a patch file:
# Test first (dry-run)
patch-apply --patch ./patches/1.0.0-to-1.0.3.patch --current-dir ./app --dry-run
# Apply the update
patch-apply --patch ./patches/1.0.0-to-1.0.3.patch --current-dir ./app --verify
The --verify flag ensures everything is checked before and after patching, with automatic rollback if anything goes wrong.
More examples and options:
- Generator Guide - All patch creation options
- Applier Guide - All patch application options
- CLI Reference - Complete command reference
- CLI Examples - Common usage patterns
- Downgrade Guide - Rollback to previous versions
- Multi-Part Patches - Handling patches >4GB (automatic splitting)
Advanced Options
CyberPatchMaker includes several advanced CLI flags for performance optimization and specialized use cases:
Scan Caching (--savescans, --scandata, --rescan)
Cache directory scans to dramatically speed up subsequent patch generations:
# First generation: Enable caching
patch-gen --versions-dir ./versions --new-version 1.0.3 --output ./patches --savescans
# Subsequent generations: Load from cache (instant)
patch-gen --versions-dir ./versions --new-version 1.0.4 --output ./patches --savescans
# Custom cache location
patch-gen --versions-dir ./versions --new-version 1.0.3 --output ./patches --savescans --scandata ./shared-cache
# Force rescan when files have changed
patch-gen --versions-dir ./versions --new-version 1.0.3 --output ./patches --savescans --rescan
Benefits:
- Large projects: 15+ minute scan → <1 second cache load
- Validates key file hash to prevent stale data usage
- Works with all patch generation modes
Parallel Processing (--jobs)
Use multiple CPU cores for faster patch generation:
# Auto-detect CPU cores (default)
patch-gen --versions-dir ./versions --new-version 1.0.3 --output ./patches
# Use 4 cores explicitly
patch-gen --versions-dir ./versions --new-version 1.0.3 --output ./patches --jobs 4
# Single-threaded for debugging
patch-gen --versions-dir ./versions --new-version 1.0.3 --output ./patches --jobs 1
Benefits:
- Faster processing on multi-core systems
- Automatic CPU detection (0 = auto-detect)
- Significant speedup for large projects
Multi-Part Split Size (--splitsize, --bypasssplitlimit)
Control how large patches are split into manageable parts:
# Custom 2GB split size
patch-gen --from-dir ./v1 --to-dir ./v2 --output ./patches --splitsize 2G
# Small split size (requires confirmation bypass)
patch-gen --from-dir ./v1 --to-dir ./v2 --output ./patches --splitsize 50M --bypasssplitlimit
Benefits:
- Prevents memory exhaustion with very large patches
- Default 4GB splits, customizable
- Automatic part reassembly during application
Excluding Files with .cyberignore
Control which files are included in patches using a .cyberignore file (similar to .gitignore):
:: Place in your version directory
:: Lines starting with :: are comments
:: Ignore sensitive files
*.key
*.crt
config/secrets.json
:: Ignore logs and temporary files
*.log
*.tmp
logs/
:: Ignore user data
saves/
user_config.json
:: Exclude files from external directories (absolute paths)
E:\temp\build\*.log
C:\shared\cache\*
The generator automatically excludes matching files from patches. Perfect for keeping API keys, certificates, and user data out of updates!
Complete guide: .cyberignore File Guide
Downgrade Patches (Rolling Back)
Need to rollback to a previous version? CyberPatchMaker supports bidirectional patches:
# Generate downgrade patch
patch-gen --from 1.0.3 --to 1.0.2 --versions-dir ./versions --output ./patches/downgrade
# Apply downgrade to rollback
patch-apply --patch ./patches/downgrade/1.0.3-to-1.0.2.patch --current-dir ./app --verify
This allows users to safely revert to an earlier version if needed.
Complete downgrade documentation: Downgrade Guide
How It Works (Simple Version)
CyberPatchMaker compares two versions of your software and creates a small patch file containing only the differences. When users apply the patch, it safely updates their installation with built-in verification and rollback protection.
The process:
- Generate: Compare old version with new version → Create small patch file
- Distribute: Share the tiny patch file instead of the full application
- Apply: Users run the patch → Their software updates safely
Safety features:
- Verifies files before patching (catches corruption early)
- Creates automatic backup
- Verifies files after patching
- Automatic rollback if anything fails
Want technical details?
- How It Works - Deep dive into the internals
- Architecture - System design and components
- Hash Verification - Security and verification
- Key File System - Version identification
- Backup Lifecycle - Backup and recovery process
- Backup System - Comprehensive backup management
- Version Management - How versions are tracked
Complete Example
Here's a typical workflow from start to finish:
# 1. You have a new version ready
mkdir versions/1.0.2
# (copy your new version files into versions/1.0.2/)
# 2. Generate patch files
patch-gen --versions-dir ./versions --new-version 1.0.2 --output ./patches
# Creates: patches/1.0.0-to-1.0.2.patch
# patches/1.0.1-to-1.0.2.patch
# 3. Distribute patch files to users
# (upload to your website, CDN, etc.)
# 4. Users test the patch first (optional but recommended)
patch-apply --patch 1.0.0-to-1.0.2.patch --current-dir ./myapp --dry-run
# 5. Users apply the patch
patch-apply --patch 1.0.0-to-1.0.2.patch --current-dir ./myapp --verify
# Done! Their version 1.0.0 is now version 1.0.2
More examples: CLI Examples
What's Included
Production-Ready CLI Tools:
- Patch Generator (
patch-gen.exe/patch-gen) - Create update files - Patch Applier (
patch-apply.exe/patch-apply) - Install updates - Comprehensive verification and automatic rollback
- Tested with complex directory structures
- Handles files from 1KB to 20GB+ with automatic memory optimization
- Multiple compression formats (zstd, gzip)
Documentation: Full Documentation Index
Testing
Want to verify everything works? Run the test suite:
# Windows PowerShell
.\advanced-test.ps1
The test suite automatically validates:
- Patch generation and application
- Multiple compression formats
- Wrong version detection
- File corruption detection
- Backup and rollback systems
- Complex directory structures
Testing documentation:
- Testing Guide - How to test your patches
- Advanced Test Summary - Detailed test results
Performance & Reliability
Fast:
- Generate patches for 5GB apps in under 5 minutes
- Apply patches in under 3 minutes
- Low memory usage (< 500MB)
Small:
- Typical patches are < 5% of full app size
- Smart compression reduces size by ~60%
Safe:
- Every file verified before and after patching
- Automatic backup and rollback
- Prevents applying wrong patches
Technical details:
- Architecture - System design
- Compression Guide - Compression options
- Version Management - How versions are tracked
Documentation
All documentation is in the docs/ folder:
Getting Started:
- Quick Start - Get up and running fast
- CLI Examples - Common usage patterns
- Development Setup - Developer guide
Reference:
- Generator Guide - Creating patches
- Applier Guide - Applying patches
- Self-Contained Executables - Standalone patch distribution
- CLI Reference - All commands and options
- Simple Mode Guide - Simplified interface for end users
Advanced:
- How It Works - Technical deep dive
- Architecture - System design
- Testing Guide - Testing your patches
- Troubleshooting - Common issues
- Advanced Test Summary - Detailed test results
- Large File Handling - Memory optimization for large files
- Backup System - Comprehensive backup management
- Key File System - Version identification
- Version Management - How versions are tracked
- Compression Guide - Compression options
- Hash Verification - Security and verification
- Backup Lifecycle - Backup and recovery process
- Multi-Part Patches - Handling large patches
- Cyberignore Guide - File exclusion patterns
Contributing
Contributions are welcome! Please feel free to submit issues and pull requests.
License
See LICENSE file for details.
Author
Created by CyberOfficial
Like this project? Give it a star on GitHub!
Support the project
If you'd like to support continued development, consider sponsoring on GitHub: Sponsor Me