National Cyber Warfare Foundation (NCWF)login

Inside coffee_explorer: how a C++23 rewrite drags CFF Explorer into modern Windows


0 user ratings
2026-11-10 19:31:59
milo
Red Team (CNA)
"Inside

A ground-up recreation of CFF Explorer in C++23 and WPF, coffee_explorer gives authorized analysts a modern PE editor with undo, Authenticode verification and Detect It Easy integration.








TooliArtorias/coffee_explorer — a from-scratch modern recreation of the classic CFF Explorer PE editor for Windows
CategoryPortable Executable analysis and editing (Windows desktop tool)
Primary UseInspecting, editing and verifying PE files during authorized malware triage, reverse engineering and software supply-chain audits
Safe UseIntended for authorized security assessments, defensive malware analysis, and research on files you own or are licensed to examine; it is a local inspection and editing utility, not an attack tool
Telemetry NotePurely local: nothing touches disk until the user saves, and PDB lookups can query the Microsoft symbol server after explicit confirmation — defenders deploying it in labs should note that one outbound connection

For well over a decade, CFF Explorer from ntcore has been the default answer to “what is inside this PE file?” on Windows. coffee_explorer, published as iArtorias/coffee_explorer and released under GPL-3.0, is a deliberate attempt to retire that answer. The README positions it bluntly: CFF Explorer “has not changed since 2012,” shipping as a fixed 96 DPI window with no dark mode, no undo, an x64 exception directory that renders empty, and file identification built on a PEiD database that predates most of today's packers. coffee_explorer keeps the muscle-memory workflow — a file tree on the left, structure grids on the right, editable cells — and rebuilds everything underneath it.


The architecture is the most interesting part of the README for anyone who has maintained analysis tooling. Rather than patching the original codebase, the author wrote an entirely new high-performance C++23 core packaged as pecore.dll, built on top of a maintained fork of PeLib (iArtorias/pelib-updated), and paired it with a WPF interface styled after Visual Studio Code. That split — a parsing and editing engine in native code, presentation in managed WPF — explains several of the headline behaviors, including the non-blocking UI: files open and views render on a worker thread, large views show a placeholder rather than freezing the window, and the README claims a 300 MB game executable opens in about a second.


The single most consequential design decision, called out in an IMPORTANT callout in the README, is that coffee_explorer edits files in memory and nothing touches the disk until you explicitly hit Save. More importantly, every change is undoable — including structural operations like adding sections, rebuilding imports, or removing an Authenticode signature. Anyone who has ever fat-fingered a section header in a legacy hex-flavored editor and lost the reference copy will understand why universal undo/redo with a per-tab modified marker is a feature worth leading with. Saving itself is defensive: writes go to a temporary file that atomically replaces the original while preserving attributes, permissions, creation time and alternate data streams.


File identification is where the tool's age shows most clearly in its predecessor, and coffee_explorer swaps the dead PEiD database for Detect It Easy with the current DiE signatures. The overview screen surfaces compiler, linker, packer, protector and library detection, with optional deep, heuristic and recursive scans. Alongside it sits an entropy map: a color strip of Shannon entropy across the whole file with header, section, certificate and overlay bands, clickable to jump into the hex editor. For triage work on packed samples during authorized incident response, that one visualization — packed and encrypted regions standing out immediately — does most of the first-pass work.


The Authenticode support deserves its own paragraph because it replaces what was previously raw bytes in the security directory. coffee_explorer recomputes the digest across SHA-1, SHA-256, SHA-384 and SHA-512, compares it against the signed value, and renders the signer chain, timestamp countersignatures (RFC 3161 and legacy), serials, thumbprints and nested dual signatures. It also reports the WinVerifyTrust result offline, even for unsaved in-memory edits, and warns in the status bar the first time an edit breaks a valid signature. That last detail matters for defenders: if you are validating whether a vendor binary's signature still matches its bytes, the digest check is exactly the evidence you want.


Symbol resolution is another differentiator. The tool includes its own MSF 7.0 PDB reader — no DIA SDK, no COM registration — pulling function names, public symbols and global data. Lookup follows the CodeView path, the file's folder, _NT_SYMBOL_PATH, _NT_ALT_SYMBOL_PATH and local caches, and it can download from the Microsoft symbol server after explicit confirmation. Those names then propagate into the disassembler labels, the exception directory's function column, and the address converter. For analysts working with legitimately obtained vendor binaries in a lab, this turns a raw RUNTIME_FUNCTION dump into something readable, including decoded UNWIND_INFO on x64 and packed unwind data on ARM64.


Structural coverage is deep and, per the comparison table, fixes concrete bugs in the original. Section lookup for data directory RVAs handles zero-size sections correctly (the README notes CFF Explorer mapped .idata RVAs into .bss), the debug directory shows all entries rather than the first — CodeView RSDS/NB10, POGO, VC feature, repro, and CET-related extended DLL characteristics — and the Rich header is fully decoded, editable, and can be decrypted or re-encrypted with automatic checksum fixups. .NET metadata gets its own view across the COR20 header, streams, and the #Strings, #US, #GUID and #Blob heaps. Export and import tables gain an undecorated-name column for MSVC symbols.


The classic tool suite survives: Address Converter, Dependency Walker with API set resolution, Hex Editor, Import Adder, Rebuilder and Resource Editor with icon preview. Hashing is modernized to MD5, SHA-1, SHA-256 and BLAKE3, computed in parallel and cached per change. The UI layer is equally contemporary — per-monitor DPI v2, live light/dark themes that follow Windows, custom VS Code themes dropped into the themes folder, English/German/Russian localizations extendable with a single text file, and per-user Explorer context-menu integration without administrator rights.


Some legacy features were deliberately removed, and the README is refreshingly honest about it: the scripting engine, PEiD signatures, the plugin system, Multiple Interface mode, and import binding are all gone. That is a reasonable trade for correctness and a maintained codebase, but teams with automation built around CFF scripting should note the gap before migrating. With C++ as the language, a master default branch, and a modest but real 34-star following at the time of this writing, coffee_explorer reads as a serious single-author project rather than a weekend clone.


In an authorized workflow, this tool slots into malware triage, reverse engineering preparation, and software verification — examining samples in an isolated analysis VM, checking whether a binary's signature covers its actual bytes, or repairing a damaged import table on a copy you own. Installation is a standard GitHub release download from the repository, or a from-source build; there is nothing to weaponize here, because the tool modifies only files you explicitly open on your own machine. For anyone still squinting at a 2012-era 96 DPI window, coffee_explorer is the upgrade the PE analysis bench has been waiting for.



Official project repository for iArtorias/coffee_explorer.

Download Tool

Educational analysis for authorized security professionals. Use only in controlled, authorized environments.






Source: OffensiveSec
Source Link: https://www.offsecblog.com/2026/11/inside-coffeeexplorer-how-c23-rewrite.html


Comments
new comment
Nobody has commented yet. Will you be the first?
 
Forum
Red Team (CNA)



Copyright 2012 through 2026 - National Cyber Warfare Foundation - All rights reserved worldwide.