Closed samspoerl closed 5 months ago
I have observed this behavior as well and was quite confused, but I think the underlying issue must be some recent change in the way Excel writes the vbaproject.bin file. I had an old version of a .xlsm workbook on which I had been periodically running extract_vba without issue (where .bas and .cls files get created), then at some point the created files were missing their extensions. To confirm, I took an older copy of the document which when fed to extract_vba still generates .cls/.bas files, made a trivial change and resaved, and then extract_vba generated files with no extensions.
Fixed by PR #723
Affected tool: olevba
Describe the bug I'm trying to extract all the VBA code from an xlsm file. I'm initializing a
VBA_Parser
object then calling theextract_all_macros()
method. When I iterate through the returned tuples, thevba_filename
values are missing file extensions. The behavior is inconsistent as sometimes the file extensions are there (e.g.,.bas
or.cls
), and sometimes they're not. The attached sample did not have them for me.File/Malware sample to reproduce the bug olevba_bug_no_vba_file_extensions.zip password: sample
How To Reproduce the bug
Expected behavior For the
vba_filename
values returned fromextract_all_macros()
to have their original file extensions (e.g.,.bas
or.cls
).Console output / Screenshots
Version information:
Additional context N/A