L L4D2node

CDebugHistory::AddDebugHistoryLine

0x0068c600 · 328 bytes · __thiscall

_ZN13CDebugHistory19AddDebugHistoryLineEiPKc

Decompiled

undefined (3 params)

/* CDebugHistory::AddDebugHistoryLine(int, char const*) */

void __thiscall CDebugHistory::AddDebugHistoryLine(CDebugHistory *this,int param_1,char *param_2)

{
  CDebugHistory *pCVar1;
  size_t sVar2;
  int iVar3;
  CDebugHistory *__dest;
  CDebugHistory *__n;
  char *pcVar4;
  int in_GS_OFFSET;
  byte bVar5;
  char local_120 [255];
  undefined1 local_21;
  int local_20;
  
  bVar5 = 0;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if ((uint)param_1 < 5) {
    __dest = *(CDebugHistory **)(this + param_1 * 4 + 0x138c40);
    if (__dest != (CDebugHistory *)0x0) {
      sVar2 = strlen(param_2);
      sVar2 = sVar2 + 1;
      if ((int)sVar2 < 0x101) {
        if (sVar2 == 0) goto LAB_0068c6e6;
      }
      else {
        pcVar4 = local_120;
        for (iVar3 = 0x40; iVar3 != 0; iVar3 = iVar3 + -1) {
          *(undefined4 *)pcVar4 = *(undefined4 *)param_2;
          param_2 = param_2 + (uint)bVar5 * -8 + 4;
          pcVar4 = pcVar4 + ((uint)bVar5 * -2 + 1) * 4;
        }
        local_21 = 0;
        sVar2 = 0x100;
        param_2 = local_120;
      }
      pCVar1 = this + param_1 * 0x3e800 + 0x440;
      __n = pCVar1 + (0x3e800 - (int)__dest);
      if ((int)__n <= (int)sVar2) {
        do {
          memcpy(__dest,param_2,(size_t)__n);
          param_2 = param_2 + (int)__n;
          sVar2 = sVar2 - (int)__n;
          *(CDebugHistory **)(this + param_1 * 4 + 0x138c40) = pCVar1;
          if (sVar2 == 0) goto LAB_0068c6e6;
          __n = (CDebugHistory *)0x3e800;
          __dest = pCVar1;
        } while (0x3e7ff < (int)sVar2);
      }
      memcpy(__dest,param_2,sVar2);
      *(size_t *)(this + param_1 * 4 + 0x138c40) = *(int *)(this + param_1 * 4 + 0x138c40) + sVar2;
    }
  }
  else {
    Warning("Attempted to add a debughistory line to category %d. Valid categories are %d to %d.\n",
            param_1,0,4);
  }
LAB_0068c6e6:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)