Stage 02 — Reverse Engineering Deep Dive
From RE of mpengine.dll v1.1.24120.x
The FRIENDLY_FILE check is the first filter after command dispatch. It computes the SHA-256 hash of the scanned file and checks it against a database of known-good hashes.
If the hash matches, the file is marked "friendly" and the entire remaining pipeline (stages 3-13) is bypassed.
This is a pure performance optimization: most OS files, Microsoft binaries, and common applications are in the database. Real-time protection resolves the majority of events here.
The friendly database is loaded from VDM signature files during MpBootStrap and compiled into a hash set for constant-time lookup.
Two VDM signature types carry the friendly-file hash database
0x10986BE4
Primary hash type. 32-byte SHA-256 digest per entry. Covers the vast majority of known-good files.
0x10986B74
Secondary hash type. 64-byte SHA-512 digest. Used for higher-assurance entries (e.g., critical system files).
0x10A4B284 (UTF-16LE)
Binary strings that control friendly-file behavior
0x1097ECFC — Master enable flag
0x1097ED0C — Cloud re-check on friendly match
0x109EB12C — Per-process friendly cache
0x109E49D8 — RTP process-level flag
0x10A64EC0 — Disable negative cache
0x10A6E080 — Cache category label
0x10A54570 — Network unfriendly flag
Properties written when a friendly match or suppression occurs
0x109E76A0
SHA hash of the matched friendly entry
0x109E7654
Signature sequence number of the match
0x109E76D4
Sequence as formatted string
0x109E1DDC
Was friendly status suppressed?
0x109E7988
Suppressed sig sequence number
0x109E2308
Reason code for friendly disposition
How the friendly system interacts with certificate trust verification
0x10A4C0C8 — "%ls is trusted - %hs"
0x10A4BF00 — "%ls is NOT trusted. Checking Trust? %d"
0x10A4BF50 — "%ls is a trusted file that might be an installer..."
0x10A53AC8 — "Detection supressed: %ls...file is trusted (count=%d)" [sic]
0x10A4BDB0 — "...not trusted, because the certificate is revoked"
0x10A4BB70 — "...not trusted, because the certificate is excluded"
0x10A666C0 — "BM detection suppressed due to friendlyness." [sic]
Embedded SQL schema at 0x10A5B4A0 reveals the hash cache structure
From scan request to friendly verdict or pipeline continuation
isfriendlyscan enabled? (@ 0x1097ECFC)When even known-good files must be fully scanned
When istriggercloudyfriendlyscan is set, the cloud service forces a full rescan of friendly files.
When a new signature explicitly targets a previously-friendly file, friendlysuppressed is set.
Behavior monitoring can suppress friendly status at runtime if suspicious activity is detected.
Why this is the first check in the pipeline
SHA-256 + hash set lookup. File is immediately classified as clean. All 11 remaining stages bypassed.
Full pipeline: 11 static engines, PE emulation, container extraction, script deob, BRUTE, Lua, AAGG, cloud.
SHA-256 and SHA-512 hashes from VDM sigs. O(1) lookup in compiled hash set. First filter in pipeline.
15+ attributes tracked: sigsha, sigseq, suppressed status, reason codes. Both UTF-16LE and ASCII variants.
Interacts with certificate verification. Trusted publishers can add friendly entries. Revoked certs force unfriendly.
If the file is not friendly, it proceeds to Stage 03: the 11-engine static signature cascade.
All addresses from RE of mpengine.dll v1.1.24120.x