-
Notifications
You must be signed in to change notification settings - Fork 156
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
Parsing fails when the TLS index is in the zeroed area of a section #411
Comments
I wonder if this might be a potential issue in more areas of the code. |
are you able to resolve this or know of a patch you could contribute that can fix the underlying issue? |
I've got a prototype patch ready, just need some time to polish it |
While processing DLLs from NVidia's graphics drivers I stumbled upon this file which failed to parse correctly. What happens at the point of error is the following:
0xdabe90
and the data section spans0x175000..0xdac178
so it should work, but it fails to find it instead and moves on to the other sections, ultimately failing because it can't find a section to which the address belongs toutils::find_offset()
fails even though the address falls within the section, is that it checks if the address falls between the beginning of the section and the beginning of the section plus the raw size, which is0x3800
in this case. So it checks whether the TLS index address size is between0x175000..0x178800
, which it isn't and thus fails.The expected behavior of this particular code should be that the TLS index is simply set to zero, since the address points to an area of memory which is set to zero.
This seems to make sense from a logical perspective, given that Microsoft documentations mentions that this area is populated by the loader, so the section won't contain the actual value until it's loaded. It thus makes sense for it to be in a zeroed area.
The text was updated successfully, but these errors were encountered: