8 #define LANGUAGE_WITH_BLOCKS " with blocks"
9 #define language_apply_blocks_mask(x, b) (b ? (RZ_BIN_LANGUAGE_BLOCKS | (x)) : (x))
10 #define language_apply_blocks_string(x, b) (RZ_BIN_LANGUAGE_HAS_BLOCKS(x) ? (b LANGUAGE_WITH_BLOCKS) : (b))
13 return strstr(sym->
name,
"_$LT$") ||
14 strstr(sym->
name,
"_rust_oom");
18 return !strncmp(sym->
name,
"_OBJC_", 6);
22 if (!strncmp(sym->
name,
"_D2", 3)) {
25 return !strncmp(sym->
name,
"_D4", 3);
29 return strstr(sym->
name,
"swift_once");
33 return !strncmp(sym->
name,
"go.", 3) ||
34 strstr(sym->
name,
"gopclntab");
38 if (!strncmp(sym->
name,
"_Z", 2)) {
41 return !strncmp(sym->
name,
"__Z", 3);
45 return *sym->
name ==
'?';
49 return strstr(sym->
name,
"kotlin_");
53 return strstr(sym->
name,
"_groovy");
57 return strstr(sym->
name,
"io_flutter_");
92 bool is_blocks =
false;
97 if (!is_macho && !is_elf && !is_pe && !is_class) {
101 if (is_macho || is_elf) {
104 if (!strcmp(
name,
"_NSConcreteGlobalBlock")) {
106 }
else if (!strncmp(
name,
"objc_", 5)) {
111 rz_list_foreach (o->
libs,
iter, lib) {
112 if (is_macho && strstr(lib,
"swift")) {
115 }
else if (strstr(lib,
"stdc++") || strstr(lib,
"c++")) {
117 }
else if (strstr(lib,
"msvcp")) {
120 }
else if (strstr(lib,
"phobos")) {
166 if (is_macho || is_elf) {
171 if (strstr(
section->name,
"note.go.buildid") ||
172 strstr(
section->name,
"gopclntab") ||
173 strstr(
section->name,
"go_export")) {
184 }
else if (strstr(
info->
lang,
"java")) {
198 if (strstr(language,
"swift")) {
200 }
else if (strstr(language,
"java")) {
202 }
else if (strstr(language,
"groovy")) {
204 }
else if (strstr(language,
"kotlin")) {
206 }
else if (strstr(language,
"objc")) {
208 }
else if (strstr(language,
"cxx") || strstr(language,
"c++")) {
210 }
else if (strstr(language,
"dlang")) {
212 }
else if (strstr(language,
"msvc")) {
214 }
else if (strstr(language,
"rust")) {
216 }
else if (strstr(language,
"dart")) {
220 }
else if (!strcmp(language,
"go")) {
static bool check_rust(RzBinSymbol *sym)
static bool check_kotlin(RzBinSymbol *sym)
RZ_API RzBinLanguage rz_bin_language_detect(RzBinFile *binfile)
Tries to detect which language is used in the binary based on symbols and libraries.
static bool check_dlang(RzBinSymbol *sym)
static bool check_objc(RzBinSymbol *sym)
#define LANGUAGE_WITH_BLOCKS
RZ_API RzBinLanguage rz_bin_language_to_id(const char *language)
returns the language identifier based on the given lang name
#define language_apply_blocks_mask(x, b)
static bool check_swift(RzBinSymbol *sym)
static bool check_cxx(RzBinSymbol *sym)
static bool check_msvc(RzBinSymbol *sym)
static bool check_groovy(RzBinSymbol *sym)
RZ_API const char * rz_bin_language_to_string(RzBinLanguage language)
returns the language name based on the given language identifier
static bool check_golang(RzBinSymbol *sym)
#define language_apply_blocks_string(x, b)
static bool check_dart(RzBinSymbol *sym)
RzBinInfo * info(RzBinFile *bf)
#define rz_return_val_if_fail(expr, val)
@ RZ_BIN_LANGUAGE_UNKNOWN
#define RZ_BIN_LANGUAGE_MASK(x)
#define RZ_STR_ISEMPTY(x)
XX curplugin == o->plugin.