CCountedStringPool::RestoreFromBuffer
0x00b79af0 · 1912 bytes · __thiscall
_ZN18CCountedStringPool17RestoreFromBufferER10CUtlBuffer
Decompiled
undefined (2 params)
/* CCountedStringPool::RestoreFromBuffer(CUtlBuffer&) */
bool __thiscall CCountedStringPool::RestoreFromBuffer(CCountedStringPool *this,CUtlBuffer *param_1)
{
char cVar1;
int iVar2;
char *pcVar3;
int iVar4;
uint *puVar5;
byte bVar6;
undefined2 uVar7;
uint uVar8;
int iVar9;
undefined2 *puVar10;
int in_GS_OFFSET;
bool bVar11;
uint local_438;
uint local_434;
uint local_428;
undefined4 local_424;
char local_420 [1024];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (((byte)param_1[0x15] & 1) == 0) {
cVar1 = CUtlBuffer::CheckGet(param_1,4);
bVar11 = false;
if (cVar1 == '\0') goto LAB_00b79b4d;
if (((byte)param_1[0x34] & 1) == 0) {
iVar9 = *(int *)(param_1 + 0xc);
uVar8 = *(uint *)(*(int *)param_1 + (iVar9 - *(int *)(param_1 + 0x20)));
}
else {
puVar5 = (uint *)((*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (puVar5 == (uint *)0x0) {
puVar5 = &local_428;
}
local_424 = local_428;
local_424._1_3_ = (undefined3)(local_428 >> 8);
local_424 = CONCAT31(local_424._1_3_,*(undefined1 *)((int)puVar5 + 3));
local_424._2_2_ = (undefined2)(local_428 >> 0x10);
local_424._0_2_ = CONCAT11(*(undefined1 *)((int)puVar5 + 2),*(undefined1 *)((int)puVar5 + 3));
local_424._3_1_ = (undefined1)(local_428 >> 0x18);
local_424._0_3_ = CONCAT12(*(undefined1 *)((int)puVar5 + 1),(undefined2)local_424);
local_424 = CONCAT13((char)*puVar5,(undefined3)local_424);
_V_memcpy(&local_428,&local_424,4);
iVar9 = *(int *)(param_1 + 0xc);
uVar8 = local_428;
}
*(int *)(param_1 + 0xc) = iVar9 + 4;
}
else {
local_428 = 0;
CUtlBuffer::Scanf(param_1,"%d",&local_428);
uVar8 = local_428;
}
bVar11 = false;
if (uVar8 != 0x31505343) goto LAB_00b79b4d;
FreeAll(this);
if (((byte)param_1[0x15] & 1) == 0) {
cVar1 = CUtlBuffer::CheckGet(param_1,2);
uVar7 = 0;
if (cVar1 != '\0') {
if (((byte)param_1[0x34] & 1) == 0) {
iVar9 = *(int *)(param_1 + 0xc);
uVar7 = *(undefined2 *)(*(int *)param_1 + (iVar9 - *(int *)(param_1 + 0x20)));
}
else {
puVar5 = (uint *)((*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (puVar5 == (uint *)0x0) {
puVar5 = &local_428;
}
uVar7 = local_424._2_2_;
local_424 = CONCAT22(local_424._2_2_,(undefined2)local_428);
local_424 = CONCAT31(local_424._1_3_,*(undefined1 *)((int)puVar5 + 1));
local_424._0_2_ = CONCAT11((char)*puVar5,*(undefined1 *)((int)puVar5 + 1));
local_424 = CONCAT22(uVar7,(undefined2)local_424);
_V_memcpy(&local_428,&local_424,2);
iVar9 = *(int *)(param_1 + 0xc);
uVar7 = (undefined2)local_428;
}
*(int *)(param_1 + 0xc) = iVar9 + 2;
}
}
else {
local_428 = local_428 & 0xffff0000;
CUtlBuffer::Scanf(param_1,"%u",&local_428);
uVar7 = (undefined2)local_428;
}
*(undefined2 *)(this + 0x2c) = uVar7;
if (((byte)param_1[0x15] & 1) == 0) {
cVar1 = CUtlBuffer::CheckGet(param_1,4);
if (cVar1 != '\0') {
if (((byte)param_1[0x34] & 1) == 0) {
iVar9 = *(int *)(param_1 + 0xc);
uVar8 = *(uint *)(*(int *)param_1 + (iVar9 - *(int *)(param_1 + 0x20)));
}
else {
puVar5 = (uint *)((*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (puVar5 == (uint *)0x0) {
puVar5 = &local_428;
}
local_424 = local_428;
local_424._1_3_ = (undefined3)(local_428 >> 8);
local_424 = CONCAT31(local_424._1_3_,*(undefined1 *)((int)puVar5 + 3));
local_424._2_2_ = (undefined2)(local_428 >> 0x10);
local_424._0_2_ =
CONCAT11(*(undefined1 *)((int)puVar5 + 2),*(undefined1 *)((int)puVar5 + 3));
local_424._3_1_ = (undefined1)(local_428 >> 0x18);
local_424._0_3_ = CONCAT12(*(undefined1 *)((int)puVar5 + 1),(undefined2)local_424);
local_424 = CONCAT13((char)*puVar5,(undefined3)local_424);
_V_memcpy(&local_428,&local_424,4);
iVar9 = *(int *)(param_1 + 0xc);
uVar8 = local_428;
}
*(int *)(param_1 + 0xc) = iVar9 + 4;
goto LAB_00b79c2b;
}
*(undefined4 *)(this + 0x10) = 0;
}
else {
local_428 = 0;
CUtlBuffer::Scanf(param_1,"%d",&local_428);
uVar8 = local_428;
LAB_00b79c2b:
*(undefined4 *)(this + 0x10) = 0;
if (uVar8 != 0) {
CUtlVector<unsigned_short,CUtlMemory<unsigned_short,int>>::GrowVector
((CUtlVector<unsigned_short,CUtlMemory<unsigned_short,int>> *)(this + 4),uVar8);
CUtlVector<unsigned_short,CUtlMemory<unsigned_short,int>>::ShiftElementsRight
((CUtlVector<unsigned_short,CUtlMemory<unsigned_short,int>> *)(this + 4),0,uVar8);
if (0 < (int)uVar8) {
iVar9 = 0;
LAB_00b79cb8:
do {
puVar10 = (undefined2 *)(*(int *)(this + 4) + iVar9);
if (((byte)param_1[0x15] & 1) == 0) {
cVar1 = CUtlBuffer::CheckGet(param_1,2);
uVar7 = 0;
if (cVar1 != '\0') {
if (((byte)param_1[0x34] & 1) == 0) {
iVar2 = *(int *)(param_1 + 0xc);
uVar7 = *(undefined2 *)(*(int *)param_1 + (iVar2 - *(int *)(param_1 + 0x20)));
}
else {
puVar5 = (uint *)((*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)) +
*(int *)param_1);
if (puVar5 == (uint *)0x0) {
puVar5 = &local_428;
}
uVar7 = local_424._2_2_;
local_424 = CONCAT22(local_424._2_2_,(undefined2)local_428);
local_424 = CONCAT31(local_424._1_3_,*(undefined1 *)((int)puVar5 + 1));
local_424._0_2_ = CONCAT11((char)*puVar5,*(undefined1 *)((int)puVar5 + 1));
local_424 = CONCAT22(uVar7,(undefined2)local_424);
_V_memcpy(&local_428,&local_424,2);
iVar2 = *(int *)(param_1 + 0xc);
uVar7 = (undefined2)local_428;
}
iVar9 = iVar9 + 2;
*(int *)(param_1 + 0xc) = iVar2 + 2;
*puVar10 = uVar7;
if (iVar9 == uVar8 * 2) break;
goto LAB_00b79cb8;
}
}
else {
local_428 = local_428 & 0xffff0000;
CUtlBuffer::Scanf(param_1,"%u",&local_428);
uVar7 = (undefined2)local_428;
}
iVar9 = iVar9 + 2;
*puVar10 = uVar7;
} while (iVar9 != uVar8 * 2);
}
}
}
if (((byte)param_1[0x15] & 1) == 0) {
cVar1 = CUtlBuffer::CheckGet(param_1,4);
if (cVar1 != '\0') {
if (((byte)param_1[0x34] & 1) == 0) {
iVar9 = *(int *)(param_1 + 0xc);
local_438 = *(uint *)(*(int *)param_1 + (iVar9 - *(int *)(param_1 + 0x20)));
}
else {
puVar5 = (uint *)((*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (puVar5 == (uint *)0x0) {
puVar5 = &local_428;
}
local_424 = local_428;
local_424._1_3_ = (undefined3)(local_428 >> 8);
local_424 = CONCAT31(local_424._1_3_,*(undefined1 *)((int)puVar5 + 3));
local_424._2_2_ = (undefined2)(local_428 >> 0x10);
local_424._0_2_ =
CONCAT11(*(undefined1 *)((int)puVar5 + 2),*(undefined1 *)((int)puVar5 + 3));
local_424._3_1_ = (undefined1)(local_428 >> 0x18);
local_424._0_3_ = CONCAT12(*(undefined1 *)((int)puVar5 + 1),(undefined2)local_424);
local_424 = CONCAT13((char)*puVar5,(undefined3)local_424);
_V_memcpy(&local_428,&local_424,4);
iVar9 = *(int *)(param_1 + 0xc);
local_438 = local_428;
}
*(int *)(param_1 + 0xc) = iVar9 + 4;
goto LAB_00b79d4a;
}
}
else {
local_428 = 0;
CUtlBuffer::Scanf(param_1,"%d",&local_428);
local_438 = local_428;
LAB_00b79d4a:
if (1 < (int)local_438) {
iVar9 = *(int *)(this + 0x24);
CUtlVector<CCountedStringPool::hash_item_t,CUtlMemory<CCountedStringPool::hash_item_t,int>>::
GrowVector((CUtlVector<CCountedStringPool::hash_item_t,CUtlMemory<CCountedStringPool::hash_item_t,int>>
*)(this + 0x18),local_438 - 1);
CUtlVector<CCountedStringPool::hash_item_t,CUtlMemory<CCountedStringPool::hash_item_t,int>>::
ShiftElementsRight((CUtlVector<CCountedStringPool::hash_item_t,CUtlMemory<CCountedStringPool::hash_item_t,int>>
*)(this + 0x18),iVar9,local_438 - 1);
local_434 = 1;
do {
iVar9 = local_434 * 8;
iVar2 = *(int *)(this + 0x18);
if (((byte)param_1[0x15] & 1) == 0) {
cVar1 = CUtlBuffer::CheckGet(param_1,2);
uVar7 = 0;
if (cVar1 != '\0') {
if (((byte)param_1[0x34] & 1) == 0) {
iVar4 = *(int *)(param_1 + 0xc);
uVar7 = *(undefined2 *)(*(int *)param_1 + (iVar4 - *(int *)(param_1 + 0x20)));
}
else {
puVar5 = (uint *)((*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)) +
*(int *)param_1);
if (puVar5 == (uint *)0x0) {
puVar5 = &local_428;
}
uVar7 = local_424._2_2_;
local_424 = CONCAT22(local_424._2_2_,(undefined2)local_428);
local_424 = CONCAT31(local_424._1_3_,*(undefined1 *)((int)puVar5 + 1));
local_424._0_2_ = CONCAT11((char)*puVar5,*(undefined1 *)((int)puVar5 + 1));
local_424 = CONCAT22(uVar7,(undefined2)local_424);
_V_memcpy(&local_428,&local_424,2);
iVar4 = *(int *)(param_1 + 0xc);
uVar7 = (undefined2)local_428;
}
*(int *)(param_1 + 0xc) = iVar4 + 2;
}
}
else {
local_428 = local_428 & 0xffff0000;
CUtlBuffer::Scanf(param_1,"%u",&local_428);
uVar7 = (undefined2)local_428;
}
*(undefined2 *)(iVar2 + iVar9 + 4) = uVar7;
iVar2 = *(int *)(this + 0x18);
bVar6 = (byte)param_1[0x15] & 1;
if (((byte)param_1[0x15] & 1) == 0) {
cVar1 = CUtlBuffer::CheckGet(param_1,1);
if (cVar1 != '\0') {
bVar6 = *(byte *)(*(int *)param_1 + (*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20))
);
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
}
}
else {
local_424 = local_424 & 0xffffff00;
CUtlBuffer::Scanf(param_1,"%u",&local_424);
bVar6 = (byte)local_424;
}
*(byte *)(iVar2 + iVar9 + 6) = bVar6;
CUtlBuffer::GetString(param_1,local_420,0x400);
iVar2 = *(int *)(this + 0x18);
pcVar3 = strdup(local_420);
local_434 = local_434 + 1;
*(char **)(iVar9 + iVar2) = pcVar3;
} while (local_434 != local_438);
}
}
bVar11 = param_1[0x14] == (CUtlBuffer)0x0;
LAB_00b79b4d:
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return bVar11;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.