L L4D2node

DumpScriptScope

0x00610d50 · 373 bytes · __cdecl

_Z15DumpScriptScopeP11CBasePlayerPKc

Decompiled

undefined (2 params)

/* DumpScriptScope(CBasePlayer*, char const*) */

void DumpScriptScope(CBasePlayer *param_1,char *param_2)

{
  undefined4 uVar1;
  CBaseEntity *this;
  void *local_34;
  undefined4 local_30;
  undefined2 local_2c;
  ushort local_2a;
  undefined1 *local_28;
  undefined4 local_24;
  undefined2 local_20;
  ushort local_1e;
  
  this = (CBaseEntity *)0x0;
  while( true ) {
    this = (CBaseEntity *)GetNextCommandEntity(param_1,param_2,this);
    if (this == (CBaseEntity *)0x0) break;
    if (*(int *)(this + 1000) == -1) {
      uVar1 = CBaseEntity::GetDebugName(this);
      DevWarning("ent_script_dump: Entity %s has no script scope!\n",uVar1);
    }
    else {
      uVar1 = CBaseEntity::GetDebugName(this);
      Msg("----Script Dump for entity %s\n",uVar1);
      uVar1 = (**(code **)(*g_pScriptVM + 0x48))(g_pScriptVM,"__DumpScope",0,0);
      local_30 = 0;
      local_34 = (void *)0x1;
      local_24 = 0;
      local_28 = (undefined1 *)0x0;
      if (*(undefined1 **)(this + 1000) != &DAT_ffffffff) {
        local_28 = *(undefined1 **)(this + 1000);
      }
      local_2a = 0;
      local_1e = 0;
      local_2c = 5;
      local_20 = 0x20;
                    /* try { // try from 00610e43 to 00610e45 has its CatchHandler @ 00610ed0 */
      (**(code **)(*g_pScriptVM + 0x50))(g_pScriptVM,uVar1,&local_34,2,0,0,1);
      if ((local_1e & 1) != 0) {
        free(local_28);
        local_1e = local_1e & 0xfffe;
      }
      local_28 = (undefined1 *)0x0;
      local_24 = 0;
      local_20 = 0;
      if ((local_2a & 1) != 0) {
        free(local_34);
      }
      (**(code **)(*g_pScriptVM + 0x4c))(g_pScriptVM,uVar1);
      Msg("----End Script Dump\n");
    }
  }
  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)