L L4D2node

Info_FindLargestKey

0x002024e0 · 291 bytes · __cdecl

_Z19Info_FindLargestKeyPci

Decompiled

undefined (2 params)

/* Info_FindLargestKey(char*, int) */

undefined1 * Info_FindLargestKey(char *param_1,int param_2)

{
  char cVar1;
  char cVar2;
  int iVar3;
  int iVar4;
  char *pcVar5;
  char *pcVar6;
  char *pcVar7;
  int in_GS_OFFSET;
  int local_1030;
  char local_1020 [2048];
  char local_820 [2048];
  int local_20;
  
  Info_FindLargestKey(char*,int)::largest_key[0] = 0;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  cVar2 = *param_1;
  if (cVar2 == '\\') {
    cVar2 = param_1[1];
    param_1 = param_1 + 1;
  }
  local_1030 = 0;
  while (cVar2 != '\0') {
    pcVar7 = local_1020;
    pcVar6 = local_1020;
    if (cVar2 != '\\') {
      do {
        pcVar7 = pcVar6 + 1;
        param_1 = param_1 + 1;
        *pcVar6 = cVar2;
        cVar2 = *param_1;
        if (cVar2 == '\\') break;
        pcVar6 = pcVar7;
      } while (cVar2 != '\0');
    }
    *pcVar7 = '\0';
    iVar3 = _V_strlen(local_1020);
    if (*param_1 == '\0') break;
    cVar2 = param_1[1];
    pcVar7 = param_1 + 1;
    pcVar6 = local_820;
    if (cVar2 == '\\') {
      pcVar5 = local_820;
      cVar1 = '\\';
    }
    else {
      do {
        pcVar5 = pcVar6;
        cVar1 = '\0';
        if (cVar2 == '\0') break;
        pcVar5 = pcVar6 + 1;
        pcVar7 = pcVar7 + 1;
        *pcVar6 = cVar2;
        cVar2 = *pcVar7;
        pcVar6 = pcVar5;
        cVar1 = cVar2;
      } while (cVar2 != '\\');
    }
    *pcVar5 = '\0';
    param_1 = pcVar7 + (cVar1 != '\0');
    iVar4 = _V_strlen(local_820);
    if ((local_1030 < iVar3 + iVar4) && (cVar2 = Info_IsKeyImportant(local_1020), cVar2 == '\0')) {
      V_strncpy(Info_FindLargestKey(char*,int)::largest_key,local_1020,0x800);
      local_1030 = iVar3 + iVar4;
    }
    cVar2 = *param_1;
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return Info_FindLargestKey(char*,int)::largest_key;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)