Delphi VCL Native Stub → .NET Metadata Loader
A delivery chain in which a Borland Delphi VCL native PE32 executable acts as a dropper/loader for an inner .NET Framework payload. The .NET assembly is stored without a standard MZ+PE header — only raw CIL bytecode and .NET metadata streams (BSJB, #~, #Strings, #US, #GUID, #Blob) — and is extracted, optionally XOR-decrypted, and launched via WinExec or CreateProcess by the Delphi stub.
Observed in this corpus
- Sample
0ce2a9be— Delphi VCL stub withDVCLAL/PACKAGEINFOresources andSOFTWARE\Borland\Delphi\RTLregistry string. Overlay at file offset0xA200contains raw .NET metadata for an AgentTesla infostealer. The stub callsFindFirstFileAto verify overlay size >0xA200, XOR-decrypts the overlay, writes it to a temp file withFILE_ATTRIBUTE_HIDDEN, and launches it viaWinExec. ^[/intel/analyses/0ce2a9bef251a42648a4ef198c4da7cb4c707b9635b13036d3d552fc87ac1566.html]
Identifying characteristics
| Indicator | Notes |
|---|---|
| Resources | .rsrc contains DVCLAL, PACKAGEINFO, MAINICON (Delphi VCL runtime signatures) |
| Strings | SOFTWARE\Borland\Delphi\RTL in .rdata or .data |
| Imports | kernel32.dll, user32.dll, advapi32.dll, oleaut32.dll — VCL runtime surface, no overt malicious imports |
| Overlay | Size > 100 KB; first bytes are CIL-like (0xd3 0x17 0x00 0x70 ...) rather than MZ or encrypted |
| .NET metadata | BSJB appears inside overlay, not preceded by a valid MZ+PE signature |
| Launch | WinExec or CreateProcess with a temp-path argument; SetFileAttributesA(FILE_ATTRIBUTE_HIDDEN) |
Why this matters
Static triage tools that look for embedded PEs (e.g., pefile, binwalk with PE signatures) will miss the payload because there is no standard PE header. The metadata is only discoverable by scanning for BSJB or by entropy analysis of the overlay region. The Delphi VCL runtime bloats the outer binary with harmless imports, making behavioural signatures noisy.
Detection ideas
- Overlay entropy +
BSJBscan: Any PE32 with an overlay > 50 KB that containsBSJBbut no precedingMZ+PEis suspicious. - Delphi VCL resource triage: Flag samples with
DVCLAL/PACKAGEINFOand a large overlay. - Dynamic: Monitor
WinExec/CreateProcessfrom processes with large Delphi module footprints spawning .NET child processes.
Related
- raw-dotnet-metadata-staging — concept page for headerless .NET payloads
- agenttesla — inner payload family observed in this chain
- delphi-vcl-certificate-harvesting — another Delphi VCL obfuscation pattern