decalage2/oletools

Make VBA Tools->References Information available

AndrewJLockhart opened this issue · 2 comments

I am writing a command line tool that uses olevba.py. And need to dump out the information about the Tools->References.
The current currently reads this but doesn't make it accessible.

Indeed olevba parses references (in VBA_Project.__init__) but does not store and expose the data through the API. For now the only way to get it is to use the option -l debug on the command line, and to filter lines mentioning "reference". For example:

$ olevba order_details_68671777.doc -l debug|grep -i "reference"
DEBUG    reference type = 0016
DEBUG    REFERENCE name: stdole
DEBUG    reference type = 000D
DEBUG    REFERENCE registered lib id: *\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\Windows\system32\stdole2.tlb#OLE Automation
DEBUG    reference type = 0016
DEBUG    REFERENCE name: Normal
DEBUG    reference type = 000E
DEBUG    REFERENCE project lib id absolute: *\CNormal
DEBUG    REFERENCE project lib id relative: *\CNormal
DEBUG    reference type = 0016
DEBUG    REFERENCE name: Office
DEBUG    reference type = 000D
DEBUG    REFERENCE registered lib id: *\G{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}#2.0#0#C:\Program Files\Common Files\Microsoft Shared\OFFICE11\MSO.DLL#Microsoft Office 11.0 Object Library
DEBUG    reference type = 0016
DEBUG    REFERENCE name: MSForms
DEBUG    reference type = 0033
DEBUG    REFERENCE original lib id: *\G{0D452EE1-E08F-101A-852E-02608C4D0BB4}#2.0#0#C:\WINDOWS\system32\FM20.DLL#Microsoft Forms 2.0 Object Library
DEBUG    reference type = 002F
DEBUG    REFERENCE control twiddled lib id: *\G{00000000-0000-0000-0000-000000000000}#0.0#0##
DEBUG    reference type = 000F

It would be possible to make that data available to the API, but that requires some work.

Just out of curiosity, what is your tool going to do with those references?