L L4D2node

CC_Ent_Call

0x00610f30 · 861 bytes · __cdecl

_Z11CC_Ent_CallRK8CCommand

Decompiled

undefined (1 param)

/* CC_Ent_Call(CCommand const&) */

void CC_Ent_Call(CCommand *param_1)

{
  char cVar1;
  CBasePlayer *pCVar2;
  char *pcVar3;
  int iVar4;
  undefined4 *puVar5;
  void *pvVar6;
  undefined1 *puVar7;
  CBaseEntity *this;
  char *local_50;
  void *local_4c [2];
  undefined2 local_44;
  ushort local_42;
  void *local_40;
  undefined4 local_3c;
  undefined2 local_38;
  ushort local_36;
  void *local_34;
  undefined4 local_30;
  undefined2 local_2c;
  ushort local_2a;
  void *local_28;
  undefined4 local_24;
  undefined2 local_20;
  ushort local_1e;
  
  if (*(int *)param_1 < 1) {
    Warning("Can\'t ent_call w/o arguments!\n");
  }
  else {
    local_50 = "";
    if (2 < *(int *)param_1) {
      local_50 = *(char **)(param_1 + 0x410);
    }
    pCVar2 = (CBasePlayer *)UTIL_GetCommandClient();
    this = (CBaseEntity *)0x0;
    while( true ) {
      this = (CBaseEntity *)GetNextCommandEntity(pCVar2,local_50,this);
      if (this == (CBaseEntity *)0x0) break;
      local_42 = 0;
      pcVar3 = "";
      local_44 = 0;
      local_4c[0] = (void *)0x0;
      if (1 < *(int *)param_1) {
        pcVar3 = *(char **)(param_1 + 0x40c);
      }
                    /* try { // try from 00610fb9 to 0061100a has its CatchHandler @ 006112a3 */
      cVar1 = CBaseEntity::CallScriptFunction(this,pcVar3,(CVariantBase *)local_4c,true);
      if (cVar1 == '\0') {
        puVar7 = &DAT_00d539c2;
        if (1 < *(int *)param_1) {
          puVar7 = *(undefined1 **)(param_1 + 0x40c);
        }
        iVar4 = (**(code **)(*g_pScriptVM + 0x48))(g_pScriptVM,puVar7,0,0);
        if (iVar4 == 0) {
          puVar7 = &DAT_00d539c2;
          if (1 < *(int *)param_1) {
            puVar7 = *(undefined1 **)(param_1 + 0x40c);
          }
                    /* try { // try from 006110b0 to 006110fe has its CatchHandler @ 006112a3 */
          puVar5 = (undefined4 *)CDirector::GetScriptScope(TheDirector,3);
          iVar4 = (**(code **)(*g_pScriptVM + 0x48))(g_pScriptVM,puVar7,*puVar5,0);
          if (iVar4 == 0) {
            puVar7 = &DAT_00d539c2;
            if (1 < *(int *)param_1) {
              puVar7 = *(undefined1 **)(param_1 + 0x40c);
            }
                    /* try { // try from 006111b0 to 006111fe has its CatchHandler @ 006112a3 */
            puVar5 = (undefined4 *)CDirector::GetScriptScope(TheDirector,1);
            iVar4 = (**(code **)(*g_pScriptVM + 0x48))(g_pScriptVM,puVar7,*puVar5,0);
            if (iVar4 == 0) {
              puVar7 = &DAT_00d539c2;
              if (1 < *(int *)param_1) {
                puVar7 = *(undefined1 **)(param_1 + 0x40c);
              }
                    /* try { // try from 00611299 to 0061129d has its CatchHandler @ 006112a3 */
              Warning("Couldn\'t find function %s anywhere!\n",puVar7);
            }
            else {
              pvVar6 = (void *)CBaseEntity::GetScriptInstance(this);
              puVar5 = (undefined4 *)CDirector::GetScriptScope(TheDirector,1);
              local_24 = 0;
              local_1e = 0;
              local_20 = 0x20;
                    /* try { // try from 0061124e to 00611250 has its CatchHandler @ 006112d3 */
              local_28 = pvVar6;
              (**(code **)(*g_pScriptVM + 0x50))(g_pScriptVM,iVar4,&local_28,1,local_4c,*puVar5,1);
              if ((local_1e & 1) != 0) {
                free(local_28);
              }
            }
          }
          else {
            pvVar6 = (void *)CBaseEntity::GetScriptInstance(this);
            puVar5 = (undefined4 *)CDirector::GetScriptScope(TheDirector,3);
            local_2a = 0;
            local_30 = 0;
            local_2c = 0x20;
                    /* try { // try from 0061114e to 00611150 has its CatchHandler @ 006112b8 */
            local_34 = pvVar6;
            (**(code **)(*g_pScriptVM + 0x50))(g_pScriptVM,iVar4,&local_34,1,local_4c,*puVar5,1);
            if ((local_2a & 1) != 0) {
              free(local_34);
            }
          }
        }
        else {
          local_40 = (void *)CBaseEntity::GetScriptInstance(this);
          local_3c = 0;
          local_36 = 0;
          local_38 = 0x20;
                    /* try { // try from 00611059 to 0061105b has its CatchHandler @ 006112c4 */
          (**(code **)(*g_pScriptVM + 0x50))(g_pScriptVM,iVar4,&local_40,1,local_4c,0,1);
          if ((local_36 & 1) != 0) {
            free(local_40);
          }
        }
      }
      if ((local_42 & 1) != 0) {
        free(local_4c[0]);
      }
    }
  }
  return;
}

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)