GiveAutocomplete
0x00995510 · 601 bytes · __cdecl
_Z16GiveAutocompletePKcPA64_c
Decompiled
undefined (2 params)
/* GiveAutocomplete(char const*, char (*) [64]) */
size_t GiveAutocomplete(char *param_1,char *param_2)
{
char *pcVar1;
int iVar2;
int iVar3;
char *pcVar4;
int iVar5;
int iVar6;
size_t sVar7;
int iVar8;
int in_GS_OFFSET;
size_t local_74;
char local_60 [64];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
iVar2 = _V_strstr(param_1," ");
sVar7 = 0;
if (iVar2 != 0) {
pcVar1 = param_1 + (iVar2 - (int)param_1) + 1;
iVar8 = 0;
V_StrSlice(param_1,0,iVar2 - (int)param_1,local_60,0x40);
iVar2 = _V_strlen(pcVar1);
local_74 = 0;
do {
pcVar4 = (&s_giveArguments)[iVar8];
iVar3 = V_strnicmp(pcVar4,pcVar1,iVar2);
if (iVar3 == 0) {
sVar7 = local_74 + 1;
V_snprintf(param_2 + local_74 * 0x40,0x40,"%s %s",local_60,pcVar4);
local_74 = sVar7;
if (sVar7 == 0x40) goto LAB_00995627;
}
iVar8 = iVar8 + 1;
} while (iVar8 != 2);
iVar8 = 1;
do {
pcVar4 = (char *)WeaponIDToAlias(iVar8);
iVar3 = V_strnicmp(pcVar4,pcVar1,iVar2);
if (iVar3 == 0) {
sVar7 = local_74 + 1;
V_snprintf(param_2 + local_74 * 0x40,0x40,"%s %s",local_60,pcVar4);
local_74 = sVar7;
if (sVar7 == 0x40) goto LAB_00995627;
}
iVar8 = iVar8 + 1;
} while (iVar8 != 0x2d);
iVar8 = CMeleeWeaponInfoStore::GetFirstIndex((CMeleeWeaponInfoStore *)g_MeleeWeaponInfoStore);
iVar3 = CMeleeWeaponInfoStore::GetInvalidIndex();
sVar7 = local_74;
while (iVar8 != iVar3) {
iVar5 = CMeleeWeaponInfoStore::GetMeleeWeaponByIndex
((CMeleeWeaponInfoStore *)g_MeleeWeaponInfoStore,iVar8);
local_74 = sVar7;
if (iVar5 != 0) {
iVar6 = V_strnicmp((char *)(iVar5 + 0xc50),pcVar1,iVar2);
if (iVar6 == 0) {
local_74 = sVar7 + 1;
V_snprintf(param_2 + sVar7 * 0x40,0x40,"%s %s",local_60,(char *)(iVar5 + 0xc50));
if (local_74 == 0x40) goto LAB_00995627;
}
}
iVar8 = CMeleeWeaponInfoStore::GetNextIndex
((CMeleeWeaponInfoStore *)g_MeleeWeaponInfoStore,iVar8);
sVar7 = local_74;
}
qsort(param_2,sVar7,0x40,StringSortFunc);
}
LAB_0099562c:
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return sVar7;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
LAB_00995627:
sVar7 = 0x40;
goto LAB_0099562c;
}
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.