gen_codes
0x000eac40 · 181 bytes · __cdecl
_Z9gen_codesR6TStateP7ct_datai
Decompiled
undefined (3 params)
/* gen_codes(TState&, ct_data*, int) */
void gen_codes(TState *param_1,ct_data *param_2,int param_3)
{
ct_data *pcVar1;
uint uVar2;
int iVar3;
uint uVar4;
uint uVar5;
ushort uVar6;
uint uVar7;
uint uVar8;
ushort auStack_30 [16];
iVar3 = 1;
uVar6 = 0;
do {
uVar6 = (uVar6 + *(short *)(param_1 + iVar3 * 2 + 0xfe2)) * 2;
auStack_30[iVar3] = uVar6;
iVar3 = iVar3 + 1;
} while (iVar3 != 0x10);
if ((uint)uVar6 + (uint)*(ushort *)(param_1 + 0x1002) != 0x8000) {
*(char **)(param_1 + 0x6afa4) = "inconsistent bit counts";
}
Trace("\ngen_codes: max_code %d ",param_3);
pcVar1 = param_2 + param_3 * 4 + 4;
if (-1 < param_3) {
do {
uVar7 = (uint)*(ushort *)(param_2 + 2);
if (uVar7 != 0) {
uVar6 = auStack_30[uVar7];
auStack_30[uVar7] = uVar6 + 1;
uVar5 = (uint)uVar6;
uVar2 = 0;
do {
uVar8 = uVar2;
uVar4 = uVar5 & 1;
uVar7 = uVar7 - 1;
uVar5 = uVar5 >> 1;
uVar2 = (uVar4 | uVar8) * 2;
} while (uVar7 != 0);
*(ushort *)param_2 = (ushort)uVar4 | (ushort)uVar8;
}
param_2 = param_2 + 4;
} while (param_2 != pcVar1);
}
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.