Hack_FixEscapeChars
0x004b2460 · 172 bytes · __cdecl
_Z19Hack_FixEscapeCharsPc
Decompiled
undefined (1 param)
/* Hack_FixEscapeChars(char*) */
void Hack_FixEscapeChars(char *param_1)
{
char cVar1;
int iVar2;
char *pcVar3;
int iVar4;
char *pcVar5;
int in_GS_OFFSET;
int iStackY_40;
char acStack_30 [16];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
iStackY_40 = 0x4b247f;
iVar4 = _V_strlen(param_1);
iVar2 = -((iVar4 + 0x10U & 0xfffffff0) + 0x10);
cVar1 = *param_1;
pcVar5 = acStack_30 + iVar2;
pcVar3 = param_1;
do {
while( true ) {
if (cVar1 == '\0') {
*pcVar5 = '\0';
*(int *)(&stack0xffffffcc + iVar2) = iVar4 + 1;
*(char **)(&stack0xffffffc8 + iVar2) = acStack_30 + iVar2;
*(char **)(&stack0xffffffc4 + iVar2) = param_1;
*(undefined4 *)((int)&iStackY_40 + iVar2) = 0x4b24f3;
V_strncpy(*(char **)(&stack0xffffffc4 + iVar2),*(char **)(&stack0xffffffc8 + iVar2),
*(int *)(&stack0xffffffcc + iVar2));
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
*(undefined **)((int)&iStackY_40 + iVar2) = &UNK_004b251c;
__stack_chk_fail();
}
if (cVar1 == '\\') break;
*pcVar5 = cVar1;
LAB_004b24ac:
cVar1 = pcVar3[1];
pcVar5 = pcVar5 + 1;
pcVar3 = pcVar3 + 1;
}
if (pcVar3[1] != 'n') {
*pcVar5 = '\\';
goto LAB_004b24ac;
}
*pcVar5 = '\n';
pcVar5 = pcVar5 + 1;
cVar1 = pcVar3[2];
pcVar3 = pcVar3 + 2;
} while( true );
}
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.