rizin/libr/bin/mangling/msvc.c
2015-02-19 22:49:44 +01:00

36 lines
737 B
C

/* radare - LGPL - Copyright 2015 - inisider */
#include <r_bin.h>
///////////////////////////////////////////////////////////////////////////////
static int is_cxx_symbol (const char *name) {
if (*name == '?')
return 1;
return 0;
}
///////////////////////////////////////////////////////////////////////////////
R_API int r_bin_lang_msvc(RBinFile *binfile) {
RBinObject *o = binfile ? binfile->o : NULL;
RBinInfo *info = o ? o->info : NULL;
RBinSymbol *sym;
RListIter *iter;
int hascxx = R_FALSE;
if (!info)
return R_FALSE;
if (!hascxx) {
r_list_foreach (o->symbols, iter, sym) {
if (is_cxx_symbol (sym->name)) {
hascxx = R_TRUE;
break;
}
}
}
if (hascxx)
info->lang = "msvc";
return hascxx;
}