Rizin
unix-like reverse engineering framework and cli tools
microsoft_demangle.h File Reference
#include "demangler_util.h"
#include "demangler_types.h"

Go to the source code of this file.

Functions

EDemanglerErr microsoft_demangle (SDemangler *demangler, char **demangled_name)
 Do demangle for microsoft mangling scheme. Demangled name need to be free by user. More...
 

Function Documentation

◆ microsoft_demangle()

EDemanglerErr microsoft_demangle ( SDemangler demangler,
char **  demangled_name 
)

Do demangle for microsoft mangling scheme. Demangled name need to be free by user.

Parameters
demangler'this' object of demangler
demangled_nameDemangled name of symbol of demangler object
Returns
Returns OK if initialization has been finish with success, else one of next errors: eDemanglerErrUnsupportedMangling, ...

Definition at line 2551 of file microsoft_demangle.c.

2551  {
2553  // DemListIter *it = NULL;
2554  // char *tmp = NULL;
2555 
2556  // TODO: need refactor... maybe remove the static variable somewhere?
2559 
2560  if (!demangler || !demangled_name) {
2562  goto microsoft_demangle_err;
2563  }
2564 
2565  if (!strncmp(demangler->symbol, ".?", 2)) {
2566  err = parse_microsoft_rtti_mangled_name(demangler->symbol + 2, demangled_name, NULL);
2567  } else {
2568  err = parse_microsoft_mangled_name(demangler->symbol + 1, demangled_name, NULL);
2569  }
2570 
2571 microsoft_demangle_err:
2574  return err;
2575 }
static bool err
Definition: armass.c:435
#define NULL
Definition: cris-opc.c:27
EDemanglerErr
Enum of possible errors while demangler working.
@ eDemanglerErrOK
if all is OK
@ eDemanglerErrMemoryAllocation
some memory allocation problem
void dem_list_free(DemList *list)
DemList * dem_list_newf(DemListFree f)
RZ_API void Ht_() free(HtName_(Ht) *ht)
Definition: ht_inc.c:130
static EDemanglerErr parse_microsoft_mangled_name(const char *sym, char **demangled_name, size_t *chars_read)
static DemList * abbr_types
static EDemanglerErr parse_microsoft_rtti_mangled_name(const char *sym, char **demangled_name, size_t *chars_read)
static DemList * abbr_names
char * symbol
symbol that need to be demangled

References abbr_names, abbr_types, dem_list_free(), dem_list_newf(), eDemanglerErrMemoryAllocation, eDemanglerErrOK, err, free(), NULL, parse_microsoft_mangled_name(), parse_microsoft_rtti_mangled_name(), and SDemangler::symbol.

Referenced by init_demangler().