Function at 0x496e60
Capabilities:
Check if file exists
Delete file
Get file size
Read file via mapping

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x40
push ebx
mov ebx, dword [ebp + 0xc]
push esi
push edi
push ecx
mov eax, esp
mov dword [ebp - 0x40], esp
push ebx
push str.LoadTreeFromDisk__s_
push eax
call fcn.00475230
add esp, 0xc
call fcn.004959b0
mov ecx, dword [ebp + 8]
add esp, 4
mov dword [ecx + 8], 0
cmp word [ebx], 0
jne 0x496ea7
mov eax, 3
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov edi, 0x200
push edi
mov dword [ebp - 0x28], edi
mov dword [ebp - 0x24], edi
call fcn.004d21c4
push edi
mov esi, eax
call fcn.004d21c4
add esp, 8
push 0
push 0
push 3
push 0
push 1
push SysReAllocStringLen
push ebx
mov dword [ebp - 8], eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
mov dword [ebp - 0x30], edi
cmp edi, 0xffffffff
je 0x4972f9
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push ecx
mov edx, esp
mov dword [ebp - 0x40], esp
push eax
push ebx
push str.PATHTREE_LoadTreeFromDisk__s_:_FileSize_ul
push edx
mov dword [ebp - 0x10], eax
call fcn.00475230
add esp, 0x10
call fcn.004959b0
add esp, 4
push 0
push 0
push 0
push 2
push 0
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov ebx, eax
mov dword [ebp - 0x2c], ebx
test ebx, ebx
je 0x49722b
push 0
push 0
push 0
push 4
push ebx
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov edi, eax
mov dword [ebp - 0x1c], edi
test edi, edi
je 0x497221
mov ebx, 4
cmp dword [ebp - 0x10], ebx
jb 0x497298
mov ecx, dword [ebp + 8]
mov eax, dword [edi]
mov edx, ecx
mov dword [ecx + 0xc], eax
cmp dword [edx + 0xc], 2
mov dword [ebp - 0x18], ebx
jne 0x497298
lea ecx, [ebp - 0xc]
call fcn.00422487
cmp dword [ebp - 0x10], 0x10
mov dword [ebp - 0x14], 0
jb 0x4971f8
jmp 0x496f93
mov ebx, dword [ebp - 0x18]
lea ecx, [ebx + 0xc]
mov dword [ebp - 0x34], ecx
cmp ecx, dword [ebp - 0x10]
ja 0x497279
mov eax, dword [ebx + edi]
mov edx, dword [ebp - 0x18]
mov ebx, dword [ebx + edi + 4]
mov edi, dword [edx + edi + 8]
cmp eax, 0x410509e8
jne 0x497279
test edi, edi
je 0x497279
cmp dword [ebp - 0x24], ebx
jae 0x496fe3
mov eax, dword [ebp - 8]
push eax
call fcn.004d20e7
push ebx
mov dword [ebp - 0x24], ebx
call fcn.004d21c4
mov ecx, dword [ebp - 0x34]
add esp, 8
mov dword [ebp - 8], eax
lea eax, [ebx + ecx]
mov dword [ebp - 0x34], eax
cmp eax, dword [ebp - 0x10]
ja 0x497279
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 8]
push ebx
add ecx, edx
push ecx
push eax
call fcn.004d25a0
lea eax, [edi + 2]
add esp, 0xc
cmp dword [ebp - 0x28], eax
jae 0x497024
push esi
call fcn.004d20e7
lea eax, [edi + 2]
push eax
mov dword [ebp - 0x28], eax
call fcn.004d21c4
add esp, 8
mov esi, eax
mov eax, dword [ebp - 0x34]
lea ecx, [edi + eax]
mov dword [ebp - 0x34], ecx
cmp ecx, dword [ebp - 0x10]
ja 0x497279
mov ecx, dword [ebp - 0x1c]
push edi
add eax, ecx
push eax
push esi
call fcn.004d25a0
mov edx, dword [ebp - 0x34]
add esp, 0xc
push 0x5c
push ecx
xor eax, eax
mov ecx, esp
mov dword [ebp - 0x34], esp
shr edi, 1
push esi
mov dword [ebp - 0x18], edx
mov word [esi + edi*2], ax
call fcn.004247f5
lea ecx, [ebp - 0x20]
push ecx
call fcn.00475640
mov ecx, dword [ebp - 0x20]
xor eax, eax
add esp, 0xc
test ecx, ecx
setne al
test eax, eax
je 0x49726f
mov edx, dword [ebp - 0xc]
push ecx
push edx
call fcn.004d20b0
add esp, 8
test eax, eax
sete al
test al, al
je 0x4970f3
push 0x5c
push ecx
mov ecx, esp
mov dword [ebp - 0x34], esp
push esi
call fcn.004247f5
lea eax, [ebp - 0x38]
push eax
call fcn.00475560
mov ecx, dword [ebp - 8]
mov eax, dword [eax]
mov edx, dword [ebp - 0x14]
add esp, 0xc
push ebx
push ecx
push 1
push eax
mov eax, dword [ebp + 8]
push esi
push edx
push eax
call fcn.00495fb0
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x38]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4971ac
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
jmp 0x4971ac
mov edx, dword [ebp - 0xc]
lea ecx, [ebp - 0x20]
push ecx
push 0x5c
push ecx
add edx, 0xfffffff0
mov dword [ebp - 0x34], esp
mov edi, esp
push edx
call fcn.00425486
add eax, 0x10
mov dword [edi], eax
lea eax, [ebp - 0x3c]
add esp, 4
push eax
call fcn.00475640
add esp, 0xc
push eax
call fcn.00470680
mov byte [ebp - 1], al
mov eax, dword [ebp - 0x3c]
add eax, 0xfffffff0
add esp, 8
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x49714a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
cmp byte [ebp - 1], 0
je 0x497190
push 0x5c
push ecx
mov ecx, esp
mov dword [ebp - 0x34], esp
push esi
call fcn.004247f5
lea ecx, [ebp - 0x40]
push ecx
call fcn.00475560
mov edx, dword [ebp - 8]
mov eax, dword [eax]
add esp, 0xc
push ebx
push edx
mov edx, dword [ebp + 8]
push 1
push eax
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax + 0x10]
push esi
push ecx
push edx
call fcn.00495fb0
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x40]
jmp 0x4970ce
mov edx, dword [ebp - 8]
mov eax, dword [ebp + 8]
lea ecx, [ebp - 0x14]
push ecx
push 0
push 0
push ebx
push edx
push esi
push eax
mov eax, 1
call fcn.00496200
test esi, esi
jne 0x4971b4
xor eax, eax
jmp 0x4971bd
push esi
call fcn.004d1e6a
add esp, 4
push eax
push esi
lea ecx, [ebp - 0xc]
call fcn.00425415
mov eax, dword [ebp - 0x20]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4971e6
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [ebp - 0x18]
mov edi, dword [ebp - 0x1c]
add ecx, 0xc
cmp ecx, dword [ebp - 0x10]
jbe 0x496f90
push edi
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov eax, dword [ebp - 0xc]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x49721e
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ebx, dword [ebp - 0x2c]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [ebp - 0x30]
push ecx
mov ecx, dword [ebp + 0xc]
mov eax, esp
mov dword [ebp + 8], esp
push ecx
push str.LoadTreeFromDisk__s_:_done
push eax
call fcn.00475230
add esp, 0xc
call fcn.004959b0
add esp, 4
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call fcn.004d20e7
mov edx, dword [ebp - 8]
push edx
call fcn.004d20e7
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push 0x80004005
call fcn.00422000
mov eax, dword [ebp - 0xc]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x497298
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ecx
mov ecx, esp
mov dword [ebp - 0x40], esp
push eax
push str._PATHTREE_LoadTreeFromDisk:_ERROR__tree_is_malformed__LE_d
push ecx
call fcn.00475230
add esp, 0xc
call fcn.004959b0
mov edx, dword [ebp - 0x30]
add esp, 4
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call fcn.004d20e7
mov eax, dword [ebp - 8]
push eax
call fcn.004d20e7
mov ecx, dword [ebp + 0xc]
add esp, 8
push ecx
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov edx, dword [ebp + 8]
mov dword [edx + 8], 0
mov eax, 2
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
cmp eax, 2
jne 0x49731d
push ecx
mov eax, esp
mov dword [ebp + 8], esp
push ebx
push str.PATHTREE_LoadTreeFromDisk:_file__s_doesnt_exist.
push eax
call fcn.00475230
add esp, 0xc
jmp 0x497335
call edi
push ecx
mov ecx, esp
mov dword [ebp + 8], esp
push eax
push ebx
push str._PATHTREE_LoadTreeFromDisk:_FAILED_to_open_file__s__LE_d
push ecx
call fcn.00475230
add esp, 0x10
call fcn.004959b0
add esp, 4
push esi
call fcn.004d20e7
mov edx, dword [ebp - 8]
push edx
call fcn.004d20e7
add esp, 8
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret 8