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

Increased PE symbols MAX_LENGTH limits #978

Merged
merged 1 commit into from
Jul 12, 2021

Conversation

HoundThe
Copy link
Member

Fixes #957

It seems there are 3 constants in the header:

  • IMPORT_LIBRARY_MAX_LENGTH
  • IMPORT_SYMBOL_MAX_LENGTH
  • COFF_SYMBOL_NAME_MAX_LENGTH

I was wondering why isn't there a constant for exported symbols. It seems that for exported symbols there is no "sanity" length cap, it's capped by the default max value of the read() function (which is used to read the string from the image) which is 65535. I haven't seen any other MAX length constants in the pelib headers.

Based on the example binary I've raised those 3 constants to 256.

@PeterMatula
Copy link
Collaborator

Merging this, but I think exports could/should be capped as well. What does @metthal think? We could create another issue for this...

@PeterMatula PeterMatula merged commit 27002fb into avast:master Jul 12, 2021
PeterMatula added a commit that referenced this pull request Jul 12, 2021
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.

Bump MAX_LENGTH constants in pelib to reflect what we see in the wild
2 participants