L L4D2node

CExpressionCalculator::Parse1ArgFunc

0x0026fe20 · 822 bytes · __thiscall

_ZN21CExpressionCalculator13Parse1ArgFuncERPKc

Decompiled

undefined (2 params)

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

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

{
  int iVar1;
  char cVar2;
  int iVar3;
  undefined4 uVar4;
  longdouble lVar5;
  undefined *puVar6;
  int *piVar7;
  int local_54;
  float local_50;
  char *local_4c;
  undefined *local_48;
  undefined *local_44;
  undefined *local_40;
  undefined *local_3c;
  undefined *local_38;
  undefined *local_34;
  undefined *local_30;
  char *local_2c;
  char *local_28;
  undefined *local_24;
  undefined *local_20;
  char *local_1c;
  char *local_18;
  char *local_14;
  undefined *local_10;
  
  piVar7 = &local_54;
  local_4c = "abs";
  local_48 = &DAT_002cd1f3;
  local_44 = &DAT_002cd1f7;
  local_40 = &DAT_002cd1fd;
  local_3c = &DAT_002cd1fc;
  local_38 = &DAT_002cd202;
  local_34 = &DAT_002cd201;
  local_30 = &DAT_002cd206;
  local_2c = "exp";
  local_28 = "log";
  local_24 = &DAT_002cd20a;
  local_20 = &DAT_002cd20f;
  local_1c = "floor";
  local_18 = "ceiling";
  local_14 = "round";
  local_10 = &DAT_002cd222;
  local_54 = 0x10;
  cVar2 = ParseStringList(param_1,&local_4c,piVar7);
  if ((((cVar2 != '\0') && (cVar2 = ParseString(param_1,"("), cVar2 != '\0')) &&
      (*param_1 != (char *)0x0)) && (cVar2 = ParseConditional(this,param_1), cVar2 != '\0')) {
    puVar6 = &DAT_002cb7cd;
    uVar4 = ParseString(param_1,")");
    if ((char)uVar4 != '\0') {
      iVar1 = *(int *)(this + 0x44);
      iVar3 = iVar1 + -1;
      local_50 = *(float *)(*(int *)(this + 0x38) + iVar3 * 4);
      *(int *)(this + 0x44) = iVar3;
      switch(local_54) {
      case 0:
        local_50 = ABS(local_50);
        break;
      case 1:
        local_50 = local_50 * local_50;
        break;
      case 2:
        local_50 = SQRT(local_50);
        break;
      case 3:
        local_50 = sinf(local_50);
        break;
      case 4:
        lVar5 = (longdouble)__asinf_finite(local_50);
        local_50 = (float)lVar5;
        break;
      case 5:
        local_50 = cosf(local_50);
        break;
      case 6:
        lVar5 = (longdouble)__acosf_finite(local_50);
        local_50 = (float)lVar5;
        break;
      case 7:
        local_50 = tanf(local_50);
        break;
      case 8:
        lVar5 = (longdouble)__expf_finite(local_50);
        local_50 = (float)lVar5;
        break;
      case 9:
        lVar5 = (longdouble)__logf_finite(local_50,puVar6,piVar7,iVar1);
        local_50 = (float)lVar5;
        break;
      case 10:
        local_50 = local_50 * 0.017453292;
        break;
      case 0xb:
        local_50 = local_50 * 57.295776;
        break;
      case 0xc:
        if (ABS(local_50) < 8388608.0) {
          local_50 = (float)(int)local_50 -
                     (float)(-(uint)(local_50 < (float)(int)local_50) & 0x3f800000);
        }
        break;
      case 0xd:
        if (ABS(local_50) < 8388608.0) {
          local_50 = (float)(-(uint)((float)(int)local_50 < local_50) & 0x3f800000) +
                     (float)(int)local_50;
        }
        break;
      case 0xe:
        local_50 = local_50 + 0.5;
        if (ABS(local_50) < 8388608.0) {
          local_50 = (float)(int)local_50 -
                     (float)(-(uint)(local_50 < (float)(int)local_50) & 0x3f800000);
        }
        break;
      case 0xf:
        local_50 = (float)(~-(uint)(0.0 <= local_50) & 0xbf800000 |
                          -(uint)(0.0 <= local_50) & 0x3f800000);
        break;
      default:
        goto switchD_0026ff2e_default;
      }
      CUtlStack<float,CUtlMemory<float,int>>::Push
                ((CUtlStack<float,CUtlMemory<float,int>> *)(this + 0x38),&local_50);
      return uVar4;
    }
  }
  uVar4 = 0;
switchD_0026ff2e_default:
  return uVar4;
}

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)