V_hextobinary
0x0025e230 · 245 bytes · __cdecl
_Z13V_hextobinaryPKciPhi
Decompiled
undefined (4 params)
/* V_hextobinary(char const*, int, unsigned char*, int) */
void V_hextobinary(char *param_1,int param_2,uchar *param_3,int param_4)
{
char cVar1;
size_t sVar2;
byte bVar3;
byte *pbVar4;
byte bVar5;
if (param_1 == (char *)0x0) {
sVar2 = 0;
}
else {
sVar2 = strlen(param_1);
}
if ((int)sVar2 <= param_2) {
param_2 = sVar2;
}
memset(param_3,0,param_4);
if ((0 < (int)(param_2 & 0xfffffffeU)) && (0 < param_4)) {
pbVar4 = param_3;
do {
cVar1 = *param_1;
if ((byte)(cVar1 - 0x30U) < 10) {
bVar5 = cVar1 * '\x10';
}
else if ((byte)(cVar1 + 0xbfU) < 6) {
bVar5 = (cVar1 + -0x37) * '\x10';
}
else {
bVar5 = 0;
if ((byte)(cVar1 + 0x9fU) < 6) {
bVar5 = (cVar1 + -0x57) * '\x10';
}
}
cVar1 = param_1[1];
bVar3 = cVar1 - 0x30;
if (bVar3 < 10) {
LAB_0025e2ac:
*pbVar4 = bVar3 | bVar5;
}
else {
if ((byte)(cVar1 + 0xbfU) < 6) {
bVar3 = cVar1 - 0x37;
goto LAB_0025e2ac;
}
bVar3 = 0x30;
if ((byte)(cVar1 + 0x9fU) < 6) {
bVar3 = cVar1 + 0xa9;
}
*pbVar4 = bVar3 | bVar5;
}
if (pbVar4 + 1 == param_3 + ((param_2 & 0xfffffffeU) - 1 >> 1) + 1) {
return;
}
pbVar4 = pbVar4 + 1;
param_1 = param_1 + 2;
} while ((int)pbVar4 - (int)param_3 < param_4);
}
return;
}
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.