1
0
Fork 0

DBG: added DbgFunctions()->StringFormatInline

This commit is contained in:
mrexodia 2016-05-25 04:16:57 +02:00
parent 6d2703cd74
commit 5b669067f3
2 changed files with 12 additions and 0 deletions

View File

@ -18,6 +18,7 @@
#include "exhandlerinfo.h"
#include "breakpoint.h"
#include "threading.h"
#include "stringformat.h"
static DBGFUNCTIONS _dbgfunctions;
@ -234,6 +235,14 @@ static bool _getbridgebp(BPXTYPE type, duint addr, BRIDGEBP* bp)
return true;
}
static bool _stringformatinline(const char* format, size_t resultSize, char* result)
{
if(!format || !result)
return false;
strcpy_s(result, resultSize, stringformatinline(format).c_str());
return true;
}
void dbgfunctionsinit()
{
_dbgfunctions.AssembleAtEx = _assembleatex;
@ -274,4 +283,5 @@ void dbgfunctionsinit()
_dbgfunctions.ValFromString = _valfromstring;
_dbgfunctions.PatchGetEx = (PATCHGETEX)PatchGet;
_dbgfunctions.GetBridgeBp = _getbridgebp;
_dbgfunctions.StringFormatInline = _stringformatinline;
}

View File

@ -83,6 +83,7 @@ typedef bool (*GETSOURCEFROMADDR)(duint addr, char* szSourceFile, int* line);
typedef bool (*VALFROMSTRING)(const char* string, duint* value);
typedef bool (*PATCHGETEX)(duint addr, DBGPATCHINFO* info);
typedef bool(*GETBRIDGEBP)(BPXTYPE type, duint addr, BRIDGEBP* bp);
typedef bool(*STRINGFORMATINLINE)(const char* format, size_t resultSize, char* result);
typedef struct DBGFUNCTIONS_
{
@ -124,6 +125,7 @@ typedef struct DBGFUNCTIONS_
VALFROMSTRING ValFromString;
PATCHGETEX PatchGetEx;
GETBRIDGEBP GetBridgeBp;
STRINGFORMATINLINE StringFormatInline;
} DBGFUNCTIONS;
#ifdef BUILD_DBG