DT_FLAGS_1 are bitfields not a plain value, fixes full relro detection

This commit is contained in:
pancake 2017-06-29 16:01:07 +02:00
parent 3ee2bd5ede
commit 9be31cfd9c
2 changed files with 4 additions and 5 deletions

View File

@ -1422,8 +1422,7 @@ int Elf_(r_bin_elf_has_relro)(ELFOBJ *bin) {
}
switch (dTag) {
case DT_FLAGS_1:
switch (bin->dyn_buf[i].d_un.d_val) {
case DF_1_NOW:
if (bin->dyn_buf[i].d_un.d_val & DF_1_NOW) {
haveBindNow = true;
break;
}

View File

@ -768,15 +768,15 @@ static RList* patch_relocs(RBin *b) {
return ret;
}
static int has_canary(RBinFile *arch) {
int ret = 0;
static bool has_canary(RBinFile *arch) {
bool ret = false;
RList* imports_list = imports (arch);
RListIter *iter;
RBinImport *import;
if (imports_list) {
r_list_foreach (imports_list, iter, import) {
if (!strcmp (import->name, "__stack_chk_fail") ) {
ret = 1;
ret = true;
break;
}
}