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

error too many directories #125

Open
wmmw123 opened this issue Jan 4, 2018 · 2 comments
Open

error too many directories #125

wmmw123 opened this issue Jan 4, 2018 · 2 comments

Comments

@wmmw123
Copy link

wmmw123 commented Jan 4, 2018

Hello.

If I run the file, an error occurs.

"error too many directories "

What's the reason?

Thanks.

@jweyrich
Copy link
Contributor

jweyrich commented Jan 4, 2018

The PE you're analyzing contains more than 16 directories. Most (or all) non-obscure compilers don't need more than 16 directories.

If you know how to compile pev, you may increase it in include/libpe/pe.h#L48.

We might want to increase it for the next version. Not sure if it makes sense to support the entire range supported by the 4 bytes of NumberOfRvaAndSizes though. That would be 65535 directories.

@GoGoOtaku
Copy link
Collaborator

This has been bugging me for months now and countless searching for a mythical valid PE file that somehow has more than 16 directories has not yielded anything.

Data directories are used by the windows loader and all have highly specific purposes. (e.g. Export, Imports, .NET stuff )
I frankly don't understand why an executable would even have more than 16 directories - the PE loader would not use it anyway. In fact the 16th directory is currently not even used for anything so it really doesn't even make real world sense to use more than 15.
The final nail in the coffin (pun not intended) for windows is that the NT headers define a maximum of 16 directories and afaik this has not changed.

Outside of windows only windows compatibles (ReactOS, Wine, PE LoadLibrary) and UEFI are using PE. The first ones obviously can't change anything and the second one should only differ in the subsystem.

So what I am trying to say: I don't get it and I really would like to see a PE file with more than 16 directories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants