Update macho_analysis.py - SYMBOLS STRIPPED False Negative (#2234)

* Update macho_analysis.py

PR for this issue: 
https://github.com/MobSF/Mobile-Security-Framework-MobSF/issues/2233

* Update macho_analysis.py


Co-authored-by: Ajin Abraham <[email protected]>
This commit is contained in:
Karmaz
2023-08-15 09:47:26 -07:00
committed by GitHub
co-authored by Ajin Abraham
parent 19e0963162
commit 2b7156c7cc
@@ -224,9 +224,12 @@ class Checksec:
return bool(self.macho.encryption_info.crypt_id)
def is_symbols_stripped(self):
filter_symbol = 'radr://5614542'
filter_symbols = ['radr://5614542', '__mh_execute_header']
for i in self.macho.symbols:
if (i.type & 0xe0) > 0 and i.name.lower().strip() != filter_symbol:
strip_bool = i.type & 0xe0
strip_type = i.type in [0x0e, 0x1e, 0x0f]
sym = i.name.lower().strip()
if (strip_bool > 0 or strip_type) and sym not in filter_symbols:
return False
return True