L L4D2node

V_pretifynum

0x00049a30 · 444 bytes · __cdecl

_Z12V_pretifynumx

Decompiled

undefined (1 param)

/* WARNING: Removing unreachable block (ram,0x00049b92) */
/* V_pretifynum(long long) */

char * V_pretifynum(longlong param_1)

{
  char *__s;
  longlong lVar1;
  uint uVar2;
  int iVar3;
  size_t sVar4;
  uint uVar5;
  int iVar6;
  char *__s_00;
  longlong lVar7;
  char *pcVar8;
  int local_34;
  uint local_24;
  int local_20;
  
  iVar6 = V_pretifynum(long_long)::current * 0x20;
  V_pretifynum(long_long)::current = V_pretifynum(long_long)::current + 1 & 7;
  __s = V_pretifynum(long_long)::output + iVar6;
  V_pretifynum(long_long)::output[iVar6] = 0;
  __s_00 = __s;
  if (param_1 < 0) {
    V_snprintf(__s,0x20,"-");
    param_1 = CONCAT44(-(param_1._4_4_ + (uint)((int)param_1 != 0)),-(int)param_1);
    sVar4 = strlen(__s);
    __s_00 = __s + sVar4;
  }
  local_34 = 6;
  local_24 = 0;
  uVar5 = 1;
  local_20 = local_24;
  do {
    local_24 = local_20;
    uVar2 = (uint)((ulonglong)uVar5 * 1000);
    local_20 = (int)((ulonglong)uVar5 * 1000 >> 0x20) + local_24 * 1000;
    if ((ulonglong)param_1 < CONCAT44(local_20,uVar2)) {
      local_20 = local_24;
      local_24 = uVar5;
      break;
    }
    local_34 = local_34 + -1;
    uVar5 = uVar2;
    local_24 = uVar2;
  } while (local_34 != 0);
  lVar7 = CONCAT44(local_20,local_24);
  iVar3 = __udivdi3(param_1,local_24,local_20);
  pcVar8 = "%d";
  while( true ) {
    V_snprintf(__s_00,(iVar6 + 0xd3f00) - (int)__s_00,pcVar8,iVar3);
    if (__s_00 == (char *)0x0) {
      sVar4 = 0;
    }
    else {
      sVar4 = strlen(__s_00);
    }
    __s_00 = __s_00 + sVar4;
    lVar1 = param_1 - lVar7 * iVar3;
    param_1 = param_1 - lVar7 * iVar3;
    lVar7 = __udivdi3(lVar7,1000,0);
    if (lVar7 == 0) break;
    iVar3 = __udivdi3(lVar1,lVar7);
    pcVar8 = ",%03d";
  }
  return __s;
}

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)