L L4D2node

NET_BufferToBufferDecompress

0x001c51f0 · 228 bytes · __cdecl

_Z28NET_BufferToBufferDecompressPcPjS_j

Decompiled

undefined (4 params)

/* NET_BufferToBufferDecompress(char*, unsigned int*, char*, unsigned int) */

undefined4 NET_BufferToBufferDecompress(char *param_1,uint *param_2,char *param_3,uint param_4)

{
  uint uVar1;
  uint uVar2;
  undefined4 uVar3;
  CLZSS local_28 [8];
  undefined4 local_20;
  
  uVar3 = 0;
  if (8 < param_4) {
    local_20 = 0x1000;
    uVar3 = CLZSS::IsCompressed(local_28,(uchar *)param_3);
    if ((char)uVar3 == '\0') {
      if (param_4 <= *param_2) {
        _V_memcpy(param_1,param_3,param_4);
        *param_2 = param_4;
        return 1;
      }
      Warning("NET_BufferToBufferDecompress with improperly sized dest buffer (%u in, %u needed)\n",
              *param_2);
      return uVar3;
    }
    uVar1 = CLZSS::GetActualSize(local_28,(uchar *)param_3);
    uVar2 = *param_2;
    if (uVar2 < uVar1) {
      uVar3 = 0;
      Warning("NET_BufferToBufferDecompress with improperly sized dest buffer (%u in, %u needed)\n",
              uVar2,uVar1);
    }
    else {
      uVar2 = CLZSS::SafeUncompress(local_28,(uchar *)param_3,param_4,(uchar *)param_1,uVar2);
      *param_2 = uVar2;
    }
  }
  return uVar3;
}

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)