CBaseFile::ReadLines
0x00bd6fb0 · 446 bytes · __thiscall
_ZN9CBaseFile9ReadLinesER14CUtlStringListi
Decompiled
undefined (3 params)
/* CBaseFile::ReadLines(CUtlStringList&, int) */
void __thiscall CBaseFile::ReadLines(CBaseFile *this,CUtlStringList *param_1,int param_2)
{
undefined4 uVar1;
code *pcVar2;
int iVar3;
int iVar4;
uint *puVar5;
int iVar6;
char *pcVar7;
uint uVar8;
uint uVar9;
void *pvVar10;
int iVar11;
uint *puVar12;
uint *puVar13;
int iVar14;
int in_GS_OFFSET;
uint auStack_50 [2];
size_t asStack_48 [4];
CBaseFile *local_38;
void *local_34;
uint *local_30 [4];
int local_20;
local_38 = this;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
iVar4 = -((param_2 + 0xfU & 0xfffffff0) + 0x10);
local_30[0] = (uint *)((int)local_30 + iVar4);
do {
uVar1 = *(undefined4 *)local_38;
iVar6 = *g_pFullFileSystem;
*(int **)((int)auStack_50 + iVar4 + 4) = g_pFullFileSystem;
puVar5 = local_30[0];
*(undefined4 *)((int)asStack_48 + iVar4 + 8) = uVar1;
*(uint **)((int)asStack_48 + iVar4) = puVar5;
*(int *)((int)asStack_48 + iVar4 + 4) = param_2;
pcVar2 = *(code **)(iVar6 + 0x60);
*(undefined4 *)((int)auStack_50 + iVar4) = 0xbd7014;
iVar6 = (*pcVar2)();
puVar5 = local_30[0];
if (iVar6 == 0) {
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
*(undefined **)((int)auStack_50 + iVar4) = &UNK_00bd717b;
__stack_chk_fail();
}
return;
}
*(undefined4 *)((int)asStack_48 + iVar4) = 10;
*(uint **)((int)auStack_50 + iVar4 + 4) = puVar5;
*(undefined4 *)((int)auStack_50 + iVar4) = 0xbd702f;
pcVar7 = strchr(*(char **)((int)auStack_50 + iVar4 + 4),*(int *)((int)asStack_48 + iVar4));
puVar5 = local_30[0];
puVar13 = local_30[0];
if (pcVar7 != (char *)0x0) {
*pcVar7 = '\0';
}
do {
puVar12 = puVar13;
uVar8 = *puVar12 + 0xfefefeff & ~*puVar12;
uVar9 = uVar8 & 0x80808080;
puVar13 = puVar12 + 1;
} while (uVar9 == 0);
if ((uVar8 & 0x8080) == 0) {
puVar13 = (uint *)((int)puVar12 + 6);
uVar9 = uVar9 >> 0x10;
}
*(uint *)((int)auStack_50 + iVar4 + 4) =
(int)puVar13 + (-(int)local_30[0] - (uint)CARRY1((byte)uVar9,(byte)uVar9)) + -2;
*(undefined4 *)((int)auStack_50 + iVar4) = 0xbd7077;
pvVar10 = operator_new__(*(uint *)((int)auStack_50 + iVar4 + 4));
*(uint **)((int)asStack_48 + iVar4) = puVar5;
*(void **)((int)auStack_50 + iVar4 + 4) = pvVar10;
local_34 = pvVar10;
*(undefined4 *)((int)auStack_50 + iVar4) = 0xbd7086;
_V_strcpy(*(char **)((int)auStack_50 + iVar4 + 4),*(char **)((int)asStack_48 + iVar4));
iVar3 = *(int *)(param_1 + 0xc);
iVar14 = *(int *)(param_1 + 4);
iVar6 = iVar3 + 1;
if (iVar14 < iVar6) {
iVar11 = *(int *)(param_1 + 8);
if (iVar11 < 0) goto LAB_00bd7093;
if (iVar11 == 0) {
if (iVar14 == 0) {
if (iVar6 < 9) {
iVar11 = 8;
goto LAB_00bd70ff;
}
iVar14 = 8;
}
do {
iVar11 = iVar14 * 2;
if (iVar6 <= iVar11) break;
iVar11 = iVar14 * 4;
iVar14 = iVar11;
} while (iVar11 < iVar6);
}
else {
for (iVar11 = (iVar3 / iVar11 + 1) * iVar11; iVar11 < iVar6; iVar11 = (iVar11 + iVar6) / 2)
{
}
}
LAB_00bd70ff:
iVar14 = *(int *)param_1;
*(int *)(param_1 + 4) = iVar11;
if (iVar14 == 0) {
*(int *)((int)auStack_50 + iVar4 + 4) = iVar11 << 2;
*(undefined4 *)((int)auStack_50 + iVar4) = 0xbd7168;
pvVar10 = malloc(*(size_t *)((int)auStack_50 + iVar4 + 4));
*(void **)param_1 = pvVar10;
}
else {
*(int *)((int)asStack_48 + iVar4) = iVar11 << 2;
*(int *)((int)auStack_50 + iVar4 + 4) = iVar14;
*(undefined4 *)((int)auStack_50 + iVar4) = 0xbd7117;
pvVar10 = realloc(*(void **)((int)auStack_50 + iVar4 + 4),
*(size_t *)((int)asStack_48 + iVar4));
*(void **)param_1 = pvVar10;
iVar6 = *(int *)(param_1 + 0xc) + 1;
}
}
else {
LAB_00bd7093:
pvVar10 = *(void **)param_1;
}
*(int *)(param_1 + 0xc) = iVar6;
iVar14 = iVar3 * 4;
iVar6 = (iVar6 - iVar3) + -1;
*(void **)(param_1 + 0x10) = pvVar10;
if (0 < iVar6) {
*(int *)((int)asStack_48 + iVar4 + 4) = iVar6 * 4;
*(int *)((int)auStack_50 + iVar4 + 4) = (int)pvVar10 + iVar14 + 4;
*(void **)((int)asStack_48 + iVar4) = (void *)((int)pvVar10 + iVar14);
*(undefined4 *)((int)auStack_50 + iVar4) = 0xbd70c1;
_V_memmove(*(void **)((int)auStack_50 + iVar4 + 4),*(void **)((int)asStack_48 + iVar4),
*(int *)((int)asStack_48 + iVar4 + 4));
pvVar10 = *(void **)param_1;
}
if ((undefined4 *)(iVar14 + (int)pvVar10) != (undefined4 *)0x0) {
*(undefined4 *)(iVar14 + (int)pvVar10) = local_34;
}
} while( true );
}
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.