Function at 0x49a420
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.00478210
add esp, 0xc
call fcn.00498f70
mov ecx, dword [ebp + 8]
add esp, 4
mov dword [ecx + 8], 0
cmp word [ebx], 0
jne 0x49a467
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.004cb944
push edi
mov esi, eax
call fcn.004cb944
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 0x49a8b9
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.00478210
add esp, 0x10
call fcn.00498f70
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 0x49a7eb
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 0x49a7e1
mov ebx, 4
cmp dword [ebp - 0x10], ebx
jb 0x49a858
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 0x49a858
lea ecx, [ebp - 0xc]
call fcn.0042248a
cmp dword [ebp - 0x10], 0x10
mov dword [ebp - 0x14], 0
jb 0x49a7b8
jmp 0x49a553
mov ebx, dword [ebp - 0x18]
lea ecx, [ebx + 0xc]
mov dword [ebp - 0x34], ecx
cmp ecx, dword [ebp - 0x10]
ja 0x49a839
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 0x49a839
test edi, edi
je 0x49a839
cmp dword [ebp - 0x24], ebx
jae 0x49a5a3
mov eax, dword [ebp - 8]
push eax
call fcn.004cb867
push ebx
mov dword [ebp - 0x24], ebx
call fcn.004cb944
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 0x49a839
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 8]
push ebx
add ecx, edx
push ecx
push eax
call fcn.004cbd20
lea eax, [edi + 2]
add esp, 0xc
cmp dword [ebp - 0x28], eax
jae 0x49a5e4
push esi
call fcn.004cb867
lea eax, [edi + 2]
push eax
mov dword [ebp - 0x28], eax
call fcn.004cb944
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 0x49a839
mov ecx, dword [ebp - 0x1c]
push edi
add eax, ecx
push eax
push esi
call fcn.004cbd20
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.004247ea
lea ecx, [ebp - 0x20]
push ecx
call fcn.00478620
mov ecx, dword [ebp - 0x20]
xor eax, eax
add esp, 0xc
test ecx, ecx
setne al
test eax, eax
je 0x49a82f
mov edx, dword [ebp - 0xc]
push ecx
push edx
call fcn.004cb830
add esp, 8
test eax, eax
sete al
test al, al
je 0x49a6b3
push 0x5c
push ecx
mov ecx, esp
mov dword [ebp - 0x34], esp
push esi
call fcn.004247ea
lea eax, [ebp - 0x38]
push eax
call fcn.00478540
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.00499570
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 0x49a76c
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
jmp 0x49a76c
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.0042541f
add eax, 0x10
mov dword [edi], eax
lea eax, [ebp - 0x3c]
add esp, 4
push eax
call fcn.00478620
add esp, 0xc
push eax
call fcn.004738c0
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 0x49a70a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
cmp byte [ebp - 1], 0
je 0x49a750
push 0x5c
push ecx
mov ecx, esp
mov dword [ebp - 0x34], esp
push esi
call fcn.004247ea
lea ecx, [ebp - 0x40]
push ecx
call fcn.00478540
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.00499570
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x40]
jmp 0x49a68e
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.004997c0
test esi, esi
jne 0x49a774
xor eax, eax
jmp 0x49a77d
push esi
call fcn.004cb5ea
add esp, 4
push eax
push esi
lea ecx, [ebp - 0xc]
call fcn.004253ae
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 0x49a7a6
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 0x49a550
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 0x49a7de
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.00478210
add esp, 0xc
call fcn.00498f70
add esp, 4
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call fcn.004cb867
mov edx, dword [ebp - 8]
push edx
call fcn.004cb867
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 0x49a858
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.00478210
add esp, 0xc
call fcn.00498f70
mov edx, dword [ebp - 0x30]
add esp, 4
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call fcn.004cb867
mov eax, dword [ebp - 8]
push eax
call fcn.004cb867
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 0x49a8dd
push ecx
mov eax, esp
mov dword [ebp + 8], esp
push ebx
push str.PATHTREE_LoadTreeFromDisk:_file__s_doesnt_exist.
push eax
call fcn.00478210
add esp, 0xc
jmp 0x49a8f5
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.00478210
add esp, 0x10
call fcn.00498f70
add esp, 4
push esi
call fcn.004cb867
mov edx, dword [ebp - 8]
push edx
call fcn.004cb867
add esp, 8
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret 8