Fix mz check again

This commit is contained in:
pancake 2017-09-04 23:51:09 +02:00
parent 7832ca7f94
commit 33da5069f3
2 changed files with 5 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* radare - LGPL - Copyright 2011-2015 - pancake */
/* radare - LGPL - Copyright 2011-2017 - pancake */
#include <r_egg.h>
#include <r_bin.h>
@ -243,8 +243,8 @@ int main(int argc, char **argv) {
{
char *p = strchr (optarg, '=');
if (p) {
*p = 0;
r_egg_option_set (egg, optarg, p + 1);
*p++ = 0;
r_egg_option_set (egg, optarg, p);
} else {
r_egg_option_set (egg, optarg, "true");
}

View File

@ -28,7 +28,8 @@ static bool checkEntrypoint(const ut8 *buf, ut64 length) {
// if (pa >= 0x20 && pa + 1 < length) {
pa &= 0xffff;
if (pa > 0x20 && pa + 1 < length) {
if (length > 0x104 && !memcmp (buf + 0x100, "PE", 2)) {
ut16 pe = r_read_ble16 (buf + 0x3c, false);
if (pe < length && length > 0x104 && !memcmp (buf + pe, "PE", 2)) {
return false;
}
return true;