Function at 0x4816c0
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 0x4816ea
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.004ade42
mov ebx, eax
push esi
mov dword [ebp - 8], ebx
call fcn.004ade42
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 0x481945
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.00464a80
add esp, 0x10
call fcn.00480260
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 0x4818ba
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 0x4818b0
cmp ebx, 4
jb 0x4818e7
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 0x4818e4
cmp ebx, 0x10
jb 0x4818a9
jmp 0x4817c3
mov ebx, dword [ebp - 0xc]
lea edx, [edi + 0xc]
mov dword [ebp - 0x20], edx
cmp edx, ebx
ja 0x4818e4
mov ecx, dword [edi + eax]
mov ebx, dword [edi + eax + 4]
mov esi, dword [edi + eax + 8]
cmp ecx, 0x410509e8
jne 0x4818e1
test esi, esi
je 0x4818e1
cmp dword [ebp - 0x18], ebx
jae 0x481810
mov eax, dword [ebp - 4]
push eax
call fcn.004add25
push ebx
mov dword [ebp - 0x18], ebx
call fcn.004ade42
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 0x4818e1
mov ecx, dword [ebp - 0x10]
add edx, ecx
push ebx
push edx
mov edx, dword [ebp - 4]
push edx
call fcn.004ad860
lea edi, [esi + 2]
add esp, 0xc
cmp dword [ebp - 0x1c], edi
jae 0x481852
mov eax, dword [ebp - 8]
push eax
call fcn.004add25
push edi
mov dword [ebp - 0x1c], edi
call fcn.004ade42
add esp, 8
mov dword [ebp - 8], eax
mov ecx, dword [ebp - 0x20]
lea edi, [esi + ecx]
cmp edi, dword [ebp - 0xc]
ja 0x4818e1
mov eax, dword [ebp - 0x10]
mov edx, ecx
mov ecx, dword [ebp - 8]
push esi
add edx, eax
push edx
push ecx
call fcn.004ad860
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 4]
add esp, 0xc
xor edx, edx
push 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.00480b80
mov esi, dword [ebp - 0x14]
lea eax, [edi + 0xc]
cmp eax, dword [ebp - 0xc]
mov eax, dword [ebp - 0x10]
jbe 0x4817c0
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.004add25
mov ecx, dword [ebp - 4]
push ecx
call fcn.004add25
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.00464a80
add esp, 0xc
call fcn.00480260
add esp, 4
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebp - 8]
push edx
call fcn.004add25
mov eax, dword [ebp - 4]
push eax
call fcn.004add25
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 0x481969
push ecx
mov edx, esp
mov dword [ebp + 8], esp
push edi
push str.PATHTREE_LoadTreeFromDisk:_file__s_doesnt_exist.
push edx
call fcn.00464a80
add esp, 0xc
jmp 0x481981
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.00464a80
add esp, 0x10
call fcn.00480260
add esp, 4
push ebx
call fcn.004add25
mov edx, dword [ebp - 4]
push edx
call fcn.004add25
add esp, 8
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret 8