L L4D2node

CBaseEntity::AddContext

0x006157c0 · 508 bytes · __thiscall

_ZN11CBaseEntity10AddContextEPKcS1_f

Decompiled

undefined (4 params)

/* CBaseEntity::AddContext(char const*, char const*, float) */

void __thiscall CBaseEntity::AddContext(CBaseEntity *this,char *param_1,char *param_2,float param_3)

{
  int iVar1;
  char *pcVar2;
  char cVar3;
  int iVar4;
  undefined4 *puVar5;
  undefined1 *puVar6;
  int in_GS_OFFSET;
  CUtlVector<ResponseContext_t,CUtlMemory<ResponseContext_t,int>> *this_00;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  float local_64;
  char local_60 [64];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  iVar4 = FindContextByName(this,param_1);
  if (iVar4 == -1) {
    AllocPooledString((char *)&local_6c);
    puVar5 = (undefined4 *)RR::CApplyContextOperator::FindOperator(param_2);
    cVar3 = (**(code **)*puVar5)(puVar5,0,param_2,local_60,0x40);
    if (cVar3 == '\0') {
      AllocPooledString((char *)&local_68);
    }
    else {
      AllocPooledString((char *)&local_68);
    }
    pcVar2 = *(char **)(this + 0xc4);
    this_00 = (CUtlVector<ResponseContext_t,CUtlMemory<ResponseContext_t,int>> *)(this + 0xb8);
    CUtlVector<ResponseContext_t,CUtlMemory<ResponseContext_t,int>>::GrowVector(this_00,1);
    param_2 = pcVar2;
    CUtlVector<ResponseContext_t,CUtlMemory<ResponseContext_t,int>>::ShiftElementsRight
              (this_00,(int)pcVar2,1);
    puVar5 = (undefined4 *)(*(int *)(this + 0xb8) + (int)pcVar2 * 0xc);
    if (puVar5 != (undefined4 *)0x0) {
      local_64 = param_3;
      *puVar5 = local_6c;
      puVar5[1] = local_68;
      puVar5[2] = param_3;
    }
  }
  else {
    puVar5 = (undefined4 *)RR::CApplyContextOperator::FindOperator(param_2);
    iVar4 = iVar4 * 0xc;
    puVar6 = *(undefined1 **)(*(int *)(this + 0xb8) + 4 + iVar4);
    if (puVar6 == (undefined1 *)0x0) {
      puVar6 = &DAT_00d539c2;
    }
    cVar3 = (**(code **)*puVar5)(puVar5,puVar6,param_2,local_60,0x40);
    if (cVar3 == '\0') {
      puVar6 = *(undefined1 **)(*(int *)(this + 0xb8) + 4 + iVar4);
      if (puVar6 == (undefined1 *)0x0) {
        puVar6 = &DAT_00d539c2;
      }
      Warning("RR: could not apply operator %s to prior value %s\n",param_2,puVar6);
      iVar1 = *(int *)(this + 0xb8);
      this_00 = (CUtlVector<ResponseContext_t,CUtlMemory<ResponseContext_t,int>> *)&local_70;
      AllocPooledString((char *)this_00);
      *(undefined4 *)(iVar1 + 4 + iVar4) = local_70;
    }
    else {
      this_00 = (CUtlVector<ResponseContext_t,CUtlMemory<ResponseContext_t,int>> *)&local_70;
      iVar1 = *(int *)(this + 0xb8);
      param_2 = local_60;
      AllocPooledString((char *)this_00);
      *(undefined4 *)(iVar1 + 4 + iVar4) = local_70;
    }
    *(float *)(*(int *)(this + 0xb8) + 8 + iVar4) = param_3;
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail(this_00,param_2);
}

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)