Implementation:3641397194 wq Gpt6 Astra ColdCoffeeReverseCore
| Knowledge Sources | |
|---|---|
| Domains | Reverse_Engineering, Binary_Analysis |
| Last Updated | 2026-10-26 14:00 GMT |
Overview
Concrete tool for in-browser PE/ELF binary triage — parsing headers, sections, imports, exports, entropy, strings, hex dumps, and entry-point disassembly — provided by the ColdBrew Zero workbench.
Description
The ColdCoffeeReverseCore module is a self-contained IIFE that parses the first 4 MiB of a dropped binary entirely client-side. It detects PE (via the MZ signature and e_lfanew→PE signature) and ELF (via the 0x7f ELF magic) formats, extracts architecture, entry point, image base, section tables with per-section entropy, import directory thunks, export name tables, and disassembles the first bytes at the entry point into Chinese-language mnemonic annotations.
A companion DOM bootstrap (`window.ColdCoffeeReverse.arm()`) wires the file-input control and view-switching lanes (summary / layout / refs / text / bytes) when the module loads in a browser. The module is also exportable via `module.exports` for Node.js reuse.
Usage
- Workbench reverse bench: drop a PE/ELF file onto the re-bench page to get an instant structural triage without uploading it to a server.
- Client-side binary inspection: import the core to parse a `File`/`Uint8Array` and call `show(model, mode)` to render any of the five views.
- Complement to server-side analysis: use alongside the server-side `binary.js` toolbox tool and IDA MCP for deeper analysis.
Code Reference
Source Location
- Repository: ColdBrew Zero
- File: desktop/src/workbench/re-bench.js
- Lines: 1-323
Signature
const ColdCoffeeReverseCore = (() => {
// CAP = 4 * 1024 * 1024 // max bytes parsed
function parseFile(file: File) -> Promise<ParseModel>
function show(model: ParseModel, mode: 'sum' | 'layout' | 'refs' | 'text' | 'bytes') -> string
return { parseFile, show };
})();
// Browser global (set when document is present):
window.ColdCoffeeReverse = { arm(): void }
Import
// CommonJS (Node/test reuse):
const ColdCoffeeReverseCore = require('./re-bench');
// Browser: loaded via <script>; auto-bootstraps when #re-desk is present.
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| file | File | Yes | Dropped/selected binary file; only the first 4 MiB are read |
| model | ParseModel | Yes (show) | Object returned by parseFile |
| mode | string | Yes (show) | View selector: sum, layout, refs, text, bytes |
Outputs
| Name | Type | Description |
|---|---|---|
| parseFile returns | Promise<ParseModel> | { name, size, truncated, sha256, entropy, hex, text, kind, arch, entry, imageBase, sections, imports, exports, entryText } |
| show returns | string | Pre-formatted text rendering of the selected view |
Usage Examples
Basic File Triage
const core = require('./re-bench');
// file is a browser File object from an <input type="file">
document.getElementById('re-file').addEventListener('change', async (event) => {
const file = event.target.files[0];
if (!file) return;
const model = await core.parseFile(file);
console.log(model.kind); // '64 位程序' or '32 位程序'
console.log(model.arch); // '64位 Intel'
console.log(model.entry); // entry RVA
console.log(model.sha256); // file hash
});
Switching Views
const model = await core.parseFile(file);
// Summary view: kind, arch, entry, entropy, sha256
console.log(core.show(model, 'sum'));
// Layout view: section table (name, VA, raw size, entropy)
console.log(core.show(model, 'layout'));
// Refs view: imports (DLL → functions) and exports
console.log(core.show(model, 'refs'));
// Bytes view: hex dump + entry-point disassembly
console.log(core.show(model, 'bytes'));
// Text view: extracted ASCII strings
console.log(core.show(model, 'text'));