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

Better support MSVC .libs by using NULL char terminators when detected #17

Merged
merged 1 commit into from
Jun 11, 2022

Conversation

alberthdev
Copy link
Contributor

MSVC likes to use NULL character terminators instead of
newlines (\n) for their listing, which causes parsing to not
work correctly, usually with this error:

arpy.ArchiveFormatError: file references a name not present in the index

This is fixed by detecting NULL character usage and
using that delimiter accordingly.

Addresses: #16

Some very helpful inspiration that led to figuring this out:

MSVC likes to use NULL character terminators instead of
newlines (\n) for their listing, which causes parsing to not
work correctly, usually with this error:

    arpy.ArchiveFormatError: file references a name not present in the index

This is fixed by detecting NULL character usage and
using that delimiter accordingly.

Some very helpful inspiration that led to figuring this out:
 * https://www.winehq.org/pipermail/wine-patches/2013-April/123863.html (winedump/lib.c)
 * https://substrate.dev/rustdocs/latest/object/pe/
 * http://hmelnov.icc.ru/geos/scripts/WWWBinV.dll/ShowR?COFF_LIB.rfi
 * http://www.textfiles.com/programming/FORMATS/lib.txt
 * https://www.ntcore.com/files/richsign.htm
 * http://bytepointer.com/resources/pietrek_lib_file_format.htm
@sonarcloud
Copy link

sonarcloud bot commented Oct 4, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@viraptor
Copy link
Owner

Could you send some minimal file for tests as well, please?
Thanks for the patch!

@viraptor
Copy link
Owner

nvm, found one in the issue.

@viraptor viraptor merged commit 7a58163 into viraptor:master Jun 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants