UniqueIdFromString
0x00bdd310 · 431 bytes · __cdecl
_Z18UniqueIdFromStringP10UniqueId_tPKci
Decompiled
undefined (3 params)
/* UniqueIdFromString(UniqueId_t*, char const*, int) */
undefined4 UniqueIdFromString(UniqueId_t *param_1,char *param_2,int param_3)
{
char cVar1;
int iVar2;
char *pcVar3;
uint uVar4;
char *pcVar5;
char *pcVar6;
int in_GS_OFFSET;
int iStackY_50;
char acStack_41 [9];
char *local_38;
char *local_34;
char *local_30;
undefined1 local_24 [4];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
local_34 = param_2;
if (param_3 == 0) {
iStackY_50 = 0xbdd4bb;
param_3 = _V_strlen(param_2);
}
pcVar3 = local_34;
local_30 = (char *)param_3;
iVar2 = -(((uint)(param_3 + 0x10) & 0xfffffff0) + 0x10);
pcVar5 = acStack_41 + iVar2 + 1;
*(char **)(&stack0xffffffbc + iVar2) = (char *)(param_3 + 1);
*(char **)(&stack0xffffffb8 + iVar2) = pcVar3;
*(char **)(&stack0xffffffb4 + iVar2) = pcVar5;
local_38 = pcVar5;
*(undefined4 *)((int)&iStackY_50 + iVar2) = 0xbdd367;
V_strncpy(*(char **)(&stack0xffffffb4 + iVar2),*(char **)(&stack0xffffffb8 + iVar2),
*(int *)(&stack0xffffffbc + iVar2));
pcVar6 = local_30 + -1;
pcVar3 = pcVar6;
if (((-1 < (int)pcVar6) && ((int)local_30[(int)(acStack_41 + iVar2)] - 9U < 0x18)) &&
((1 << ((byte)((int)local_30[(int)(acStack_41 + iVar2)] - 9U) & 0x1f) & 0x80001fU) != 0)) {
local_30 = local_38;
while (pcVar6 = pcVar6 + -1, pcVar6 != &DAT_ffffffff) {
pcVar3 = pcVar6;
if ((0x17 < (int)pcVar5[(int)pcVar6] - 9U) ||
((1 << ((byte)((int)pcVar5[(int)pcVar6] - 9U) & 0x1f) & 0x80001fU) == 0))
goto LAB_00bdd390;
}
pcVar3 = &DAT_ffffffff;
}
LAB_00bdd390:
pcVar3[(int)(acStack_41 + iVar2 + 2)] = '\0';
if ((*pcVar5 != '\0') &&
((uVar4 = (int)*pcVar5 - 9, uVar4 < 0x18 &&
(pcVar5 = local_38, (1 << ((byte)uVar4 & 0x1f) & 0x80001fU) != 0)))) {
while( true ) {
cVar1 = pcVar5[1];
if (cVar1 == '\0') break;
uVar4 = (int)cVar1 - 9;
if ((0x17 < uVar4) || (pcVar5 = pcVar5 + 1, (1 << ((byte)uVar4 & 0x1f) & 0x80001fU) == 0))
break;
}
}
*(undefined4 *)(&stack0xffffffbc + iVar2) = 0x10;
*(undefined4 *)(&stack0xffffffb8 + iVar2) = 0;
*(UniqueId_t **)(&stack0xffffffb4 + iVar2) = param_1;
*(undefined4 *)((int)&iStackY_50 + iVar2) = 0xbdd3f8;
_V_memset(*(void **)(&stack0xffffffb4 + iVar2),*(int *)(&stack0xffffffb8 + iVar2),
*(int *)(&stack0xffffffbc + iVar2));
if (0 < (int)pcVar6) {
*(undefined1 **)(&stack0xffffffb4 + iVar2) = local_24;
*(undefined4 *)((int)&iStackY_50 + iVar2) = 0xbdd407;
CRC32_Init(*(ulong **)(&stack0xffffffb4 + iVar2));
pcVar5 = local_34;
*(char **)(&stack0xffffffbc + iVar2) = pcVar6;
*(undefined1 **)(&stack0xffffffb4 + iVar2) = local_24;
*(char **)(&stack0xffffffb8 + iVar2) = pcVar5;
*(undefined4 *)((int)&iStackY_50 + iVar2) = 0xbdd41a;
CRC32_ProcessBuffer(*(ulong **)(&stack0xffffffb4 + iVar2),*(void **)(&stack0xffffffb8 + iVar2),
*(int *)(&stack0xffffffbc + iVar2));
*(undefined1 **)(&stack0xffffffb4 + iVar2) = local_24;
*(undefined4 *)((int)&iStackY_50 + iVar2) = 0xbdd422;
CRC32_Final(*(ulong **)(&stack0xffffffb4 + iVar2));
*(undefined4 *)(&stack0xffffffbc + iVar2) = 4;
*(undefined1 **)(&stack0xffffffb8 + iVar2) = local_24;
*(UniqueId_t **)(&stack0xffffffb4 + iVar2) = param_1;
*(undefined4 *)((int)&iStackY_50 + iVar2) = 0xbdd436;
_V_memcpy(*(void **)(&stack0xffffffb4 + iVar2),*(void **)(&stack0xffffffb8 + iVar2),
*(int *)(&stack0xffffffbc + iVar2));
}
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
*(undefined **)((int)&iStackY_50 + iVar2) = &UNK_00bdd4d2;
__stack_chk_fail();
}
return 1;
}
SourceMod gamedata
paste intoaddons/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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.