Add xnu kernelcache support to rz_bin_language_detect()

This commit is contained in:
Florian Märkl 2023-06-28 14:36:31 +02:00
parent e682143ec7
commit 350dc181f5

View file

@ -102,6 +102,7 @@ RZ_API RzBinLanguage rz_bin_language_detect(RzBinFile *binfile) {
bool is_macho = info->rclass ? strstr(info->rclass, "mach") : false;
bool is_dyldc = info->bclass ? strstr(info->bclass, "dyldcache") : false;
bool is_xnu_kernelcache = info->bclass ? strstr(info->bclass, "kernelcache") : false;
bool is_elf = info->rclass ? strstr(info->rclass, "elf") : false;
bool is_pe = info->rclass ? strstr(info->rclass, "pe") : false;
bool is_class = info->rclass ? strstr(info->rclass, "class") : false;
@ -110,7 +111,7 @@ RZ_API RzBinLanguage rz_bin_language_detect(RzBinFile *binfile) {
bool is_cpp = false;
char *lib = NULL;
if (!is_macho && !is_dyldc && !is_elf && !is_pe && !is_class) {
if (!is_macho && !is_dyldc && !is_xnu_kernelcache && !is_elf && !is_pe && !is_class) {
return RZ_BIN_LANGUAGE_UNKNOWN;
}