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

Fix unordered streams parsing #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hexadite-virnik
Copy link

When parsing streams, we can't detect them by thier index, because the order not consistent. we should use sections' names only.

When parsing streams, we can't detect them by thier index, because the order not consistent. we should use sections' names only.
@snemes
Copy link
Contributor

snemes commented Jan 6, 2017

This change will unfortunately break compatiblity with some files (e.g. some Luminosity Link malware samples), see issue #9.

According to this blog post the metadata stream can either have the name "#~" or "#-" so we can probably replace the index based part (that was originally intended to fix it) with an added check for "#-":
https://codingwithspike.wordpress.com/2012/09/01/building-a-net-disassembler-part-4-reading-the-metadata-tables-in-the-stream/

E.g. you just need to replace if name == "#~": with if name in ("#~", "#-"): on lines 1412 and 1434.

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