L L4D2node

CNetConsoleMgr::SendStringToNetConsoles

0x001a27b0 · 309 bytes · __thiscall

_ZN14CNetConsoleMgr23SendStringToNetConsolesEPKc

Decompiled

undefined (2 params)

/* CNetConsoleMgr::SendStringToNetConsoles(char const*) */

void __thiscall CNetConsoleMgr::SendStringToNetConsoles(CNetConsoleMgr *this,char *param_1)

{
  CSocketCreator *this_00;
  char cVar1;
  int iVar2;
  int iVar3;
  size_t sVar4;
  char *pcVar5;
  int iVar6;
  CNetConsoleMgr *pCVar7;
  int iVar8;
  undefined1 *puVar9;
  int in_GS_OFFSET;
  int iStackY_50;
  int local_38;
  char *local_34;
  CSocketCreator *local_30 [4];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  this_00 = (CSocketCreator *)(this + 4);
  iStackY_50 = 0x1a27da;
  local_30[0] = this_00;
  CSocketCreator::RunFrame(this_00);
  iStackY_50 = 0x1a27e2;
  iVar3 = CSocketCreator::GetAcceptedSocketCount(this_00);
  iVar3 = iVar3 + (uint)(*(int *)(this + 0x13c) != -1);
  puVar9 = &stack0xffffffb4;
  if (iVar3 != 0) {
    iStackY_50 = 0x1a2818;
    sVar4 = strlen(param_1);
    cVar1 = *param_1;
    iVar2 = -((sVar4 * 2 + 0x10 & 0xfffffff0) + 0x10);
    local_34 = (char *)((int)local_30 + iVar2);
    pcVar5 = local_34;
    while (cVar1 != '\0') {
      if (cVar1 == '\n') {
        *pcVar5 = '\r';
        pcVar5 = pcVar5 + 1;
      }
      cVar1 = *param_1;
      param_1 = param_1 + 1;
      *pcVar5 = cVar1;
      pcVar5 = pcVar5 + 1;
      cVar1 = *param_1;
    }
    *pcVar5 = '\0';
    puVar9 = (undefined1 *)((int)local_30 + iVar2 + -0x1c);
    if (0 < iVar3) {
      iVar8 = 0;
      local_38 = (int)pcVar5 - (int)local_34;
      do {
        iVar6 = iVar8;
        if ((*(int *)(this + 0x13c) == -1) || (iVar6 = iVar8 + -1, iVar8 != 0)) {
          *(int *)(&stack0xffffffb8 + iVar2) = iVar6;
          *(CSocketCreator **)((int)local_30 + iVar2 + -0x1c) = local_30[0];
          *(undefined4 *)((int)&iStackY_50 + iVar2) = 0x1a288f;
          pCVar7 = (CNetConsoleMgr *)
                   CSocketCreator::GetAcceptedSocketData
                             (*(CSocketCreator **)((int)local_30 + iVar2 + -0x1c),
                              *(int *)(&stack0xffffffb8 + iVar2));
        }
        else {
          pCVar7 = this + 0x13c;
        }
        iVar6 = local_38;
        if ((pCVar7[0x808] != (CNetConsoleMgr)0x0) && (pCVar7[0x809] == (CNetConsoleMgr)0x0)) {
          *(undefined4 *)(&stack0xffffffc0 + iVar2) = 0x4000;
          *(int *)(&stack0xffffffbc + iVar2) = iVar6;
          *(char **)(&stack0xffffffb8 + iVar2) = local_34;
          *(undefined4 *)((int)local_30 + iVar2 + -0x1c) = *(undefined4 *)pCVar7;
          *(undefined4 *)((int)&iStackY_50 + iVar2) = 0x1a28e8;
          send(*(int *)((int)local_30 + iVar2 + -0x1c),*(void **)(&stack0xffffffb8 + iVar2),
               *(size_t *)(&stack0xffffffbc + iVar2),*(int *)(&stack0xffffffc0 + iVar2));
        }
        iVar8 = iVar8 + 1;
        puVar9 = (undefined1 *)((int)local_30 + iVar2 + -0x1c);
      } while (iVar8 != iVar3);
    }
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  *(undefined **)(puVar9 + -4) = &UNK_001a28f9;
  __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)