Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/e9patch/e9CFR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ void targetAnalysis(Binary *B)
uint8_t modRM = data[j+2];
uint8_t mod = (modRM & 0xc0) >> 6;
uint8_t rm = modRM & 0x7;
if (mod != 0x00 && rm != 0x05)
if (mod != 0x00 || rm != 0x05)
continue;
target = j + 7 + *(int32_t *)(data + j + 3);
if (target >= 0 && target % sizeof(int32_t) == 0)
Expand Down
4 changes: 2 additions & 2 deletions src/e9tool/e9frontend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ ELF *e9tool::parseELF(const char *filename, intptr_t base)
strerror(errno));

size_t size = (size_t)stat.st_size;
void *ptr = mmap(NULL, size, MAP_SHARED, PROT_READ, fd, 0);
void *ptr = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);
if (ptr == MAP_FAILED)
error("failed to map file \"%s\" into memory: %s", filename,
strerror(errno));
Expand Down Expand Up @@ -1355,7 +1355,7 @@ ELF *e9tool::parsePE(const char *filename)
strerror(errno));

size_t size = (size_t)stat.st_size;
void *ptr = mmap(NULL, size, MAP_SHARED, PROT_READ, fd, 0);
void *ptr = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);
if (ptr == MAP_FAILED)
error("failed to map file \"%s\" into memory: %s", filename,
strerror(errno));
Expand Down