L L4D2node

CRC_File

0x00114dc0 · 417 bytes · __cdecl

_Z8CRC_FilePmPKc

Decompiled

undefined (2 params)

/* CRC_File(unsigned long*, char const*) */

undefined4 CRC_File(ulong *param_1,char *param_2)

{
  int iVar1;
  uint uVar2;
  int iVar3;
  undefined4 uVar4;
  int in_GS_OFFSET;
  void *pvStack_10024;
  undefined1 auStack_10020 [65552];
  
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  CRC32_Init(param_1);
  uVar2 = COM_OpenFile(param_2,&pvStack_10024,0);
  if ((pvStack_10024 == (void *)0x0) || (uVar2 == 0xffffffff)) {
LAB_00114f20:
    uVar4 = 0;
  }
  else {
    if (0 < (int)uVar2) {
      do {
        if (uVar2 < 0x10001) {
          iVar3 = (**(code **)g_pFileSystem[1])(g_pFileSystem + 1,auStack_10020,uVar2);
        }
        else {
          iVar3 = (**(code **)g_pFileSystem[1])
                            (g_pFileSystem + 1,auStack_10020,0x10000,pvStack_10024);
        }
        if (0 < iVar3) {
          uVar2 = uVar2 - iVar3;
          CRC32_ProcessBuffer(param_1,auStack_10020,iVar3);
        }
        uVar4 = (**(code **)(*g_pFileSystem + 0x5c))(g_pFileSystem,pvStack_10024);
        if ((char)uVar4 != '\0') {
          (**(code **)(g_pFileSystem[1] + 0xc))(g_pFileSystem + 1,pvStack_10024);
          goto LAB_00114ef4;
        }
        uVar4 = (**(code **)(*g_pFileSystem + 0x58))(g_pFileSystem,pvStack_10024);
        if ((char)uVar4 == '\0') {
          if (pvStack_10024 == (void *)0x0) goto LAB_00114f20;
          (**(code **)(g_pFileSystem[1] + 0xc))(g_pFileSystem + 1,pvStack_10024);
          goto LAB_00114ef4;
        }
      } while (0 < (int)uVar2);
      if (pvStack_10024 == (void *)0x0) goto LAB_00114ef4;
    }
    (**(code **)(g_pFileSystem[1] + 0xc))(g_pFileSystem + 1,pvStack_10024);
    uVar4 = 1;
  }
LAB_00114ef4:
  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return uVar4;
}

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)