Function at 0x49aa70
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.00478610
add esp, 0xc
call fcn.00499470
mov ecx, dword [ebp + 8]
add esp, 4
mov dword [ecx + 8], 0
cmp word [ebx], 0
jne 0x49aab7
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.004cc1d4
push edi
mov esi, eax
call fcn.004cc1d4
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 0x49af09
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.00478610
add esp, 0x10
call fcn.00499470
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 0x49ae3b
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 0x49ae31
mov ebx, 4
cmp dword [ebp - 0x10], ebx
jb 0x49aea8
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 0x49aea8
lea ecx, [ebp - 0xc]
call fcn.0042248a
cmp dword [ebp - 0x10], 0x10
mov dword [ebp - 0x14], 0
jb 0x49ae08
jmp 0x49aba3
mov ebx, dword [ebp - 0x18]
lea ecx, [ebx + 0xc]
mov dword [ebp - 0x34], ecx
cmp ecx, dword [ebp - 0x10]
ja 0x49ae89
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 0x49ae89
test edi, edi
je 0x49ae89
cmp dword [ebp - 0x24], ebx
jae 0x49abf3
mov eax, dword [ebp - 8]
push eax
call fcn.004cc0f7
push ebx
mov dword [ebp - 0x24], ebx
call fcn.004cc1d4
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 0x49ae89
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 8]
push ebx
add ecx, edx
push ecx
push eax
call fcn.004cc5b0
lea eax, [edi + 2]
add esp, 0xc
cmp dword [ebp - 0x28], eax
jae 0x49ac34
push esi
call fcn.004cc0f7
lea eax, [edi + 2]
push eax
mov dword [ebp - 0x28], eax
call fcn.004cc1d4
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 0x49ae89
mov ecx, dword [ebp - 0x1c]
push edi
add eax, ecx
push eax
push esi
call fcn.004cc5b0
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.004247e9
lea ecx, [ebp - 0x20]
push ecx
call fcn.00478a20
mov ecx, dword [ebp - 0x20]
xor eax, eax
add esp, 0xc
test ecx, ecx
setne al
test eax, eax
je 0x49ae7f
mov edx, dword [ebp - 0xc]
push ecx
push edx
call fcn.004cc0c0
add esp, 8
test eax, eax
sete al
test al, al
je 0x49ad03
push 0x5c
push ecx
mov ecx, esp
mov dword [ebp - 0x34], esp
push esi
call fcn.004247e9
lea eax, [ebp - 0x38]
push eax
call fcn.00478940
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.00499b10
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 0x49adbc
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
jmp 0x49adbc
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.00425422
add eax, 0x10
mov dword [edi], eax
lea eax, [ebp - 0x3c]
add esp, 4
push eax
call fcn.00478a20
add esp, 0xc
push eax
call fcn.00473ac0
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 0x49ad5a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
cmp byte [ebp - 1], 0
je 0x49ada0
push 0x5c
push ecx
mov ecx, esp
mov dword [ebp - 0x34], esp
push esi
call fcn.004247e9
lea ecx, [ebp - 0x40]
push ecx
call fcn.00478940
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.00499b10
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x40]
jmp 0x49acde
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.00499d60
test esi, esi
jne 0x49adc4
xor eax, eax
jmp 0x49adcd
push esi
call fcn.004cbe7a
add esp, 4
push eax
push esi
lea ecx, [ebp - 0xc]
call fcn.004253b1
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 0x49adf6
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 0x49aba0
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 0x49ae2e
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.00478610
add esp, 0xc
call fcn.00499470
add esp, 4
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call fcn.004cc0f7
mov edx, dword [ebp - 8]
push edx
call fcn.004cc0f7
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 0x49aea8
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.00478610
add esp, 0xc
call fcn.00499470
mov edx, dword [ebp - 0x30]
add esp, 4
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call fcn.004cc0f7
mov eax, dword [ebp - 8]
push eax
call fcn.004cc0f7
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 0x49af2d
push ecx
mov eax, esp
mov dword [ebp + 8], esp
push ebx
push str.PATHTREE_LoadTreeFromDisk:_file__s_doesnt_exist.
push eax
call fcn.00478610
add esp, 0xc
jmp 0x49af45
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.00478610
add esp, 0x10
call fcn.00499470
add esp, 4
push esi
call fcn.004cc0f7
mov edx, dword [ebp - 8]
push edx
call fcn.004cc0f7
add esp, 8
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret 8