Abstract:Third-party libraries (TPLs) are widely used in software development but also introduce risks such as security vulnerabilities and license conflicts. In response, software composition analysis (SCA) has emerged to help developers detect security vulnerabilities, outdated patches, and license compliance issues by identifying and analyzing open-source components and their dependencies, thereby ensuring the security of software supply chains. However, existing SCA techniques in the C/C++ domain face three major limitations: a lack of comprehensive TPL feature libraries, difficulty in detecting library-granularity reuse, and insufficient capability to analyze TPL dependencies. To address these limitations, a SCA technique for C/C++ source code—CAnalyzer—is proposed for software library-granularity reuse detection scenarios. By integrating data from 15 platforms, CAnalyzer builds a feature database containing 33100 TPLs with 30047290 functions. Meanwhile, the precision of TPL detection is significantly improved through feature database preprocessing and a multi-threshold matching strategy. Additionally, CAnalyzer analyzes dependency directives in the source code to automatically construct dependencies among TPLs. Experimental results show that CAnalyzer achieves a precision of 90.63% and a recall of 86.57% in TPL detection, outperforming CENTRIS, TPLite, and OSSFP in both metrics. In TPL dependency detection, CAnalyzer achieves a recall of 94.79% and a precision of 98.99%. Currently, CAnalyzer has been adopted by the OpenHarmony community and has identified 166 external components across 689 code repositories, demonstrating its practical value in open-source community management.