about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-08-15 14:00:02 +0200
committerptitSeb <sebastien.chev@gmail.com>2024-08-15 14:00:02 +0200
commit65b1b9256ad824b70484ce96d984fc8810aaa024 (patch)
treecf6b810dc60ac8ae3e242244827cc2cbe41f20b6 /src
parent7866f116dff8cc83d7b09f681c98722c6cd7c5a8 (diff)
downloadbox64-65b1b9256ad824b70484ce96d984fc8810aaa024.tar.gz
box64-65b1b9256ad824b70484ce96d984fc8810aaa024.zip
Fixed falsly detection of needed memory hack
Diffstat (limited to 'src')
-rw-r--r--src/mallochook.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mallochook.c b/src/mallochook.c
index 4c636dd4..f63a85bd 100644
--- a/src/mallochook.c
+++ b/src/mallochook.c
@@ -779,7 +779,7 @@ void checkHookedSymbols(elfheader_t* h)
     for (size_t i=0; i<h->numSymTab; ++i) {
         int type = ELF64_ST_TYPE(h->SymTab[i].st_info);
         int sz = ELF64_ST_TYPE(h->SymTab[i].st_size);
-        if(type==STT_FUNC && sz) {
+        if((type==STT_FUNC) && sz && (h->SymTab[i].st_shndx!=0 && h->SymTab[i].st_shndx<=65521)) {
             const char * symname = h->StrTab+h->SymTab[i].st_name;
             #define GO(A, B) if(!strcmp(symname, #A)) ++hooked; else if(!strcmp(symname, "__libc_" #A)) ++hooked;
             #define GO2(A, B)