*/
Back to Blogs

IMGEditor: Building an Archive Editor for Rockstar 3D Era Games

The story behind IMGEditor — a tool for editing IMG archive files used in GTA III, Vice City, San Andreas, and Bully.

C++
ImGui
Tools

What is IMGEditor?

IMGEditor is a desktop application for editing IMG archive files — the container format used by Rockstar's 3D era games. These archives hold textures, models, and other game assets.

The IMG Format

The IMG format is a simple archive structure:

  • Header — contains metadata and file count
  • File table — offsets and sizes of each entry
  • Data — the actual file contents packed sequentially
code
struct IMGHeader {
    char magic[4];      // "VER2"
    uint32_t numEntries;
    uint32_t dirOffset;
    uint32_t dirSize;
};

Building the Editor

I chose C++ with ImGui for the UI because:

  1. Native performance — large archives need fast I/O
  2. Cross-platform potential — ImGui works on Windows, Linux, Mac
  3. Familiar stack — I already knew C++ well
  4. Clean UI — ImGui provides a professional look with minimal effort

Features

  • Import/Export individual files or bulk operations
  • Preview textures directly in the editor
  • Drag and drop support for easy file management
  • Batch replacement for modders updating multiple assets
  • Backup system to prevent accidental data loss

Multi-Game Support

The biggest challenge was supporting multiple game variants. Each game uses slightly different versions of the format, so I implemented a version detection system:

code
enum class IMGVersion {
    GTA3,      // Original format
    VC,        // Vice City variant
    SA,        // San Andreas (most common)
    Bully,     // Bully Scholarship Edition
    Unknown
};

IMGVersion DetectVersion(const char* header) {
    // Analyze header structure to determine version
    // ...
}

Results

IMGEditor has been downloaded thousands of times and is used by modders worldwide. It's become an essential tool in the GTA modding toolkit.

GitHub
LinkedIn
youtube