diff options
| author | plafosse <peter@vector35.com> | 2016-07-07 21:44:20 -0400 |
|---|---|---|
| committer | plafosse <peter@vector35.com> | 2016-07-07 21:44:40 -0400 |
| commit | c85d93f505f53f921dd2d7b2d774ff75979261f7 (patch) | |
| tree | 5346720210ef5e319786302f51003215bb575d36 /demangle.cpp | |
| parent | 05b8dae707da62437abf262fe8d1dd2b74a5f98f (diff) | |
Adding DemangleMS API and extending types for C++
Diffstat (limited to 'demangle.cpp')
| -rw-r--r-- | demangle.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/demangle.cpp b/demangle.cpp new file mode 100644 index 00000000..1a998a87 --- /dev/null +++ b/demangle.cpp @@ -0,0 +1,23 @@ +#include "binaryninjaapi.h" + +using namespace BinaryNinja; +using namespace std; + +bool DemangleMS(Architecture* arch, + const std::string& mangledName, + Type** outType, + std::vector<std::string>& outVarName) +{ + BNType* localType = (*outType)->GetObject(); + char** localVarName = nullptr; + size_t localSize = 0; + if (!BNDemangleMS(arch->GetObject(), mangledName.c_str(), &localType, &localVarName, &localSize)) + return false; + for (size_t i = 0; i < localSize; i++) + { + outVarName.push_back(localVarName[i]); + BNFreeString(localVarName[i]); + } + delete [] localVarName; + return true; +} |
