Get list of required BPLs for a given DLL, EXE or BPL
Asked Answered
J

3

8

I'm wondering if anyone knows of an elegant way of determining what BPLs are required by a given (compiled) DLL, EXE or BPL.

I'm not sure if this is even possible shy of simply scanning the binary for text references to .bpl filenames (which would be prone to possible false-positives).

Ideally I'd like to return a TStringList or even a comma-separated String containing the names of all required .bpl files.

Jeunesse answered 4/6, 2012 at 20:8 Comment(5)
peganza.com/#PAL does this kind of thing on source, but I don't think it reads .exe, etc. You might check though.Uvulitis
Not even the IDE does a reliable job of this or we wouldn't get "Unable to load X.BPL" when Y.BPL has already implicitly background-loaded that BPL without the IDE having any clue of that thing loading. I really would like to know this too.Overexcite
"DUMPBIN /imports" can do it perfectly reliably, so it is certainly possible. However piping the output back into your program does not meet your criterion of elegance.Frazzled
You can try reading the Import address Tableof the PE file, but it only will show the load-time dependencies; AFAIK it is not possible to know every run-time dependency without disassembling or executing the application, if the application is running you can use the CreateToolhelp32Snapshot function with the TH32CS_SNAPMODULE flag.Acentric
You could recursively do a dumpbin /imports on every dependant DLL/BPL too, to get a complete recursive list, I guess.Overexcite
B
2

For packages you can use the requires section of the PACKAGEINFO resource - see TJclPePackageInfo.

Bilharziasis answered 5/6, 2012 at 0:57 Comment(2)
This works relatively well for compiled BPLs... I was hoping someone would know of a similar solution for DLLs and EXEs, but apparently not.Jeunesse
I'll accept your answer since it gets me at least part-way there.Jeunesse
P
0

I came across this from felix-cobri - its a little rough round the edges but does what I need and that is to list all the DLLS that my exe (or DLL) uses.

http://www.felix-colibri.com/papers/colibri_utilities/exe_dll_pe_explorer/exe_dll_pe_explorer.html

Good luck

Panier answered 16/11, 2012 at 15:41 Comment(0)
B
0

GExperts' PE Information tool displays the list of bpls and dlls that are implicit loaded into any .exe, .dll or .bpl

Bertero answered 5/2, 2013 at 14:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.