fix: add .bpl file extension support to PE/DLL cataloger (closes #4664) (#4688)

Borland Package Library (.bpl) files are standard Windows PE/DLL files
used in Delphi and C++Builder ecosystems. This adds the .bpl glob
pattern to the PE file discovery so these files are cataloged alongside
.dll and .exe files.
This commit is contained in:
sputnik-mac 2026-06-29 21:17:52 +07:00 committed by GitHub
parent b15c5dbfe2
commit 1143c12a97
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 1 deletions

View File

@ -32,6 +32,7 @@ func TestCataloger_Globs(t *testing.T) {
fixture: "testdata/glob-paths",
cataloger: NewDotnetPortableExecutableCataloger(),
expected: []string{
"src/something.bpl",
"src/something.dll",
"src/something.exe",
},
@ -41,6 +42,7 @@ func TestCataloger_Globs(t *testing.T) {
fixture: "testdata/glob-paths",
cataloger: NewDotnetDepsBinaryCataloger(DefaultCatalogerConfig()),
expected: []string{
"src/something.bpl",
"src/something.deps.json",
"src/something.dll",
"src/something.exe",

View File

@ -23,6 +23,7 @@ const (
depsJSONGlob = "**/*.deps.json"
dllGlob = "**/*.dll"
exeGlob = "**/*.exe"
bplGlob = "**/*.bpl"
)
// depsBinaryCataloger will search for both deps.json evidence and PE file evidence to create packages. All packages
@ -472,7 +473,7 @@ func readDepsJSON(resolver file.Resolver, loc file.Location) (*depsJSON, error)
// findPEFiles locates and parses all PE files (dll/exe).
func findPEFiles(resolver file.Resolver) ([]logicalPE, error, error) {
peLocs, err := resolver.FilesByGlob(dllGlob, exeGlob)
peLocs, err := resolver.FilesByGlob(dllGlob, exeGlob, bplGlob)
if err != nil {
return nil, nil, fmt.Errorf("unable to find PE files: %w", err)
}