-
Notifications
You must be signed in to change notification settings - Fork 563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[olevba] can't concat str to bytes #455
Comments
Any progress on this? We rely on
sample.zip (password |
two problems here:
i think the last problem means, that any compressed vba code will trigger the concat error in python3. a patch is here: a similar solution is given in i will add a pull request later today. |
Pull request: |
@0xcpu you reported this bug a long time ago, but would it be possible to share the sample that triggered it? You can upload it here in a zip with password infected, for example. Or upload it to an online sandbox that allows downloads, such as app.any.run or hybrid-analysis.com. |
Hey @decalage2, sure. Here's the sample, password: |
OK, it took me a while to find the root cause of this issue, which is common to issues #455, #477, #587, #593. Here's a quick summary.
The bug happens when the parsing of the VBA project streams fails (for different reasons):
So I fixed olevba so that VBA source code is always returned as Unicode on Python 3, and the exception "can't concat str to bytes" does not appear anymore. This is not perfect, because we have no way to know the code page used to encode the VBA source code, when the VBA project cannot be parsed. So for now I'm just using code page 1252, which should work in most cases but not always. |
…ge2#593), fixed detect_vba_macros to always return VBA code as unicode on Python 3 (issues decalage2#455, decalage2#477, decalage2#587, decalage2#593)
This issue is now fixed in oletools 0.56. |
Affected tool:
olevba
Describe the bug
Unable to process VBA code
File/Malware sample to reproduce the bug
fe572d860bd5523170e27cb24b5ee09c97c826046acaa08175d41035fbb019e8
How To Reproduce the bug
olevba3 -c fe572d860bd5523170e27cb24b5ee09c97c826046acaa08175d41035fbb019e8
Console output / Screenshots
Version information:
Linux
18.04- 64 bits
3.6 - 64 bits
olevba 0.55.dev2
The text was updated successfully, but these errors were encountered: