Manifest Integrity Verifier
A common pattern for any tool that ships or downloads a bundle of data files (symbol lists, calibration tables, exported history) is to trust that the files are still exactly what they were when the bundle was built. This library replaces that assumption with an actual check: every file gets a genuine FNV-1a 32-bit checksum computed over its full byte content, plus a line/row count, and both are compared against a manifest recorded earlier. FNV-1a is not a cryptographic hash and makes no collision-resistance claim - it is the right tool here because the threat model is accidental corruption or an incomplete transfer, not a deliberate adversary. A same-size file with even one byte changed produces a different checksum, which a size-only or filename-only check would miss entirely. The manifest itself is a plain CSV (filename, hash, rows) that this library both writes (SnapshotEntry + SaveManifestCsv, from a known- good state) and reads back (LoadManifestCsv), so the same library covers building the baseline and checking against it later - the demo runs both halves in one pass, then deliberately tampers with a file and deletes another to show the mismatch and missing-file reports. MQL4 file I/O is sandboxed to MQL4\Files\ (or MQL5\Files\ on the native MQL5 build) - every file name used by this library is relative to that folder, the same restriction any MQL4 program lives under. Notes and limitations - FNV-1a is a checksum, not a cryptographic hash. It detects accidental corruption and incomplete transfers reliably; it is not a defence against a deliberate, hash-aware tamperer. - All file names are relative to MQL4\Files\ (or MQL5\Files\ on the native MQL5 build) (or MQL4\Files\ (or MQL5\Files\ on the native MQL5 build)Common\ if you extend this to use FILE_COMMON) - MQL4 cannot read or hash files outside its sandbox, including the terminal's own history folder. - Row count is a text-line count (FileReadString until end-of-file), which assumes the file is genuinely line-oriented text. A binary file's "row count" from this library is meaningless and should be ignored - the hash check alone is what matters for binary payloads. - HashFile() reopens the file for the row-count pass rather than trying to derive line breaks from the binary read - two short sequential passes, simple and correct, at the cost of reading the file twice.
Script · MT4 · v1.0 · Free
About Manifest Integrity Verifier
Manifest Integrity Verifier is a script for MetaTrader 4. It has 1 setting, such as Manifest name. MQL source code included.
Files in the download: ManifestIntegrityVerifier.mqh, ManifestIntegrityVerifier.txt, ManifestIntegrityVerifierDemo.mq4.
Settings
| Setting | Default | What it does |
|---|---|---|
| Manifest name | miv_demo_manifest.csv | manifest file name inside MQL4\Files |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Scripts.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the script onto a chart to run it once.
Tags: MT4 Script · MQL4 Source Code