This repository has been archived by the owner on Apr 20, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This looks bigger than it actually is. From what I can tell I have now fixed every memory leak in pev. At least with my test executable (putty.exe). None of them were major obviously but better have them fixed.
I also fixed all warnings GCC gave me (except for libudis86 stuff).
The reason why I put
pe_ctx_t
andpe_resources_t
into their own headers is because redefinition of typedefs is technically a C11 feature. This lead to a warning every timepe.h
was used.Another warning I fixed is harder to explain because it is platform specific: In
hashes.c
IMAGE_ORDINAL_FLAG64
was used as a macro with theUL
postfix aka unsigned long. This was then (rightfully) fed into PRIu64 which is a macro to print a 64 bit integer based on the current system. This works fine under windows as under Windows anuint64_t
is extended tounsigned long int
. Under Linux however it extents tounsigned long long int
. Technically both are 64 bit under Linux but it still gives a Wformat warning (I don't make the rules). Thus I have changed the macro into astatic const uint64_t
. This is more in line with what we want (specifically an unsigned 64 bit integer), it's more platform independent and as a side effect it's also more debugger friendly. The cast touint64_t
of the logic and result is for the same reason but should have no effect on the actual compiled library.The rest of the warnings are more self explanatory.