Function at 0x49ac80
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.004777e0
add esp, 0xc
call fcn.00499640
mov ecx, dword [ebp + 8]
add esp, 4
mov dword [ecx + 8], 0
cmp word [ebx], 0
jne 0x49acc7
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.004cd074
push edi
mov esi, eax
call fcn.004cd074
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 0x49b120
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.004777e0
add esp, 0x10
call fcn.00499640
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 0x49b052
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 0x49b048
mov ebx, 4
cmp dword [ebp - 0x10], ebx
jb 0x49b0bf
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 0x49b0bf
lea ecx, [ebp - 0xc]
call fcn.0042048d
cmp dword [ebp - 0x10], 0x10
mov dword [ebp - 0x14], 0
jb 0x49b01f
jmp 0x49adb3
mov ebx, dword [ebp - 0x18]
lea ecx, [ebx + 0xc]
mov dword [ebp - 0x34], ecx
cmp ecx, dword [ebp - 0x10]
ja 0x49b0a0
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 0x49b0a0
test edi, edi
je 0x49b0a0
cmp dword [ebp - 0x24], ebx
jae 0x49ae03
mov eax, dword [ebp - 8]
push eax
call fcn.004ccf97
push ebx
mov dword [ebp - 0x24], ebx
call fcn.004cd074
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 0x49b0a0
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 8]
push ebx
add ecx, edx
push ecx
push eax
call fcn.004cd450
lea eax, [edi + 2]
add esp, 0xc
cmp dword [ebp - 0x28], eax
jae 0x49ae44
push esi
call fcn.004ccf97
lea eax, [edi + 2]
push eax
mov dword [ebp - 0x28], eax
call fcn.004cd074
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 0x49b0a0
mov ecx, dword [ebp - 0x1c]
push edi
add eax, ecx
push eax
push esi
call fcn.004cd450
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.00422827
lea ecx, [ebp - 0x20]
push ecx
call fcn.00477bf0
mov ecx, dword [ebp - 0x20]
xor eax, eax
add esp, 0xc
test ecx, ecx
setne al
test eax, eax
je 0x49b096
mov edx, dword [ebp - 0xc]
push ecx
push edx
call fcn.004ccf60
add esp, 8
test eax, eax
push 0x5c
sete al
push ecx
mov dword [ebp - 0x34], esp
test al, al
je 0x49af13
mov ecx, esp
push esi
call fcn.00422827
lea eax, [ebp - 0x38]
push eax
call fcn.00477b10
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.00499d20
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 0x49afd3
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
jmp 0x49afd3
mov ecx, dword [ebp - 0xc]
add ecx, 0xfffffff0
mov edi, esp
push ecx
call fcn.00423475
lea edx, [ebp - 0x3c]
add esp, 4
add eax, 0x10
push edx
mov dword [edi], eax
call fcn.00477bf0
mov ecx, dword [ebp - 0x20]
add esp, 0xc
test ecx, ecx
je 0x49b096
mov eax, dword [eax]
push ecx
push eax
call fcn.004ccf60
add esp, 8
test eax, eax
mov eax, dword [ebp - 0x3c]
sete byte [ebp - 1]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x49af71
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
cmp byte [ebp - 1], 0
je 0x49afb7
push 0x5c
push ecx
mov ecx, esp
mov dword [ebp - 0x34], esp
push esi
call fcn.00422827
lea ecx, [ebp - 0x40]
push ecx
call fcn.00477b10
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.00499d20
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x40]
jmp 0x49aeee
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.00499f70
test esi, esi
jne 0x49afdb
xor eax, eax
jmp 0x49afe4
push esi
call fcn.004ccd1a
add esp, 4
push eax
push esi
lea ecx, [ebp - 0xc]
call fcn.00423404
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 0x49b00d
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 0x49adb0
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 0x49b045
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.004777e0
add esp, 0xc
call fcn.00499640
add esp, 4
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call fcn.004ccf97
mov edx, dword [ebp - 8]
push edx
call fcn.004ccf97
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push 0x80004005
call fcn.00420000
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 0x49b0bf
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.004777e0
add esp, 0xc
call fcn.00499640
mov edx, dword [ebp - 0x30]
add esp, 4
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call fcn.004ccf97
mov eax, dword [ebp - 8]
push eax
call fcn.004ccf97
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 0x49b144
push ecx
mov eax, esp
mov dword [ebp + 8], esp
push ebx
push str.PATHTREE_LoadTreeFromDisk:_file__s_doesnt_exist.
push eax
call fcn.004777e0
add esp, 0xc
jmp 0x49b15c
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.004777e0
add esp, 0x10
call fcn.00499640
add esp, 4
push esi
call fcn.004ccf97
mov edx, dword [ebp - 8]
push edx
call fcn.004ccf97
add esp, 8
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret 8