Function at 0x406140
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x5c
push ebx
push esi
push edi
mov eax, ecx
push 0x431074
push eax
mov dword [esp + 0x20], eax
call fcn.0041492a
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x40616d
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
xor esi, esi
push 2
push esi
push ebx
mov dword [esp + 0x30], esi
mov dword [esp + 0x34], esi
mov dword [esp + 0x38], esi
mov dword [esp + 0x40], esi
call fcn.00415036
push ebx
call fcn.00414843
mov edi, eax
mov dword [esp + 0x40], esi
add esp, 0x10
add edi, 1
je 0x4061cc
push edi
lea ecx, [esp + 0x28]
call fcn.00408410
mov eax, dword [esp + 0x30]
sub eax, edi
test eax, eax
jle 0x4061c8
test edi, edi
jle 0x4061c8
mov esi, dword [esp + 0x24]
push eax
push esi
lea eax, [esi + edi]
push eax
call fcn.00411310
add esp, 0xc
jmp 0x4061cc
mov esi, dword [esp + 0x24]
push 0
push 0
push ebx
call fcn.00415036
mov edi, dword [esp + 0x3c]
push ebx
lea eax, [edi - 1]
push eax
push 1
push esi
call fcn.0041678b
push ebx
call fcn.00414a66
mov ebx, dword [sym.imp.vstdlib.dll_KeyValuesSystem]
add esp, 0x20
mov byte [edi + esi - 1], 0
call ebx
push 0x20
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 4]
mov edi, eax
mov dword [esp + 0x14], eax
test edi, edi
je 0x40625b
mov dword [edi], 0xffffffff
mov dword [edi + 0x10], 0x10000
mov dword [edi + 0x18], 0
mov dword [edi + 0x14], 0
mov dword [edi + 0x1c], 0
mov dword [edi + 4], 0
mov dword [edi + 8], 0
mov dword [edi + 0xc], 0
call ebx
push 1
push 0x431794
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0xc]
mov dword [edi], eax
jmp 0x406261
xor edi, edi
mov dword [esp + 0x14], edi
test esi, esi
je 0x40646d
mov eax, dword [esp + 0x18]
mov ecx, 0x431794
test eax, eax
cmovne ecx, eax
push ecx
push 0x431794
push 0x431794
push str.KeyValues::LoadFromBuffer__s_s_s_:_Begin
mov dword [esp + 0x30], ecx
call dword [sym.imp.tier0.dll_COM_TimestampedLog]
mov ecx, esi
add esp, 0x10
lea edx, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4062a0
and dword [esp + 0x64], 0xfffffffc
sub ecx, edx
mov dword [esp + 0x38], esi
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x40], 0xffffffff
mov word [esp + 0x4c], 0x900
mov dword [esp + 0x44], 0
mov dword [esp + 0x48], 0
mov dword [esp + 0x50], 0
mov dword [esp + 0x58], 0
mov dword [esp + 0x54], ecx
mov dword [esp + 0x5c], 0x40d5d0
mov dword [esp + 0x60], 0x40d4a0
cmp ecx, 2
jle 0x4063f0
cmp byte [esi], 0xff
jne 0x4063f0
cmp byte [esi + 1], 0xfe
jne 0x4063f0
lea ebx, [esi + 2]
test ebx, ebx
je 0x406385
xor ecx, ecx
mov edi, 0xffff
cmp word [ebx], 0
mov dword [esp + 0x10], ecx
je 0x40637e
lea eax, [esp + 0xf]
push eax
lea eax, [esp + 0x20]
push eax
push ebx
call fcn.0040d7c0
add esp, 0xc
lea ebx, [ebx + eax*2]
mov eax, dword [esp + 0x1c]
cmp eax, 0x7f
ja 0x406359
mov ecx, dword [esp + 0x10]
mov eax, 1
add ecx, eax
jmp 0x406323
cmp eax, 0x7ff
ja 0x40636d
mov ecx, dword [esp + 0x10]
mov eax, 2
add ecx, eax
jmp 0x406323
mov ecx, dword [esp + 0x10]
cmp edi, eax
sbb eax, eax
neg eax
add eax, 3
add ecx, eax
jmp 0x406323
mov edi, dword [esp + 0x14]
lea ebx, [ecx + 1]
call fcn.00401580
mov edx, eax
mov eax, dword [sym.imp.tier0.dll_g_pMemAlloc]
mov ecx, dword [eax]
mov eax, dword [ecx]
test edx, edx
jne 0x40639f
push ebx
call dword [eax + 4]
jmp 0x4063a5
push 0
push edx
push ebx
call dword [eax]
push ecx
push ebx
mov edx, eax
mov dword [esp + 0x1c], eax
lea ecx, [esi + 2]
call fcn.0040d980
add esp, 8
cmp dword [esp + 0x40], 0
jl 0x4063d4
mov edx, dword [esp + 0x38]
test edx, edx
je 0x4063d4
mov eax, dword [sym.imp.tier0.dll_g_pMemAlloc]
push edx
mov ecx, dword [eax]
mov eax, dword [ecx]
call dword [eax + 0x14]
mov eax, dword [esp + 0x14]
mov dword [esp + 0x38], eax
or eax, 0xffffffff
cmp ebx, eax
mov dword [esp + 0x3c], ebx
mov dword [esp + 0x48], ebx
cmovg eax, ebx
mov dword [esp + 0x54], eax
push 0
push 0
lea eax, [esp + 0x40]
mov ecx, edi
push eax
push dword [esp + 0x24]
call fcn.0040a8b0
push dword [esp + 0x20]
mov bl, al
push 0x431794
push 0x431794
push str.KeyValues::LoadFromBuffer__s_s_s_:_End
call dword [sym.imp.tier0.dll_COM_TimestampedLog]
add esp, 0x10
cmp dword [esp + 0x40], 0
jl 0x40644e
mov edx, dword [esp + 0x38]
test edx, edx
je 0x406446
mov eax, dword [sym.imp.tier0.dll_g_pMemAlloc]
push edx
mov ecx, dword [eax]
mov eax, dword [ecx]
call dword [eax + 0x14]
mov dword [esp + 0x38], 0
mov dword [esp + 0x3c], 0
test bl, bl
jne 0x40646d
test edi, edi
je 0x40646b
mov ecx, edi
call fcn.00408e70
call dword [sym.imp.vstdlib.dll_KeyValuesSystem]
push edi
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 8]
xor edi, edi
mov ebx, dword [esp + 0x2c]
test ebx, ebx
js 0x40649e
test esi, esi
je 0x406488
mov eax, dword [sym.imp.tier0.dll_g_pMemAlloc]
push esi
mov ecx, dword [eax]
mov eax, dword [ecx]
call dword [eax + 0x14]
xor esi, esi
test ebx, ebx
js 0x40649e
test esi, esi
je 0x40649e
mov ecx, dword [sym.imp.tier0.dll_g_pMemAlloc]
push esi
mov ecx, dword [ecx]
mov edx, dword [ecx]
call dword [edx + 0x14]
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret