CExpressionCalculator::ParsePrimary
0x0026f030 · 555 bytes · __thiscall
_ZN21CExpressionCalculator12ParsePrimaryERPKc
Decompiled
undefined (2 params)
/* WARNING: Type propagation algorithm not settling */
/* CExpressionCalculator::ParsePrimary(char const*&) */
uint __thiscall CExpressionCalculator::ParsePrimary(CExpressionCalculator *this,char **param_1)
{
CExpressionCalculator CVar1;
undefined4 uVar2;
int iVar3;
char cVar4;
undefined4 uVar5;
uint uVar6;
int iVar7;
int iVar8;
undefined1 *puVar9;
char *pcVar10;
int in_GS_OFFSET;
undefined4 uStackY_50;
undefined1 auStack_40 [12];
double local_34;
float local_2c;
int local_28 [6];
puVar9 = &stack0xffffffb4;
local_2c = 0.0;
local_28[2] = *(int *)(in_GS_OFFSET + 0x14);
pcVar10 = *param_1;
uVar2 = *(undefined4 *)(this + 0x44);
uStackY_50 = 0x26f065;
local_34 = strtod(pcVar10,param_1);
local_2c = (float)local_34;
if (pcVar10 == *param_1) {
*(undefined4 *)(this + 0x44) = uVar2;
*param_1 = pcVar10;
local_28[0] = *(int *)(this + 0x1c);
uStackY_50 = 0x26f0d4;
uVar5 = ParseStringList(param_1,(CUtlVector *)(this + 0x10),local_28);
if ((char)uVar5 == '\0') {
*(undefined4 *)(this + 0x44) = uVar2;
*param_1 = pcVar10;
uStackY_50 = 0x26f0f2;
cVar4 = ParseString(param_1,"(");
if (cVar4 != '\0') {
uStackY_50 = 0x26f14c;
cVar4 = ParseExpr(this,param_1);
if (cVar4 != '\0') {
uStackY_50 = 0x26f160;
uVar6 = ParseString(param_1,")");
puVar9 = &stack0xffffffb4;
if ((char)uVar6 != '\0') goto LAB_0026f095;
}
}
*(undefined4 *)(this + 0x44) = uVar2;
*param_1 = pcVar10;
uStackY_50 = 0x26f10a;
cVar4 = Parse1ArgFunc(this,param_1);
if (cVar4 == '\0') {
uStackY_50 = 0x26f17c;
cVar4 = Parse2ArgFunc(this,param_1);
if (cVar4 == '\0') {
uStackY_50 = 0x26f18c;
cVar4 = Parse3ArgFunc(this,param_1);
if (cVar4 == '\0') {
uStackY_50 = 0x26f1a0;
uVar6 = Parse5ArgFunc(this,param_1);
if ((char)uVar6 == '\0') {
CVar1 = this[0x4c];
puVar9 = &stack0xffffffb4;
if (CVar1 != (CExpressionCalculator)0x0) {
pcVar10 = *param_1;
cVar4 = *pcVar10;
local_34 = (double)CONCAT44(local_34._4_4_,pcVar10);
puVar9 = &stack0xffffffb4;
if (9 < (int)cVar4 - 0x30U) {
while( true ) {
uStackY_50 = 0x26f1f3;
iVar7 = isalnum((int)cVar4);
if ((iVar7 == 0) && (cVar4 != '_')) break;
pcVar10 = pcVar10 + 1;
*param_1 = pcVar10;
cVar4 = *pcVar10;
}
iVar3 = local_34._0_4_;
iVar8 = (int)pcVar10 - local_34._0_4_;
local_34 = (double)CONCAT44(local_34._4_4_,iVar8);
iVar7 = -((iVar8 + 0x10U & 0xfffffff0) + 0x10);
puVar9 = auStack_40 + iVar7;
*(int *)(&stack0xffffffb8 + iVar7) = iVar3;
*(int *)(&stack0xffffffbc + iVar7) = iVar8;
*(undefined1 **)(&stack0xffffffb4 + iVar7) = puVar9;
*(undefined4 *)((int)&uStackY_50 + iVar7) = 0x26f22b;
memcpy(*(void **)(&stack0xffffffb4 + iVar7),*(void **)(&stack0xffffffb8 + iVar7),
*(size_t *)(&stack0xffffffbc + iVar7));
puVar9[local_34._0_4_] = 0;
*(CExpressionCalculator **)(&stack0xffffffb4 + iVar7) = this;
*(undefined4 *)(&stack0xffffffbc + iVar7) = 0;
*(undefined1 **)(&stack0xffffffb8 + iVar7) = puVar9;
*(undefined4 *)((int)&uStackY_50 + iVar7) = 0x26f249;
SetVariable(*(CExpressionCalculator **)(&stack0xffffffb4 + iVar7),
*(char **)(&stack0xffffffb8 + iVar7),
*(float *)(&stack0xffffffbc + iVar7));
*(CExpressionCalculator **)(&stack0xffffffb4 + iVar7) = this + 0x38;
*(int **)(&stack0xffffffb8 + iVar7) = local_28 + 1;
local_28[1] = 0;
*(undefined4 *)((int)&uStackY_50 + iVar7) = 0x26f25f;
CUtlStack<float,CUtlMemory<float,int>>::Push
(*(CUtlStack<float,CUtlMemory<float,int>> **)(&stack0xffffffb4 + iVar7),
*(float **)(&stack0xffffffb8 + iVar7));
uVar6 = (uint)(byte)CVar1;
puVar9 = &stack0xffffffb4 + iVar7;
}
}
goto LAB_0026f095;
}
}
}
}
uVar6 = 1;
puVar9 = &stack0xffffffb4;
}
else {
local_34 = (double)CONCAT44(local_34._4_4_,uVar5);
uStackY_50 = 0x26f133;
CUtlStack<float,CUtlMemory<float,int>>::Push
((CUtlStack<float,CUtlMemory<float,int>> *)(this + 0x38),
(float *)(*(int *)(this + 0x24) + local_28[0] * 4));
uVar6 = local_34._0_4_;
}
}
else {
uStackY_50 = 0x26f090;
CUtlStack<float,CUtlMemory<float,int>>::Push
((CUtlStack<float,CUtlMemory<float,int>> *)(this + 0x38),&local_2c);
uVar6 = 1;
puVar9 = &stack0xffffffb4;
}
LAB_0026f095:
if (local_28[2] != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
*(undefined **)(puVar9 + -4) = &UNK_0026f26d;
__stack_chk_fail();
}
return uVar6;
}
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.