Q_RemoveAllEvilCharacters
0x00b7be30 · 271 bytes · __cdecl
_Z25Q_RemoveAllEvilCharactersPc
Decompiled
undefined (1 param)
/* Q_RemoveAllEvilCharacters(char*) */
char Q_RemoveAllEvilCharacters(char *param_1)
{
int iVar1;
undefined4 uVar2;
int iVar3;
size_t sVar4;
char *pcVar5;
char cVar6;
uint uVar7;
int iVar8;
int in_GS_OFFSET;
int iStackY_50;
size_t local_40;
char *local_3c;
char local_35;
int local_34;
uint local_30;
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
local_3c = param_1;
if (param_1 == (char *)0x0) {
uVar7 = 0x10;
iVar8 = 4;
local_40 = 0;
}
else {
iStackY_50 = 0xb7be5b;
local_40 = strlen(param_1);
iVar8 = local_40 * 4 + 4;
uVar7 = local_40 * 4 + 0x13 & 0xfffffff0;
}
pcVar5 = local_3c;
iVar3 = -(uVar7 + 0x10);
iVar1 = (int)&local_40 + iVar3;
*(int *)(&stack0xffffffbc + iVar3) = iVar8;
*(int *)(&stack0xffffffb8 + iVar3) = iVar1;
*(char **)(&stack0xffffffb4 + iVar3) = pcVar5;
*(undefined4 *)((int)&iStackY_50 + iVar3) = 0xb7be8a;
uVar7 = V_UTF8ToUnicode(*(char **)(&stack0xffffffb4 + iVar3),
*(wchar_t **)(&stack0xffffffb8 + iVar3),*(int *)(&stack0xffffffbc + iVar3)
);
local_30 = uVar7 >> 2;
if (uVar7 >> 2 == 0) {
*(undefined4 *)(&stack0xffffffbc + iVar3) = 0;
local_35 = '\0';
}
else {
uVar7 = 0;
local_34 = 0;
local_35 = '\0';
do {
while( true ) {
uVar2 = *(undefined4 *)(iVar1 + uVar7 * 4);
*(undefined4 *)(&stack0xffffffb4 + iVar3) = uVar2;
*(undefined4 *)((int)&iStackY_50 + iVar3) = 0xb7becd;
cVar6 = Q_IsMeanSpaceW(*(wchar_t *)(&stack0xffffffb4 + iVar3));
iVar8 = local_34;
sVar4 = local_40;
if (cVar6 == '\0') break;
uVar7 = uVar7 + 1;
local_35 = '\x01';
if (local_30 == uVar7) goto LAB_00b7bedd;
}
uVar7 = uVar7 + 1;
local_34 = local_34 + 1;
*(undefined4 *)(iVar1 + iVar8 * 4) = uVar2;
} while (local_30 != uVar7);
LAB_00b7bedd:
*(undefined4 *)(&stack0xffffffbc + local_34 * 4 + iVar3) = 0;
if (local_35 != '\0') {
*(int *)(&stack0xffffffb4 + iVar3) = iVar1;
*(size_t *)(&stack0xffffffbc + iVar3) = sVar4;
*(char **)(&stack0xffffffb8 + iVar3) = local_3c;
*(undefined4 *)((int)&iStackY_50 + iVar3) = 0xb7bf04;
V_UnicodeToUTF8(*(wchar_t **)(&stack0xffffffb4 + iVar3),*(char **)(&stack0xffffffb8 + iVar3),
*(int *)(&stack0xffffffbc + iVar3));
}
}
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return local_35;
}
/* WARNING: Subroutine does not return */
*(undefined **)((int)&iStackY_50 + iVar3) = &UNK_00b7bf48;
__stack_chk_fail();
}
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.