mirror of
https://github.com/radareorg/radare2.git
synced 2025-01-13 09:11:49 +00:00
DT_FLAGS_1 are bitfields not a plain value, fixes full relro detection
This commit is contained in:
parent
3ee2bd5ede
commit
9be31cfd9c
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user