A Windows PE demonstration shows that Thread Local Storage (TLS) callbacks execute during process initialization before the executable entry point and C main. MinGW-w64 callback pointers placed in .CRT$XLB and .CRT$XLBB invoke two callbacks in order, producing 12 when both return normally. The first example ran raw x64 MessageBox payload through EnumDesktopsA, but its thread-exit behavior could end the initializing thread before the second callback and main executed; a revised payload restored the stack and returned normally, allowing initialization to complete.
TLS callbacks are legitimate PE and runtime infrastructure, but they can conceal behavior from analysts who begin debugging only at main. Defenders should inspect the PE TLS directory and callback-address array, then assess the callback code and its execution effects rather than treating TLS callback presence alone as malicious. Because this code runs amid loader initialization, unsafe operations and synchronization can also cause deadlocks or crashes under the loader lock; Microsoft recommends deferring complex initialization outside loader-managed entry paths.

Get the actors, campaigns, and ATT&CK mapping behind it.
3 events from the most recent confirmed update back to the earliest known activity.
A revised hack3 TLS-callback example resolved MessageBoxA through GetModuleHandleA and GetProcAddress, passed it to a callback-compatible EnumDesktopsA payload, and returned normally after displaying its dialog. This allowed the second TLS callback and main to execute, unlike the earlier thread-exiting payload path.
A MinGW-w64 PE experiment registered two TLS callbacks in .CRT$XLB and .CRT$XLBB, demonstrating that they run on the initializing thread before the normal entry-point and C main path; when both return normally, their recorded order is 12. The material also showed that an initial raw payload invoked from a callback could exit the initializing thread and prevent later callback and main execution.
An educational Windows PE experiment showed two ways to add 16 MiB without changing a program's primary MessageBox behavior: an initialized .bloat section and a post-section overlay of repeated bytes. The material described structural, signature, entropy, and context-based checks for investigating such padding rather than treating file size as malicious by itself.
Vulnerabilities, threat actors, malware, products, organizations, and breaches Mallory has linked to this story.
Get the adversaries, campaigns, and ATT&CK mapping behind this technique, with detections ready to deploy.
4 references tracked. Mallory keeps watching after this page renders.
malware.news
Open sourcecocomelonc.github.io
Open sourcecocomelonc.github.io
Open sourcelearn.microsoft.com
Open sourceMap indicators from this story to your assets and identify affected systems in minutes.
Every observed campaign, victim, and pivot linked to actors named in this story.
Malware, exploits, and IOCs connected to the activity described here.
YARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Get matching new stories delivered to your team as they break — not the next morning.
Ask questions about this story and take action on the answers.