diff options
| author | Rusty Wagner <rusty@vector35.com> | 2016-07-10 02:49:49 -0400 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2016-07-10 02:49:49 -0400 |
| commit | ca6d082528f1b4c6d8f66bed18fb2e70f4c87a74 (patch) | |
| tree | 615940ecdbe26eb830d8850f52af7f4dd9f07239 /demangle.cpp | |
| parent | 7853b6eea8c80b537e2fa199a19dde0f68845449 (diff) | |
| parent | b6b76645f0a5e7e631363c4b4ae6383993669abf (diff) | |
Merge branch 'dev' into linear_view
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; +} |
