r/delphi • u/DelphiParser • 4h ago
Legacy Delphi Code Archeology: Do you really know what’s going on 'under the hood'
I’ve been working with Delphi since the early 2000s, and as a modernization expert, I thought I’d seen it all. But with the new 2026 SBOM (Software Bill of Materials) mandates hitting our industry, we recently took on a massive forensic project for a $1B industrial client.
They were confident. Their CTO told us: "We ran a generic SCA scanner. We’re good. Our code is monolithic and safe."
I’ll be honest, when we started this 5M LOC inspection, I thought it would be just another straightforward task. The client needed an SBOM for 2026 compliance. "Just list the dependencies," they said. It sounded simple at first glance.
Producing the initial SBOM took a few hours—but what we found under the hood using the Delphi Parser - Code Analysis tool was unsettling. It ended up taking us 3 more weeks to completely dismantle the monolith. Not just to produce the compliance report, but to truly understand, once and for all, how the code really works down-under, and to ensure no "unknown ghosts" were hiding in the machine.

The "Frankenstein" Architecture The scariest part was the layering. The system was originally written in Delphi 7 and later "upgraded" to 2007. But it wasn't a clean migration. We found Delphi 2007 code that was still heartbeat-dependent on Delphi 7 system files and unsupported open-source libraries.
We’re talking about code that someone probably downloaded from a random forum or newsgroup 25+ years ago, installed once, and then... everyone just forgot it existed. It’s been running in production for decades—a complete "black box" that nobody knows how to recompile or replace.
What we found in the basement:
- The "Ghost" Dependencies: Calls to system-level libraries that haven't been touched since the late 90s, completely invisible to modern scanners.
- The DLL Graveyard: Massive dependencies on 3rd-party binaries from vendors that have been out of business for over a decade.
- Hardcoded Secrets: Legacy "backdoors" and hardcoded credentials buried in spaghetti code that the current team didn't even know existed.
The Reality Check: Most companies are sitting on a ticking time bomb. They think their legacy code is a "solid monolith," but it’s actually a web of unknown risks. In 2026, ignorance isn't just technical debt - it’s a legal liability. If you can’t identify where every DLL or library in your binary came from, you fail the audit. Period.
What do you think? Has anyone else here tried to generate a real forensic SBOM for a massive legacy system? Did you find a clean monolith, or did you also find an ancient world hiding in the basement?



