forked from kerbymart/FuBi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DbgHelpDll.cpp
38 lines (33 loc) · 977 Bytes
/
DbgHelpDll.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* @file DbgHelpDll.cpp
* @brief Source file for the DbgHelpDll class.
* @author Kerby
* @date 2022-12-20
*/
#include "StdAfx.h"
#include "DbgHelpDll.h"
typedef DWORD (WINAPI *PFNUNDECORATESYMBOLNAME)(PCSTR, PSTR, DWORD, DWORD);
static PFNUNDECORATESYMBOLNAME pfnUnDecorateSymbolName = NULL;
DbgHelpDll::DbgHelpDll(void)
{
}
DbgHelpDll::~DbgHelpDll(void)
{
}
bool DbgHelpDll::Load(void)
{
HINSTANCE hDbgHelpDLL;
hDbgHelpDLL = LoadLibrary(_T("DbgHelp"));
if ( hDbgHelpDLL == NULL )
{
return false;
}
pfnUnDecorateSymbolName = (PFNUNDECORATESYMBOLNAME)GetProcAddress( hDbgHelpDLL, "UnDecorateSymbolName");
return true;
}
DWORD DbgHelpDll::UnDecorateSymbolName(const char* DecoratedName, char* UnDecoratedName, DWORD UndecoratedLength, DWORD Flags)
{
PCSTR pszDecoratedName = (PCSTR) DecoratedName;
PSTR pszUndecoratedName = (PSTR) UnDecoratedName;
return ( pfnUnDecorateSymbolName( pszDecoratedName, pszUndecoratedName, UndecoratedLength , Flags ) ) ;
}