L L4D2node

CExpressionCalculator::ParseDivMul

0x0026f390 · 311 bytes · __thiscall

_ZN21CExpressionCalculator11ParseDivMulERPKc

Decompiled

undefined (2 params)

/* CExpressionCalculator::ParseDivMul(char const*&) */

undefined4 __thiscall CExpressionCalculator::ParseDivMul(CExpressionCalculator *this,char **param_1)

{
  int iVar1;
  float fVar2;
  char *pcVar3;
  undefined4 uVar4;
  int iVar5;
  char cVar6;
  undefined4 uVar7;
  undefined4 uVar8;
  ushort in_FPUStatusWord;
  int local_30;
  float local_2c;
  char *local_28;
  undefined *local_24;
  undefined *local_20;
  
  pcVar3 = *param_1;
  uVar4 = *(undefined4 *)(this + 0x44);
  uVar7 = ParseUnary(this,param_1);
  if ((char)uVar7 == '\0') {
    *(undefined4 *)(this + 0x44) = uVar4;
    *param_1 = pcVar3;
    return uVar7;
  }
  pcVar3 = *param_1;
  uVar4 = *(undefined4 *)(this + 0x44);
  local_28 = "*";
  local_24 = &DAT_002bb07d;
  local_20 = &DAT_002a990b;
  local_30 = 3;
  cVar6 = ParseStringList(param_1,&local_28,&local_30);
  if ((cVar6 != '\0') && (uVar8 = ParseDivMul(this,param_1), (char)uVar8 != '\0')) {
    iVar5 = *(int *)(this + 0x44);
    iVar1 = iVar5 + -1;
    fVar2 = *(float *)(*(int *)(this + 0x38) + iVar1 * 4);
    *(int *)(this + 0x44) = iVar1;
    local_2c = *(float *)(*(int *)(this + 0x38) + -4 + iVar1 * 4);
    *(int *)(this + 0x44) = iVar5 + -2;
    if (local_30 == 1) {
      local_2c = local_2c / fVar2;
    }
    else if (local_30 == 2) {
      do {
        local_2c = local_2c - (local_2c / fVar2) * fVar2;
      } while ((in_FPUStatusWord & 0x400) != 0);
    }
    else {
      if (local_30 != 0) {
        return uVar8;
      }
      local_2c = fVar2 * local_2c;
    }
    CUtlStack<float,CUtlMemory<float,int>>::Push
              ((CUtlStack<float,CUtlMemory<float,int>> *)(this + 0x38),&local_2c);
    return uVar8;
  }
  *(undefined4 *)(this + 0x44) = uVar4;
  *param_1 = pcVar3;
  return uVar7;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)