L L4D2node

KeyValues::GetColor

0x00b6f250 · 261 bytes · __cdecl

_ZN9KeyValues8GetColorEPKcRK5Color

Decompiled

undefined (2 params)

/* KeyValues::GetColor(char const*, Color const&) */

char * KeyValues::GetColor(char *param_1,Color *param_2)

{
  char cVar1;
  int iVar2;
  char *in_stack_0000000c;
  undefined4 *in_stack_00000010;
  float local_1c;
  float local_18;
  float local_14;
  float local_10 [2];
  
  *(undefined4 *)param_1 = *in_stack_00000010;
  iVar2 = FindKey((KeyValues *)param_2,in_stack_0000000c,false);
  if (iVar2 != 0) {
    cVar1 = *(char *)(iVar2 + 0x10);
    if (cVar1 == '\x06') {
      *param_1 = *(char *)(iVar2 + 0xc);
      param_1[1] = *(char *)(iVar2 + 0xd);
      cVar1 = *(char *)(iVar2 + 0xf);
      param_1[2] = *(char *)(iVar2 + 0xe);
      param_1[3] = cVar1;
      return param_1;
    }
    if (cVar1 == '\x03') {
      *param_1 = (char)(int)*(float *)(iVar2 + 0xc);
      return param_1;
    }
    if (cVar1 == '\x02') {
      *param_1 = (char)*(undefined4 *)(iVar2 + 0xc);
      return param_1;
    }
    if (cVar1 == '\x01') {
      sscanf(*(char **)(iVar2 + 4),"%f %f %f %f",&local_1c,&local_18,&local_14,local_10);
      *param_1 = (char)(int)local_1c;
      param_1[1] = (char)(int)local_18;
      param_1[2] = (char)(int)local_14;
      param_1[3] = (char)(int)local_10[0];
    }
  }
  return param_1;
}

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)