Skip to content
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

Strange Project Information Record #700

Closed
Ikari33 opened this issue Jul 5, 2021 · 5 comments
Closed

Strange Project Information Record #700

Ikari33 opened this issue Jul 5, 2021 · 5 comments
Assignees
Milestone

Comments

@Ikari33
Copy link

Ikari33 commented Jul 5, 2021

Affected tool:
olevba

Describe the bug
I am using olevba to simply export VBA scripts to readable files. It worked smooth until now, but since last week the export lost the file extensions.
image

I found out that there is additional information inside the bytestring. I couldn't find any information in MS docs about this ID. So I have created a workaround to filter these segment.
image

How To Reproduce the bug
Untouched Excel Files (saved in the past) work normal. In the moment I open and save the file without any changes the problem occurs.

Expected behavior
A clear and concise description of what you expected to happen.

Console output / Screenshots
Here is my simple workaround to keep it running for the moment.
image

Version information:

  • OS: Windows 10 Enterprise
  • OS version: 1909 - 64 bits
  • Excel version: O365 Version 2106 (Build 14131.20278)
  • Python version: 3.7.6 / 64 bits
  • oletools version: 0.58
@decalage2 decalage2 self-assigned this Jul 6, 2021
@decalage2 decalage2 added this to the oletools 0.60 milestone Jul 6, 2021
@mikes-gh
Copy link

mikes-gh commented Aug 4, 2021

I have just hit this bug too.
To save someone typing out at line 1722

        # Temp Fix
        id_temp = struct.unpack("<H", dir_stream.read(2))[0]
        if id_temp == 0x004A:
            size_temp = struct.unpack("<L", dir_stream.read(4))[0]
            value_temp = struct.unpack("<L", dir_stream.read(size_temp))[0]
            id_temp = struct.unpack("<H", dir_stream.read(2))[0]

        # PROJECTLCID Record
        # Specifies the VBA project's LCID.
        projectlcid_id = id_temp
        # projectlcid_id = struct.unpack("<H", dir_stream.read(2))[0]

@mikes-gh
Copy link

mikes-gh commented Aug 4, 2021

BTW this is not in 0.60 milestone

@mikes-gh
Copy link

@decalage2 Can I PR this fix? I know we are not sure why the file format has changed for new saves and what the new bytes represent but it does fix the real problem of losing the file extension information.

@decalage2
Copy link
Owner

Should now be fixed with PR #723

@mikes-gh
Copy link

Thanks @decalage2 I'm not using the tool for any projects ATM so I can't confirm but good to know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants