PricingDownload
Product

Platform

All features48 capabilities, from IDE to CICompliance KitsISO 26262, DO-178C, IEC 62304...AI GovernanceControl AI-generated C/C++ codeWhat’s new in 2027Latest version highlightsScreenshotsSee the product in action

Analyze & improve

Coding standardsMISRA, CERT, CWE, AUTOSARArchitecture & dependenciesGraphs, matrix, cyclesSBOM & dependenciesIs our C++ code affected? Minutes, not weeksTechnical debtMeasured in hours and dollarsQuality gatesStop regressions in CISmart Code CityYour codebase in 3D

Integrations

IDE pluginsVisual Studio, VS Code, CLion...CI/CD pipelinesJenkins, Azure DevOps, GitHub, GitLabSonarQube pluginC/C++ results in SonarQubeExternal analyzersClang-Tidy, Cppcheck, coverageFeature on Demand
Solutions

By need

Functional safetyCompliance kits per standardCoding standardsMISRA, CERT, AUTOSAR, ISO...Legacy modernizationRefactor large C/C++ safelyCode auditExpert review of your codebaseM&A due diligenceAssess technical health fast

By role

DevelopersSoftware architectsTech leadsDevOps engineersEngineering managersProject managers

CTOsCIOs / IT leadersQA engineersSecurity leadersComplianceConsultantsRequest a guided PoC
Industries

Safety-critical

AutomotiveISO 26262, MISRA, AUTOSARAerospace & DefenseDO-178C programsMedical DevicesIEC 62304 softwareEnergy & UtilitiesIEC 61508 systemsEmbedded SystemsFirmware and devices

Enterprise

Financial ServicesTrading and paymentsGame DevelopmentEngines and large C++Software VendorsCommercial C/C++ productsGovernmentAgencies and contractorsAll industries & case studies
Resources

Learn

DocumentationGuides, rules and CI setupKnowledge baseFrequently asked questionsBlogC and C++ code quality articlesRelease notesEvery version since 2009

Customers

Case studiesSuccess storiesTestimonialsWhat users sayOur customersCompanies using CppDependGold Code QualityOpen source projects we rate

Programs & company

Feature on DemandMissing features built for freeFree for open sourceLicenses for OSS and studentsContact usSales and supportEULALicense agreement
Docs
Documentation

Design and Architecture

Binary checks

Security hardening, third-party libraries and dangerous imports of your compiled ELF and PE files.

8 min readDesign and ArchitectureCppDepend 2027

Overview

Binary Insights reads the compiled program, not the source. It answers the questions an attacker asks first: is the file protected against memory-corruption exploits, which third-party libraries are inside it, which dangerous functions does it import, and does it contain secrets or weak cryptography.

It works on ELF (Linux, embedded) and PE (Windows) files: executables, shared libraries (.so, .dll) and firmware images. Managed .NET assemblies are only checked for signature. Mach-O is not supported yet.

Nothing is executed. The files are parsed and their strings are scanned; the values of secrets are never stored, only where they were found.

Quick start

  1. Open Settings > Binary Analysis.
  2. Press Add a file... or Add a folder... and choose the executables and libraries you ship. A folder is scanned for binaries.
  3. Leave Analyse the binaries when the analysis runs on and run the analysis.
  4. Open Binary Insights > Binary Overview to read the result.

Settings

Page Settings > Binary Analysis. Saved in the project file (.cdproj), element BinarySettings.

SettingDefaultEffect
Analyse the binaries when the analysis runsOnSwitches the whole check on or off (attribute Enabled).
Report issuesOnEach failed check becomes an issue of the tool Binary (attribute ReportIssues). Switch off to keep only the page.
Binary filesemptyFiles to analyse (Files / File).
Binary foldersemptyFolders to scan for ELF and PE files (Folders / Folder).

What is checked

Hardening

For every file the page shows a matrix of protections. A green cell means the protection is present, a red one that it is missing, a grey one that it does not apply to this format.

ProtectionFormatsWhy it matters
ASLR / PIE, high-entropy ASLRELF, PEThe program is loaded at a random address, so exploits cannot rely on fixed addresses.
NX / DEPELF, PEData and the stack cannot be executed.
Stack protector (canary)ELF, PE (/GS)A stack overflow is detected before the function returns.
RELRO (full)ELFThe global offset table is read-only after start-up.
Control Flow Guard, CET / BTIPE, ELFIndirect calls and returns are validated.
SafeSEHPE 32-bitProtects the exception handler chain.
Text relocations, embedded library path (RPATH/RUNPATH)ELFCode patched at load time; library search path inside the file.
Writable and executable memoryELF, PEMemory where injected code could run.
Packed or encrypted codeELF, PEHigh-entropy sections typical of packers.

