alias
0x00116a00 · 519 bytes · __cdecl
_ZL5aliasRK8CCommand
Decompiled
undefined (1 param)
/* alias(CCommand const&) */
void alias(CCommand *param_1)
{
undefined4 *puVar1;
int iVar2;
char *pcVar3;
int iVar4;
undefined4 *puVar5;
undefined4 uVar6;
int in_GS_OFFSET;
char *local_434;
char local_420 [1024];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
iVar4 = *(int *)param_1;
if (iVar4 == 1) {
ConMsg("Current alias commands:\n");
for (puVar5 = cmd_alias; puVar5 != (undefined4 *)0x0; puVar5 = (undefined4 *)*puVar5) {
ConMsg("%s : %s\n",puVar5 + 1,puVar5[9]);
}
}
else {
local_434 = "";
if (1 < iVar4) {
local_434 = *(char **)(param_1 + 0x40c);
}
iVar2 = _V_strlen(local_434);
if (iVar2 < 0x20) {
iVar2 = 2;
local_420[0] = '\0';
if (2 < iVar4) {
do {
pcVar3 = "";
if (iVar2 < *(int *)param_1) {
pcVar3 = *(char **)(param_1 + iVar2 * 4 + 0x408);
}
V_strncat(local_420,pcVar3,0x400,-1);
if (iVar2 != iVar4) {
V_strncat(local_420," ",0x400,-1);
}
iVar2 = iVar2 + 1;
} while (iVar2 != iVar4);
}
V_strncat(local_420,"\n",0x400,-1);
for (puVar5 = cmd_alias; puVar5 != (undefined4 *)0x0; puVar5 = (undefined4 *)*puVar5) {
pcVar3 = (char *)(puVar5 + 1);
iVar4 = _V_strcmp(local_434,pcVar3);
if (iVar4 == 0) {
iVar4 = _V_strcmp((char *)puVar5[9],local_420);
if (iVar4 == 0) goto LAB_00116b40;
if ((void *)puVar5[9] != (void *)0x0) {
operator_delete__((void *)puVar5[9]);
}
goto LAB_00116b7e;
}
}
puVar5 = operator_new(0x28);
pcVar3 = (char *)(puVar5 + 1);
puVar1 = puVar5;
*puVar5 = cmd_alias;
cmd_alias = puVar1;
LAB_00116b7e:
V_strncpy(pcVar3,local_434,0x20);
uVar6 = COM_StringCopy(local_420);
puVar5[9] = uVar6;
}
else {
ConMsg("Alias name is too long\n");
}
}
LAB_00116b40:
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
__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.