197 lines
6.9 KiB
C
197 lines
6.9 KiB
C
// 0036eb40 CDirWatcher::vfunction2
|
|
|
|
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
|
|
|
|
void __thiscall CDirWatcher::vfunction2(CDirWatcher *this,undefined8 param_1)
|
|
|
|
{
|
|
int *piVar1;
|
|
uint uVar2;
|
|
code *pcVar3;
|
|
char cVar4;
|
|
int iVar5;
|
|
int iVar6;
|
|
CDirWatcher_vftable *pCVar7;
|
|
CDirWatcher_vftable *pCVar8;
|
|
long lVar9;
|
|
uint uVar10;
|
|
undefined1 *puVar11;
|
|
uint uVar12;
|
|
CPathString_Constructor_or_Destructor *pCVar13;
|
|
undefined8 *puVar14;
|
|
long lVar15;
|
|
uint uVar16;
|
|
long in_FS_OFFSET;
|
|
undefined1 *local_48;
|
|
long local_40;
|
|
|
|
local_40 = *(long *)(in_FS_OFFSET + 0x28);
|
|
FUN_00219370(this + 0xc);
|
|
iVar6 = *(int *)&this[3].vftablePtr;
|
|
if (iVar6 != -1) {
|
|
pCVar8 = this[1].vftablePtr;
|
|
do {
|
|
pCVar13 = pCVar8[iVar6].CPathString_Constructor_or_Destructor;
|
|
if (pCVar13 == (CPathString_Constructor_or_Destructor *)0x0) {
|
|
pCVar13 = (CPathString_Constructor_or_Destructor *)&DAT_0020c965;
|
|
}
|
|
iVar5 = FUN_00218f00(pCVar13,param_1,0x7fffffff);
|
|
if (iVar5 == 0) goto LAB_0036ebb8;
|
|
pCVar8 = this[1].vftablePtr;
|
|
iVar6 = *(int *)((long)&pCVar8[iVar6].vfunction2 + 4);
|
|
} while (iVar6 != -1);
|
|
}
|
|
local_48 = (undefined1 *)0x0;
|
|
CUtlString::SetValue(&local_48,param_1);
|
|
uVar10 = *(uint *)&this[4].vftablePtr;
|
|
if (uVar10 == 0xffffffff) {
|
|
uVar10 = *(uint *)&this[5].vftablePtr;
|
|
if (uVar10 == *(uint *)&this[2].vftablePtr) {
|
|
iVar6 = *(int *)((long)&this[2].vftablePtr + 4);
|
|
if (iVar6 < 0) {
|
|
cVar4 = FUN_00218ab0("../public/tier1/utlmemory.h",0x1eb,&DAT_00208b3b);
|
|
if ((cVar4 == '\0') && (cVar4 = FUN_00218b70(), cVar4 != '\0')) {
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
uVar10 = *(uint *)&this[5].vftablePtr;
|
|
}
|
|
else {
|
|
iVar6 = FUN_0038cdc0(uVar10,iVar6,uVar10 + 1,0x10);
|
|
*(int *)&this[2].vftablePtr = iVar6;
|
|
if (this[1].vftablePtr == (CDirWatcher_vftable *)0x0) {
|
|
pCVar8 = (CDirWatcher_vftable *)
|
|
(**(code **)(*_g_pMemAllocSteam + 0x28))
|
|
(_g_pMemAllocSteam,(long)iVar6 << 4,"../public/tier1/utlmemory.h",0x1fe
|
|
,0,0);
|
|
}
|
|
else {
|
|
pCVar8 = (CDirWatcher_vftable *)
|
|
(**(code **)(*_g_pMemAllocSteam + 0x30))
|
|
(_g_pMemAllocSteam,this[1].vftablePtr,(long)iVar6 << 4,
|
|
"../public/tier1/utlmemory.h",0x1fa);
|
|
}
|
|
uVar10 = *(uint *)&this[5].vftablePtr;
|
|
this[1].vftablePtr = pCVar8;
|
|
}
|
|
}
|
|
if (uVar10 != 0xffffffff) {
|
|
*(uint *)&this[5].vftablePtr = uVar10 + 1;
|
|
LAB_0036ed82:
|
|
lVar9 = (long)(int)uVar10;
|
|
pCVar8 = this[1].vftablePtr + lVar9;
|
|
goto LAB_0036ec28;
|
|
}
|
|
cVar4 = FUN_00218ab0("../public/tier1/utllinkedlist.h",0x1a8,"m_TotalElements != InvalidIndex()"
|
|
);
|
|
if ((cVar4 == '\0') && (cVar4 = FUN_00218b70(), cVar4 != '\0')) {
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
uVar10 = *(uint *)&this[5].vftablePtr;
|
|
*(uint *)&this[5].vftablePtr = uVar10 + 1;
|
|
if (uVar10 != 0xffffffff) goto LAB_0036ed82;
|
|
FUN_00218c40("%s overflow!\n","14CUtlLinkedListI10CUtlStringiE");
|
|
lVar15 = -0x10;
|
|
*(undefined4 *)&this[1].vftablePtr[-1].vfunction2 = 0xffffffff;
|
|
*(undefined4 *)((long)&this[1].vftablePtr[-1].vfunction2 + 4) = 0xffffffff;
|
|
this[6].vftablePtr = this[1].vftablePtr;
|
|
uVar16 = 0xffffffff;
|
|
LAB_0036ecaf:
|
|
cVar4 = FUN_00218ab0("../public/tier1/utllinkedlist.h",0x2ac,"IsValidIndex(elem)");
|
|
if ((cVar4 == '\0') && (cVar4 = FUN_00218b70(), cVar4 != '\0')) {
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
if (uVar16 < *(uint *)&this[5].vftablePtr) {
|
|
pCVar8 = this[1].vftablePtr;
|
|
pCVar7 = (CDirWatcher_vftable *)
|
|
((long)&pCVar8->CPathString_Constructor_or_Destructor + lVar15);
|
|
uVar2 = *(uint *)&pCVar7->vfunction2;
|
|
uVar12 = *(uint *)((long)&pCVar7->vfunction2 + 4);
|
|
if (uVar10 != uVar2) goto LAB_0036ec53;
|
|
if (uVar10 == uVar12) goto LAB_0036ecf7;
|
|
}
|
|
cVar4 = FUN_00218ab0("../public/tier1/utllinkedlist.h",0x31e,"IsValidIndex(elem)");
|
|
if ((cVar4 == '\0') && (cVar4 = FUN_00218b70(), cVar4 != '\0')) {
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
pCVar7 = (CDirWatcher_vftable *)
|
|
((long)&(this[1].vftablePtr)->CPathString_Constructor_or_Destructor + lVar15);
|
|
}
|
|
else {
|
|
lVar9 = (long)(int)uVar10;
|
|
pCVar8 = this[1].vftablePtr + lVar9;
|
|
*(undefined4 *)&this[4].vftablePtr = *(undefined4 *)((long)&pCVar8->vfunction2 + 4);
|
|
LAB_0036ec28:
|
|
lVar15 = lVar9 * 0x10;
|
|
*(uint *)&pCVar8->vfunction2 = uVar10;
|
|
*(uint *)((long)&this[1].vftablePtr[lVar9].vfunction2 + 4) = uVar10;
|
|
pCVar8 = this[1].vftablePtr;
|
|
this[6].vftablePtr = pCVar8;
|
|
uVar16 = uVar10;
|
|
if (*(uint *)&this[5].vftablePtr <= uVar10) goto LAB_0036ecaf;
|
|
pCVar7 = pCVar8 + lVar9;
|
|
uVar2 = *(uint *)&pCVar7->vfunction2;
|
|
uVar12 = *(uint *)((long)&pCVar7->vfunction2 + 4);
|
|
if (uVar10 == uVar2) {
|
|
if (uVar10 == uVar12) goto LAB_0036ecf7;
|
|
goto LAB_0036ecaf;
|
|
}
|
|
LAB_0036ec53:
|
|
if (uVar2 == 0xffffffff) {
|
|
*(uint *)&this[3].vftablePtr = uVar12;
|
|
}
|
|
else {
|
|
*(uint *)((long)&pCVar8[(int)uVar2].vfunction2 + 4) = uVar12;
|
|
}
|
|
iVar6 = *(int *)((long)&pCVar7->vfunction2 + 4);
|
|
if (iVar6 == -1) {
|
|
*(undefined4 *)((long)&this[3].vftablePtr + 4) = *(undefined4 *)&pCVar7->vfunction2;
|
|
}
|
|
else {
|
|
*(undefined4 *)&pCVar8[iVar6].vfunction2 = *(undefined4 *)&pCVar7->vfunction2;
|
|
}
|
|
pCVar7->vfunction2 = (vfunction2 *)CONCAT44(uVar10,uVar10);
|
|
pCVar8 = this[1].vftablePtr;
|
|
piVar1 = (int *)((long)&this[4].vftablePtr + 4);
|
|
*piVar1 = *piVar1 + -1;
|
|
pCVar7 = (CDirWatcher_vftable *)((long)&pCVar8->CPathString_Constructor_or_Destructor + lVar15);
|
|
}
|
|
LAB_0036ecf7:
|
|
*(undefined4 *)((long)&pCVar7->vfunction2 + 4) = 0xffffffff;
|
|
*(undefined4 *)&pCVar7->vfunction2 = *(undefined4 *)((long)&this[3].vftablePtr + 4);
|
|
*(uint *)((long)&this[3].vftablePtr + 4) = uVar10;
|
|
if (*(int *)&pCVar7->vfunction2 == -1) {
|
|
*(uint *)&this[3].vftablePtr = uVar10;
|
|
}
|
|
else {
|
|
*(uint *)((long)&this[1].vftablePtr[*(int *)&pCVar7->vfunction2].vfunction2 + 4) = uVar10;
|
|
}
|
|
pCVar8 = this[1].vftablePtr;
|
|
piVar1 = (int *)((long)&this[4].vftablePtr + 4);
|
|
*piVar1 = *piVar1 + 1;
|
|
puVar14 = (undefined8 *)((long)&pCVar8->CPathString_Constructor_or_Destructor + lVar15);
|
|
*puVar14 = 0;
|
|
puVar11 = local_48;
|
|
if (local_48 == (undefined1 *)0x0) {
|
|
puVar11 = &DAT_0020c965;
|
|
}
|
|
CUtlString::SetValue(puVar14,puVar11);
|
|
(**(code **)(*_g_pMemAllocSteam + 0x20))(_g_pMemAllocSteam,local_48,0);
|
|
LAB_0036ebb8:
|
|
if (local_40 != *(long *)(in_FS_OFFSET + 0x28)) {
|
|
/* WARNING: Subroutine does not return */
|
|
FUN_00219340();
|
|
}
|
|
FUN_00219770(this + 0xc);
|
|
return;
|
|
}
|
|
|
|
|