AllocWString
0x0025f3f0 · 107 bytes · __cdecl
_Z12AllocWStringPKwi
Decompiled
undefined (2 params)
/* AllocWString(wchar_t const*, int) */
wchar_t * AllocWString(wchar_t *param_1,int param_2)
{
size_t sVar1;
uint uVar2;
wchar_t *pwVar3;
uint uVar4;
if (param_2 == -1) {
sVar1 = wcslen(param_1);
uVar4 = sVar1 + 1;
}
else {
sVar1 = wcslen(param_1);
uVar4 = sVar1 + 1;
if (param_2 <= (int)sVar1) {
uVar4 = param_2 + 1;
}
}
uVar2 = uVar4 * 4;
if (0x1fc00000 < uVar4) {
uVar2 = 0xffffffff;
}
pwVar3 = operator_new__(uVar2);
V_wcsncpy(pwVar3,param_1,uVar4 * 4);
return pwVar3;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.