shellext / Hash Files

Hash Files

Hash Files (frmHash) is the per-folder analysis dialog opened by the Hash Files right-click menu on a folder. It hashes every file in the folder, lists them with size and PE compile date, and exposes a heavy right-click menu for triage — renaming, dedupe, reports, VT lookups, SQL export, and per-file diff.

The dispatch is shellext.exe "%1" /hash, which calls frmHash.HashDir. If the folder is empty, you're offered the option to recurse into subfolders — that handoff goes to frmRecursiveHashFiles.

Hash Files dialog
Folder listing with file name, byte size, MD5, and compile date columns. Signed files are colored: blue for valid signatures, red for invalid. Tooltip on a colored row shows the verification result. Right-click anywhere on the listview to open the popup menu.

The listview

Columns: File, ByteSize, MD5 (or SHA256 if Use SHA256 is on), CompileDate (GMT). Compile date column shows a content-type description for non-PE files. The path each row was loaded from is stashed in li.Tag, so renames and moves operate on the actual file even if the displayed name has been edited.

x64 redirection is disabled while hashing, so files in C:\Windows\System32 are hashed as their native 64-bit binaries on a 64-bit OS.

System menu (window-frame menu)

The window's system menu (right-click on the title bar, or click the title-bar icon) gets three extra entries appended at form load:

ItemAction
Compare Hash Sets...Opens the Compare HashSets dialog. The Hash Files window is detected at form load — if it's open, the Select In Main UI button in Compare HashSets is enabled.
Hash Search...Opens frmMD5FileSearch with the current folder pre-filled as the base directory.
Generate Strings Dump for AllEquivalent to right-click → Reports → Strings Dump.

Right-click: Copy

ItemAction
AllTab-delimited table of name, size, hash, compile date. If every row is named with its own hash (as after Rename to MD5), the hash column is omitted to avoid duplication.
SelectedSame format, selected rows only.
CSV"All" with tabs replaced by commas.
Sql ExportOpens the SQL Export dialog with this folder's listview as the source.
HashsOne hash per line, all rows. Useful for piping into Compare HashSets.
DetailedFor every row, runs frmFileHash.ShowFileStats in automation mode and concatenates the per-file reports with a separator. Slow on large folders. Selected-only when more than one row is selected.

Right-click: Rename to

ItemAction
MD5Renames every file to its MD5 hash. Files already so named are skipped. Collisions get _2, _3, ... suffixes (no overwrite). A rename_log.txt mapping old → new names is written to the folder.
SHA256Same, with SHA256.
SequentialRenames every file to 1, 2, 3, ... — useful for masking original names before sharing a sample folder.

Right-click: file-management actions

ItemAction
Make All Extensions SafeAppends _ to every file's extension (foo.exefoo.exe_) so Explorer won't run them on a careless double-click. .txt files are skipped; already-safe and extensionless files are skipped.
Set All Custom ExtensionPrompt for an extension; replace every file's existing extension with it.
Make folders for eachFor every file, create a sibling folder with the same base name. Sets up the layout for the matching auto-analysis output.
Hash all files belowOpens frmRecursiveHashFiles against the current folder.
Move Selected to SubFolderFolder picker, then move all selected files there. Skips files that already exist in the destination.
Deleted Selected FilesConfirms, then deletes the selected files from disk and the listview.
Delete All DuplicatesConfirms, then for every hash that appears more than once, keeps the first row and deletes the rest from disk.

Right-click: Reports

Each report is written to a temp file and opened in Notepad with a "save as" reminder header.

ItemOutput
Display uniqueHash ↔ comma-separated file-name lookup, one row per unique hash. Tells you which sets of files in the folder are duplicates of each other.
Unique ImpHashLoads each PE, computes imphash, groups files by imphash. Output: each imphash, hit count, and the list of MD5s sharing it. Catches near-identical malware whose code differs but import table doesn't.
Strings DumpRuns frmStrings.ParseFile + AutoSave on every file, producing one str_* file per source. Files already prefixed str_ are skipped.
Rich Header → BasicOne line per file: Exists, CheckSumOk, entry count.
Rich Header → DetailedFull CRichHeader.dump per file — the complete decoded compiler/build-tool fingerprint block.

Right-click: VT submenu

ItemAction
Lookup AllBuilds a hash,path list of every row, puts it on the clipboard, and launches virustotal.exe /bulk. The VT helper reads from the clipboard.
Lookup SelectedSingle selection: virustotal.exe "<path>". Multi: same clipboard handoff as Lookup All.
Submit SelectedSingle: virustotal.exe "/submit <path>". Multi: clipboard, then virustotal.exe /submitbulk.
Set Api KeyOpens the API Key dialog.

VT items are disabled when no API key is set.

Right-click: PE Diff and Hash Diff

ItemAction
PE DiffSelect 1 or 2 rows. With 1 selected: launches pediff.exe on that file. With 2 selected: launches pediff.exe with both as arguments — structural diff of the two PEs.
Hash Diff against...Folder picker. Opens a second hashing pass against the chosen folder, then writes a Notepad report comparing the two: count and unique-hash count for each set, files found in both, files unique to each side.
Google SelectedFor each selected row, opens a Google search on the hash.

Right-click: Options

ItemAction
Set FontOpens frmSelectFont for the listview's font/size. Persisted.
Use SHA256Toggle. Switches the third column between MD5 and SHA256 and re-hashes the folder. Persisted.
KB/MB Sizes (Ctrl-M)Toggle. Switches the size column between raw bytes and human-readable (KB/MB).

Save Table

Top-level menu, not under Copy. Writes the same table that Copy → All produces to <parent>\<foldername>_hashs.txt, with a timestamp header.

Notes

See also