Skip to content

get_file_name() reads length incorrectly #3

@jameyblakely

Description

@jameyblakely

While the length does begin at the 5th byte, I believe it is encoded as an unsigned LEB128 number. Which means for name lengths less than 128, reading one byte will work fine, but anything with a name length of 128 or more will require reading more than 1 byte to get the length.

You can find information on LEB128 numbers here in section 7.6, page 139.

I'm not a Python guy so I can't give you a code fix, but you can find the pseudo-code for decoding an unsigned LEB128 in Figure 46 of Appendix C, page 186.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions