L L4D2node

CErrorText::BuildCommentExtended

0x00217e00 · 1423 bytes · __thiscall

_ZN10CErrorText20BuildCommentExtendedEi

Decompiled

undefined (2 params)

/* CErrorText::BuildCommentExtended(int) */

void __thiscall CErrorText::BuildCommentExtended(CErrorText *this,int param_1)

{
  float fVar1;
  char cVar2;
  char *pcVar3;
  undefined4 uVar4;
  int *piVar5;
  ConVar *this_00;
  uint uVar6;
  CUtlMemory<unsigned_char,int> *this_01;
  undefined4 uVar7;
  undefined4 uVar8;
  int iVar9;
  int iVar10;
  int in_GS_OFFSET;
  longdouble lVar11;
  undefined1 *local_2c8;
  int local_2c4;
  int local_2bc [5];
  char local_2a8 [128];
  char local_228 [260];
  char local_124 [260];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
                    /* try { // try from 00217e40 to 00217e8e has its CatchHandler @ 00218435 */
  V_strncat(*(char **)(this + 4),"\nPlugins Loaded\n",param_1,-1);
  V_strncat(*(char **)(this + 4),g_pServerPluginHandler + 0x41c,param_1,-1);
  V_strncat(*(char **)(this + 4),"\nAddons Loaded\n",param_1,-1);
  local_2bc[0] = 0;
  local_2bc[1] = 0;
  local_2bc[2] = 0;
  local_2bc[3] = 0;
  local_2bc[4] = 0;
                    /* try { // try from 00217ed5 to 0021803d has its CatchHandler @ 00218428 */
  (**(code **)(*g_pFileSystem + 0x1b8))(g_pFileSystem,local_2bc);
  if (0 < local_2bc[3]) {
    iVar9 = 0;
    do {
      pcVar3 = (char *)CUtlString::Get((CUtlString *)(local_2bc[0] + iVar9 * 0x10));
      V_FileBase(pcVar3,local_124,0x80);
      uVar4 = CUtlString::Get((CUtlString *)(iVar9 * 0x10 + local_2bc[0]));
      V_snprintf(local_124,0x80,"%s\n",uVar4);
      V_strncat(*(char **)(this + 4),local_124,param_1,-1);
      iVar9 = iVar9 + 1;
    } while (iVar9 < local_2bc[3]);
  }
  V_strncat(*(char **)(this + 4),"\nConVars (non-default)\n\n",param_1,-1);
  V_snprintf(local_2a8,0x80,"%s\t%s\t%s\n","var","value","default");
  V_strncat(*(char **)(this + 4),local_2a8,param_1,-1);
  iVar9 = _V_strlen(*(char **)(this + 4));
  if (iVar9 < param_1) {
    local_2c4 = param_1 - iVar9;
    local_2c8 = (undefined1 *)(iVar9 + *(int *)(this + 4));
    piVar5 = (int *)(**(code **)(*g_pCVar + 0x98))(g_pCVar);
                    /* try { // try from 00218045 to 002181cf has its CatchHandler @ 00218381 */
    (**(code **)(*piVar5 + 8))(piVar5);
    while (cVar2 = (**(code **)(*piVar5 + 0x10))(piVar5), cVar2 != '\0') {
      this_00 = (ConVar *)(**(code **)(*piVar5 + 0x14))(piVar5);
      cVar2 = (**(code **)(*(int *)this_00 + 8))(this_00);
      if ((cVar2 == '\0') &&
         (uVar6 = (**(code **)(*(int *)this_00 + 0x18))(this_00), (uVar6 & 0x20000020) == 0)) {
        uVar6 = (**(code **)(*(int *)this_00 + 0x18))(this_00);
        if ((uVar6 & 0x1000) == 0) {
          pcVar3 = "FCVAR_NEVER_AS_STRING";
          if (((byte)this_00[0x15] & 0x10) == 0) {
            pcVar3 = "";
            if (*(char **)(*(int *)(this_00 + 0x1c) + 0x24) != (char *)0x0) {
              pcVar3 = *(char **)(*(int *)(this_00 + 0x1c) + 0x24);
            }
          }
          pcVar3 = (char *)Host_CleanupConVarStringValue(pcVar3);
          V_strncpy(local_228,pcVar3,0x104);
          pcVar3 = (char *)ConVar::GetDefault(this_00);
          pcVar3 = (char *)Host_CleanupConVarStringValue(pcVar3);
          V_strncpy(local_124,pcVar3,0x104);
          iVar9 = _V_stricmp(local_228,local_124);
          if (iVar9 != 0) {
LAB_00218119:
            uVar6 = (**(code **)(*(int *)this_00 + 0x18))(this_00);
            if ((uVar6 & 0x1000) == 0) {
              uVar4 = ConVar::GetDefault(this_00);
              pcVar3 = "FCVAR_NEVER_AS_STRING";
              if (((byte)this_00[0x15] & 0x10) == 0) {
                pcVar3 = "";
                if (*(char **)(*(int *)(this_00 + 0x1c) + 0x24) != (char *)0x0) {
                  pcVar3 = *(char **)(*(int *)(this_00 + 0x1c) + 0x24);
                }
              }
              uVar7 = Host_CleanupConVarStringValue(pcVar3);
              uVar8 = (**(code **)(*(int *)this_00 + 0x1c))(this_00);
              iVar9 = V_snprintf(local_124,0x104,"%s\n\t\'%s\' \'%s\'\n",uVar8,uVar7,uVar4);
            }
            else {
              pcVar3 = (char *)ConVar::GetDefault(this_00);
              lVar11 = (longdouble)V_atof(pcVar3);
              fVar1 = *(float *)(*(int *)(this_00 + 0x1c) + 0x2c);
              uVar4 = (**(code **)(*(int *)this_00 + 0x1c))(this_00);
              iVar9 = V_snprintf(local_124,0x104,"%s\n\t\'%f\' \'%f\'\n",uVar4,(double)fVar1,
                                 (double)(float)lVar11);
            }
            if (local_2c4 < iVar9) {
              iVar9 = local_2c4;
            }
            if (iVar9 < 1) break;
            _V_memcpy(local_2c8,local_124,iVar9);
            local_2c4 = local_2c4 - iVar9;
            local_2c8 = local_2c8 + iVar9;
            if (local_2c4 < 1) break;
          }
        }
        else {
          fVar1 = *(float *)(*(int *)(this_00 + 0x1c) + 0x2c);
                    /* try { // try from 002182e3 to 0021837b has its CatchHandler @ 00218381 */
          pcVar3 = (char *)ConVar::GetDefault(this_00);
          lVar11 = (longdouble)V_atof(pcVar3);
          if ((float)lVar11 != fVar1) goto LAB_00218119;
        }
      }
      (**(code **)(*piVar5 + 0xc))(piVar5);
    }
    *local_2c8 = 0;
    (**(code **)(*piVar5 + 4))(piVar5);
  }
                    /* try { // try from 00218224 to 00218252 has its CatchHandler @ 00218428 */
  V_strncat(*(char **)(this + 4),"\nConsole History (reversed)\n\n",param_1,-1);
  iVar9 = _V_strlen(*(char **)(this + 4));
  if (iVar9 < param_1) {
    GetSpew((char *)(iVar9 + *(int *)(this + 4)),param_1 - iVar9);
  }
  iVar9 = local_2bc[3] + -1;
  iVar10 = iVar9 * 0x10;
  if (-1 < iVar9) {
    do {
      iVar9 = iVar9 + -1;
      this_01 = (CUtlMemory<unsigned_char,int> *)(local_2bc[0] + iVar10);
      iVar10 = iVar10 + -0x10;
      CUtlMemory<unsigned_char,int>::Purge(this_01);
    } while (iVar9 != -1);
  }
  local_2bc[3] = 0;
  CUtlMemory<CUtlString,int>::Purge((CUtlMemory<CUtlString,int> *)local_2bc);
  local_2bc[4] = local_2bc[0];
  CUtlMemory<CUtlString,int>::Purge((CUtlMemory<CUtlString,int> *)local_2bc);
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  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)