Skip to content

Instantly share code, notes, and snippets.

@TheEnergyStory
TheEnergyStory / CustomMixedModeDLL.cpp
Created November 10, 2026 17:20
Turla CerealLoader-Style Custom Mixed-Mode DLL POC
/**
* This POC replicates the custom mixed-mode technique utilized by Turla’s CerealLoader.
* Reference: https://www.welivesecurity.com/en/eset-research/exchange-for-breakfast-turlas-cereal-tricks-are-not-for-kids/
*
* While classic mixed-mode binaries rely on standard CRT defaults and standard compiler
* initialization, this code splits functionality explicitly between managed and unmanaged
* domains using "#pragma managed" and "#pragma unmanaged" pragmas within the same source.
*
* Key Mechanics & PE-Level Behavior:
* 1. Loader Lock Avoidance: Bypasses standard "_CorDllMain" PE initialization