Content

  • Third-party components: the version banner of well-known libraries, compared with maintained versions (see below).
  • Unsafe imports: functions with a safer replacement (gets, strcpy, strcat, sprintf, vsprintf, wcscpy, lstrcpy, mktemp, tmpnam, scanf, system...). The severity depends on the function.
  • Hard-coded secrets: keys, tokens and passwords found in the strings. Only the kind and place are kept, never the value.
  • Weak cryptography: references to MD5, SHA-1, DES, RC4, RC2, ECB mode, SSLv2/v3, TLS 1.0 and predictable random generators. The page shows whether a strong crypto library is present as well.
  • Risky Windows API: combinations of process injection, remote-thread creation, file download, debug privilege and Run-key APIs, with anti-debug and downloader groups.
  • Unsafe DLL search order: LoadLibrary with a bare name, which searches the current folder.
Risky Windows API and weak cryptography are indicators, not proof: debuggers, installers and TLS clients legitimately use them. Read each finding before acting.

Libraries recognised inside a binary

The version is read from the banner each library embeds, or from the name of the shared library it ships as.

LibraryFound from
OpenSSLOpenSSL 1.1.1k banner
zlibdeflate / inflate copyright line
libpnglibpng version
libcurllibcurl/x.y.z
SQLiteversion and timestamp string
expatexpat_x.y.z
mbed TLSmbed TLS x.y.z
libssh2libssh2_x.y.z
libtiffLIBTIFF, Version
bzip2Version 1.0.x, date
Boostlibboost_*.so.x.y.z or boost_*-vc* names
QtlibQt5Core.so.x.y.z / Qt6
ICUlibicuuc.so.x.y
Lua$LuaVersion / copyright line

These components are the ones passed to Vulnerability checks.

Rules and how to fix

Each finding is an issue with a rule id. Severity can be raised or lowered by the cell state (for example RELRO is Medium when missing and Low when partial).

