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

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [ebp + 8]
sub esp, 0x24
push ebx
push esi
push edi
mov edi, dword [ebp + 0xc]
mov dword [eax + 8], 0
cmp word [edi], 0
jne 0x4897ba
mov eax, 3
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov esi, 0x200
push esi
mov dword [ebp - 0x1c], esi
mov dword [ebp - 0x18], esi
call fcn.004aeee2
mov ebx, eax
push esi
mov dword [ebp - 8], ebx
call fcn.004aeee2
add esp, 8
push 0
push 0
push 3
push 0
push 1
push SysReAllocStringLen
push edi
mov dword [ebp - 4], eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov dword [ebp - 0x14], esi
cmp esi, 0xffffffff
je 0x489a10
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push ecx
mov ecx, esp
mov ebx, eax
mov dword [ebp - 0x24], esp
push ebx
push edi
push str.PATHTREE_LoadTreeFromDisk__s_:_FileSize_ul
push ecx
mov dword [ebp - 0xc], ebx
call fcn.00468700
add esp, 0x10
call fcn.00488300
add esp, 4
push 0
push 0
push 0
push 2
push 0
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov dword [ebp - 0x24], eax
test eax, eax
je 0x489985
push 0
push 0
push 0
push 4
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [ebp - 0x10], eax
test eax, eax
je 0x48997b
cmp ebx, 4
jb 0x4899b2
mov edx, dword [eax]
mov ecx, dword [ebp + 8]
mov dword [ecx + 0xc], edx
mov edx, ecx
cmp dword [edx + 0xc], 2
mov edi, 4
jne 0x4899af
cmp ebx, 0x10
jb 0x489974
jmp 0x489893
mov ebx, dword [ebp - 0xc]
lea edx, [edi + 0xc]
mov dword [ebp - 0x20], edx
cmp edx, ebx
ja 0x4899af
mov ecx, dword [edi + eax]
mov ebx, dword [edi + eax + 4]
mov esi, dword [edi + eax + 8]
cmp ecx, 0x410509e8
jne 0x4899ac
test esi, esi
je 0x4899ac
cmp dword [ebp - 0x18], ebx
jae 0x4898e0
mov eax, dword [ebp - 4]
push eax
call fcn.004aedc5
push ebx
mov dword [ebp - 0x18], ebx
call fcn.004aeee2
mov edx, dword [ebp - 0x20]
add esp, 8
mov dword [ebp - 4], eax
lea eax, [ebx + edx]
mov dword [ebp - 0x20], eax
cmp eax, dword [ebp - 0xc]
ja 0x4899ac
mov ecx, dword [ebp - 0x10]
add edx, ecx
push ebx
push edx
mov edx, dword [ebp - 4]
push edx
call fcn.004ae900
lea edi, [esi + 2]
add esp, 0xc
cmp dword [ebp - 0x1c], edi
jae 0x489922
mov eax, dword [ebp - 8]
push eax
call fcn.004aedc5
push edi
mov dword [ebp - 0x1c], edi
call fcn.004aeee2
add esp, 8
mov dword [ebp - 8], eax
mov ecx, dword [ebp - 0x20]
lea edi, [esi + ecx]
cmp edi, dword [ebp - 0xc]
ja 0x4899ac
mov eax, dword [ebp - 0x10]
mov edx, ecx
mov ecx, dword [ebp - 8]
push esi
add edx, eax
push edx
push ecx
call fcn.004ae900
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 4]
add esp, 0xc
xor edx, edx
push edx
push ebx
push ecx
shr esi, 1
mov word [eax + esi*2], dx
mov edx, dword [ebp + 8]
push eax
push edx
mov eax, 1
call fcn.00488b30
mov esi, dword [ebp - 0x14]
lea eax, [edi + 0xc]
cmp eax, dword [ebp - 0xc]
mov eax, dword [ebp - 0x10]
jbe 0x489890
push eax
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov edx, dword [ebp - 0x24]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 8]
push eax
call fcn.004aedc5
mov ecx, dword [ebp - 4]
push ecx
call fcn.004aedc5
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov esi, dword [ebp - 0x14]
mov edi, dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ecx
mov ecx, esp
mov dword [ebp + 0xc], esp
push eax
push str._PATHTREE_LoadTreeFromDisk:_ERROR__tree_is_malformed__LE_d
push ecx
call fcn.00468700
add esp, 0xc
call fcn.00488300
add esp, 4
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebp - 8]
push edx
call fcn.004aedc5
mov eax, dword [ebp - 4]
push eax
call fcn.004aedc5
add esp, 8
push edi
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov ecx, dword [ebp + 8]
mov dword [ecx + 8], 0
mov eax, 2
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
cmp eax, 2
jne 0x489a34
push ecx
mov edx, esp
mov dword [ebp + 8], esp
push edi
push str.PATHTREE_LoadTreeFromDisk:_file__s_doesnt_exist.
push edx
call fcn.00468700
add esp, 0xc
jmp 0x489a4c
call esi
push ecx
mov ecx, esp
mov dword [ebp + 8], esp
push eax
push edi
push str._PATHTREE_LoadTreeFromDisk:_FAILED_to_open_file__s__LE_d
push ecx
call fcn.00468700
add esp, 0x10
call fcn.00488300
add esp, 4
push ebx
call fcn.004aedc5
mov edx, dword [ebp - 4]
push edx
call fcn.004aedc5
add esp, 8
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret 8