L L4D2node

CSentence::ParseCloseCaption

0x000db640 · 653 bytes · __thiscall

_ZN9CSentence17ParseCloseCaptionER10CUtlBuffer

Decompiled

undefined (2 params)

/* CSentence::ParseCloseCaption(CUtlBuffer&) */

void __thiscall CSentence::ParseCloseCaption(CSentence *this,CUtlBuffer *param_1)

{
  CUtlBuffer CVar1;
  char cVar2;
  int iVar3;
  uint uVar4;
  undefined4 *puVar5;
  int in_GS_OFFSET;
  byte bVar6;
  undefined1 local_2041;
  char local_2040 [32];
  char local_2020 [4096];
  undefined4 local_1020 [1024];
  int local_20;
  
  bVar6 = 0;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  do {
    CUtlBuffer::GetString(param_1,local_2020,0x1000);
    iVar3 = _V_stricmp(local_2020,"}");
    if (iVar3 == 0) {
LAB_000db8cd:
      if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
        return;
      }
                    /* WARNING: Subroutine does not return */
      __stack_chk_fail();
    }
    CUtlBuffer::GetString(param_1,local_2020,0x1000);
    iVar3 = _V_stricmp(local_2020,"{");
    if (iVar3 != 0) goto LAB_000db8cd;
    CUtlBuffer::GetString(param_1,local_2020,0x1000);
    while( true ) {
      iVar3 = _V_stricmp(local_2020,"}");
      if (iVar3 == 0) break;
      iVar3 = _V_stricmp(local_2020,"PHRASE");
      if (iVar3 != 0) break;
      puVar5 = local_1020;
      for (iVar3 = 0x400; iVar3 != 0; iVar3 = iVar3 + -1) {
        *puVar5 = 0;
        puVar5 = puVar5 + (uint)bVar6 * -2 + 1;
      }
      CUtlBuffer::GetString(param_1,local_2020,0x1000);
      V_strncpy(local_2040,local_2020,0x20);
      iVar3 = _V_stricmp(local_2040,"unicode");
      if (iVar3 != 0) {
        _V_stricmp(local_2040,"char");
      }
      CUtlBuffer::GetString(param_1,local_2020,0x1000);
      uVar4 = strtol(local_2020,(char **)0x0,10);
      if (0xfff < uVar4) {
        Warning("Invalid CloseCaption data - segment length %d is out of bounds\n",uVar4);
        break;
      }
      if (((byte)param_1[0x15] & 1) == 0) {
        cVar2 = CUtlBuffer::CheckGet(param_1,1);
        if (cVar2 != '\0') {
          *(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
        }
      }
      else {
        local_2041 = 0;
        CUtlBuffer::Scanf(param_1,"%c",&local_2041);
      }
      CUtlBuffer::Get(param_1,local_1020,uVar4);
      CVar1 = param_1[0x15];
      *(undefined1 *)((int)local_1020 + uVar4) = 0;
      if (((byte)CVar1 & 1) == 0) {
        cVar2 = CUtlBuffer::CheckGet(param_1,1);
        if (cVar2 != '\0') {
          *(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
        }
      }
      else {
        local_2041 = 0;
        CUtlBuffer::Scanf(param_1,"%c",&local_2041);
      }
      CUtlBuffer::GetString(param_1,local_2020,0x1000);
      CUtlBuffer::GetString(param_1,local_2020,0x1000);
      CUtlBuffer::GetString(param_1,local_2020,0x1000);
    }
  } while( true );
}

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)