RuleSeverityWhat it meansHow to fix
BIN-ASLR-01MediumNo ASLR / PIE
The program is loaded at a fixed address, so an attacker knows where the code is and exploits become reliable.
GCC/Clang: compile with -fPIE and link executables with -pie (-fPIC for shared libraries). MSVC: link with /DYNAMICBASE. Then rebuild every object, not only the final link.
BIN-ASLR-02LowNo high-entropy ASLR
On 64-bit Windows a small random range makes the address easier to guess.
MSVC: link with /HIGHENTROPYVA together with /DYNAMICBASE (the image must not need addresses below 4 GB).
BIN-DEP-01HighNo NX / DEP
Data and the stack can be executed, so injected code runs directly.
Linux: remove -z execstack and give every assembly file a .note.GNU-stack section (.section .note.GNU-stack,"",@progbits). Windows: link with /NXCOMPAT.
BIN-STACK-01MediumNo stack protector
A stack buffer overflow can overwrite the return address without being detected.
GCC/Clang: -fstack-protector-strong. MSVC: /GS (on by default: check that no file is compiled with /GS-).
BIN-RELRO-01MediumRELRO is not full
The global offset table stays writable, so a memory bug can redirect function calls.
Link with -Wl,-z,relro,-z,now (full RELRO).
BIN-CFG-01LowNo Control Flow Guard
Indirect calls are not validated, so a corrupted function pointer can jump anywhere.
MSVC: compile with /guard:cf and link with /GUARD:CF.
BIN-SEH-01LowNo SafeSEH
A corrupted exception handler chain can be used to take control (32-bit).
MSVC: link with /SAFESEH, or build with only DYNAMICBASE and no SEH handlers outside the image.
BIN-TEXTREL-01MediumText relocations
The code is patched at load time: it cannot be shared and the code pages must be writable.
Build all objects with -fPIC, and replace absolute addresses in assembly with PC-relative ones.
BIN-RPATH-01LowEmbedded library path
A library search path inside the binary can load a planted library from a writable folder.
Remove -rpath / RUNPATH, or use $ORIGIN with a folder only the installer can write.
BIN-CRYPTO-01MediumWeak cryptography
Broken or obsolete algorithms (MD5, SHA-1, DES, RC4, ECB mode, SSLv3, TLS 1.0) let an attacker forge data, read protected data or downgrade a connection; predictable random numbers (rand) make keys and tokens guessable.
Use SHA-256 or SHA-3 for hashes, AES-GCM or ChaCha20-Poly1305 for encryption, TLS 1.2 or 1.3 only, and a cryptographic random source (getrandom, /dev/urandom, BCryptGenRandom, RAND_bytes) for anything secret. If the algorithm is only needed to read old data, keep it out of new data and document it.
BIN-WINAPI-01MediumRisky Windows API
Process injection, file download, debug privilege or Run-key APIs are the building blocks of malware and of post-exploitation tools. Legitimate programs (debuggers, installers, updaters, security software) use them too, so this is a question to answer, not always a bug.
Confirm each use is intended. Remove injection APIs from normal applications, download over HTTPS and verify a signature before running anything, request privileges only when needed, and keep persistence under user control.
BIN-DLLSEARCH-01MediumUnsafe DLL search order
LoadLibrary with a bare name searches several folders, including the current one. An attacker who can drop a DLL there gets code execution, and with administrator rights if the program runs elevated.
Call SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_DEFAULT_DIRS) at start-up, load with full paths or LOAD_LIBRARY_SEARCH_SYSTEM32, link with /DEPENDENTLOADFLAG:0x800, and never run elevated from a user-writable folder.
BIN-UNSAFE-01HighUnsafe functions
These functions do not check the size of the destination, a classic source of buffer overflows and command injection.
Replace each function by its bounded version (see the list).
BIN-WX-01MediumWritable and executable memory
Memory that can be written and executed is where injected code runs.
Separate code and data in the linker script (no RWX region), do not link with -N / --omagic, and avoid self-modifying code or JIT pages that stay writable.
BIN-PACK-01MediumPacked or encrypted code
A code section with a random-looking content is typical of a packer or an encrypted payload, and hides what the program does.
Check that the build is the one you expect (compare with a clean build). If a protector is intended, document it and accept the finding.
BIN-CET-01LowNo CET / BTI protection
Without shadow stack and branch tracking, return-oriented attacks are easier.
x86: -fcf-protection=full. AArch64: -mbranch-protection=standard. Windows: link with /CETCOMPAT.
BIN-SECRET-01HighHard-coded secret
A key or password inside the file is readable by anyone who has the binary.
Remove it from the source, revoke and rotate the exposed secret now, and load secrets at run time from the environment or a secret store.
BIN-COMP-01MediumOutdated third-party component
The version string of a library shows a release with known vulnerabilities or without support.
Upgrade the library to a maintained version, rebuild, and confirm the result in Dependencies & SBOM.

Where to see results

  • Binary Insights > Binary Overview: summary, hardening matrix per file, libraries, unsafe imports, secrets, weak cryptography, risky APIs and the fix for each rule.
  • Issues: the tool name is Binary; they follow the usual issue filters and baseline.
  • File on disk: <analysis result>.binary.json, next to the analysis result (plain JSON, read by the page).

How it works

During the analysis each listed file is opened read-only and parsed (ELF headers, program and dynamic sections, PE optional header, DLL characteristics, imports, sections). The printable strings are scanned once for banners, secrets, crypto names and API names; the results are written to the sidecar file and, if Report issues is on, appended to the issue list. The page only reads the sidecar, so it opens instantly and works without the binaries present.

Limits

  • Mach-O files are not analysed. .NET assemblies: signature only.
  • Banners must be present in the file; a stripped or custom-built library may not be recognised.
  • String-based checks can report false positives (a string that mentions an algorithm without using it).
  • The tool reports what is in the files you list; it does not know how they were built or deployed.

Questions

The page is empty.

No file or folder is set in Settings > Binary Analysis, the feature is switched off, or the analysis was not run after the change.

A rule is a false alarm for my product.

Switch Report issues off for the project to keep only the page, or use the usual issue suppression. Rules cannot be switched off one by one.

Does it need the sources?

No. Only the compiled files.

Was this page helpful?
Evaluating CppDepend on a production codebase?Get a guided proof of concept with our static analysis architects.
Request a PoC