-
Notifications
You must be signed in to change notification settings - Fork 130
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
readpe crashed when I use -e #166
Comments
I haven't checked the code, but I suspect this is related to merces/libpe@5737a97 and merces/libpe#34. |
I suspect this segmentation fault is happening because:
https://github.com/merces/libpe/blob/5f44724e8fcdebf8a6b9fd009543c9dcfae4ea32/exports.c#L93-L98 Then, according to the above snippet,
https://github.com/merces/pev/blob/072085d5e656915f3e6c3107189233b4052a988b/src/readpe.c#L792-L794 The segmentation fault occurs when |
How should the error be handled? Should errors in the https://github.com/merces/pev/blob/072085d5e656915f3e6c3107189233b4052a988b/src/readpe.c#L878-L891 |
Hi @saullocarvalho and @i0gan . Thanks for raising this issue. I believe we should print a warn to the user. This could be done in the Thanks. |
Another thing came to mind here.. we can also set a limit for, let's say 65535 exported functions. I can't imagine a valid PE with such a huge number of functions to be honest. |
The issue here is in libpe. if (rva == 0 || ctx->pe.sections == NULL)
return 0;
[...]
// This is impossible to reach
return rva; // PE with no sections, return RVA pe.sections is always NULL when there are no sections as this is the code that allocates it: if (ctx->pe.num_sections > 0) {
ctx->pe.sections = malloc(ctx->pe.num_sections
* sizeof(IMAGE_SECTION_HEADER *)); This causes This doesn't really happen outside of artificial executables like this since virtually every executable will at least have a |
readpe crashed when I use -e
Describe the bug*
In readpe newst version, Analysing abnormal test.exe will crash this program, And the version 0.70 can modify the RIP regester.
The test.exe download: https://github.com/I0gan/files/raw/main/pev/test.exe
version 0.70 test:
I use gdb to debugger this program,the rip regester can be set as 0
In newst verion:
test
The text was updated successfully, but these errors were encountered: