MCPcopy Create free account
hub / github.com/HyperDbg/HyperDbg / NewWstringSymbol

Function NewWstringSymbol

hyperdbg/script-engine/code/script-engine.c:3718–3737  ·  view source on GitHub ↗

* @brief Allocates a new SYMBOL with wstring type and returns the reference to it * * @param value * @return PSYMBOL */

Source from the content-addressed store, hash-verified

3716 * @return PSYMBOL
3717 */
3718PSYMBOL
3719NewWstringSymbol(PSCRIPT_ENGINE_TOKEN Token)
3720{
3721 PSYMBOL Symbol;
3722 int BufferSize = (SIZE_SYMBOL_WITHOUT_LEN + Token->Len) / sizeof(SYMBOL) + 1;
3723 Symbol = (PSYMBOL)malloc(BufferSize * sizeof(SYMBOL));
3724
3725 if (Symbol == NULL)
3726 {
3727 //
3728 // There was an error allocating buffer
3729 //
3730 return NULL;
3731 }
3732
3733 memcpy(&Symbol->Value, Token->Value, Token->Len);
3734 SetType(&Symbol->Type, SYMBOL_WSTRING_TYPE);
3735 Symbol->Len = Token->Len;
3736 return Symbol;
3737}
3738
3739/**
3740 * @brief

Callers 1

ToSymbolFunction · 0.85

Calls 1

SetTypeFunction · 0.85

Tested by

no test coverage detected