L L4D2node

String_Decode

0x00148900 · 407 bytes · __cdecl

_Z13String_DecodeP10DecodeInfo

Decompiled

undefined (1 param)

/* String_Decode(DecodeInfo*) */

void String_Decode(DecodeInfo *param_1)

{
  int iVar1;
  uint *puVar2;
  undefined4 *puVar3;
  uint uVar4;
  int iVar5;
  uint uVar6;
  DecodeInfo *pDVar7;
  uint uVar8;
  
  iVar5 = *(int *)(param_1 + 0x28);
  iVar1 = *(int *)(iVar5 + 0x14);
  if (iVar1 < 9) {
    puVar2 = *(uint **)(iVar5 + 0x18);
    uVar6 = *(uint *)(iVar5 + 0x10);
    if (puVar2 == *(uint **)(iVar5 + 0x1c)) {
      *(undefined4 *)(iVar5 + 0x14) = 1;
      *(undefined4 *)(iVar5 + 0x10) = 0;
      *(uint **)(iVar5 + 0x18) = puVar2 + 1;
      *(undefined1 *)(iVar5 + 4) = 1;
    }
    else if (*(uint **)(iVar5 + 0x1c) < puVar2) {
      *(undefined1 *)(iVar5 + 4) = 1;
      *(undefined4 *)(iVar5 + 0x10) = 0;
    }
    else {
      *(uint **)(iVar5 + 0x18) = puVar2 + 1;
      uVar8 = *puVar2;
      *(uint *)(iVar5 + 0x10) = uVar8;
      if (*(char *)(iVar5 + 4) == '\0') {
        uVar4 = (&CBitBuffer::s_nMaskTable)[9 - iVar1];
        *(int *)(iVar5 + 0x14) = iVar1 + 0x17;
        uVar6 = (uVar4 & uVar8) << ((byte)iVar1 & 0x1f) | uVar6;
        *(uint *)(iVar5 + 0x10) = uVar8 >> ((byte)(9 - iVar1) & 0x1f);
        goto LAB_00148936;
      }
    }
    uVar8 = 0;
    iVar5 = 0;
    goto LAB_0014897a;
  }
  *(int *)(iVar5 + 0x14) = iVar1 + -9;
  uVar6 = *(uint *)(iVar5 + 0x10) & 0x1ff;
  if (iVar1 + -9 == 0) {
    puVar3 = *(undefined4 **)(iVar5 + 0x18);
    *(undefined4 *)(iVar5 + 0x14) = 0x20;
    if (puVar3 == *(undefined4 **)(iVar5 + 0x1c)) {
      *(undefined4 *)(iVar5 + 0x14) = 1;
      *(undefined4 *)(iVar5 + 0x10) = 0;
      *(undefined4 **)(iVar5 + 0x18) = puVar3 + 1;
      goto LAB_00148936;
    }
    if (puVar3 <= *(undefined4 **)(iVar5 + 0x1c)) {
      *(undefined4 **)(iVar5 + 0x18) = puVar3 + 1;
      *(undefined4 *)(iVar5 + 0x10) = *puVar3;
      goto LAB_00148936;
    }
    *(undefined1 *)(iVar5 + 4) = 1;
    *(undefined4 *)(iVar5 + 0x10) = 0;
    if (0x1ff < uVar6) goto LAB_001489f8;
  }
  else {
    *(uint *)(iVar5 + 0x10) = *(uint *)(iVar5 + 0x10) >> 9;
LAB_00148936:
    if (0x1ff < (int)uVar6) {
LAB_001489f8:
      uVar8 = 0x1ff;
      Warning("String_Decode( %s ) invalid length (%d)\n",**(undefined4 **)param_1,uVar6);
      iVar5 = 0xff8;
      goto LAB_0014897a;
    }
  }
  iVar5 = uVar6 * 8;
  uVar8 = uVar6;
LAB_0014897a:
  pDVar7 = param_1 + 0x2c;
  CBitRead::ReadBits(*(CBitRead **)(param_1 + 0x28),pDVar7,iVar5);
  pDVar7[uVar8] = (DecodeInfo)0x0;
  *(DecodeInfo **)(param_1 + 4) = pDVar7;
  if (*(int *)param_1 != 0) {
    (**(code **)(*(int *)param_1 + 0x20))
              (param_1,*(undefined4 *)(param_1 + 0x1c),*(undefined4 *)(param_1 + 0x20));
  }
  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)