L L4D2node

V_UTF8ToUCS2

0x0004a110 · 143 bytes · __cdecl

_Z12V_UTF8ToUCS2PKciPti

Decompiled

undefined (4 params)

/* V_UTF8ToUCS2(char const*, int, unsigned short*, int) */

int V_UTF8ToUCS2(char *param_1,int param_2,ushort *param_3,int param_4)

{
  iconv_t __cd;
  size_t sVar1;
  int iVar2;
  size_t local_2c;
  size_t local_28;
  char *local_24;
  ushort *local_20 [4];
  
  *param_3 = 0;
  __cd = iconv_open("UCS-2LE","UTF-8");
  local_20[0] = param_3;
  local_2c = param_2;
  local_28 = param_4;
  local_24 = param_1;
  iVar2 = -1;
  if (__cd != (iconv_t)0x0) {
    sVar1 = iconv(__cd,&local_24,&local_2c,(char **)local_20,&local_28);
    iconv_close(__cd);
    iVar2 = 0;
    if (-1 < (int)sVar1) {
      iVar2 = param_2;
    }
  }
  *(undefined2 *)((int)param_3 + ((param_4 & 0xfffffffeU) - 2)) = 0;
  return iVar2;
}

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)