Function at 0x4816c0
Capabilities:
Delete file
Get file size
Read file via mapping

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [ebp + 8]
sub esp, 0x24
push edi
mov edi, dword [ebp + 0xc]
mov dword [eax + 8], 0
cmp word [edi], 0
jne 0x4816e6
mov eax, 3
pop edi
mov esp, ebp
pop ebp
ret 8
push ebx
push esi
mov esi, 0x200
push esi
mov dword [ebp - 0x1c], esi
mov dword [ebp - 0x18], esi
call fcn.004a5222
mov ebx, eax
push esi
mov dword [ebp - 8], ebx
call fcn.004a5222
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 0x48197f
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
push ebx
lea ecx, [ebp - 0x20]
push str.PATHTREE_LoadTreeFromDisk:_FileSize_ul
push ecx
mov dword [ebp - 0xc], ebx
call fcn.00462190
mov edx, dword [eax]
push edx
push str.PATHTREE
call fcn.0045fbe0
mov eax, dword [ebp - 0x20]
add eax, 0xfffffff0
add esp, 0x14
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x48177a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push 0
push 0
push 0
push 2
push 0
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov edi, eax
mov dword [ebp - 0x24], edi
test edi, edi
je 0x4818d3
push 0
push 0
push 0
push 4
push edi
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [ebp - 0x10], eax
test eax, eax
je 0x4818cc
cmp ebx, 4
jb 0x4818fd
mov ecx, dword [eax]
mov edx, dword [ebp + 8]
mov dword [edx + 0xc], ecx
mov ecx, edx
cmp dword [ecx + 0xc], 2
mov edi, 4
jne 0x4818fd
cmp ebx, 0x10
jb 0x4818c2
jmp 0x4817e3
mov ebx, dword [ebp - 0xc]
lea edx, [edi + 0xc]
mov dword [ebp - 0x20], edx
cmp edx, ebx
ja 0x4818fd
mov ecx, dword [edi + eax]
mov ebx, dword [edi + eax + 4]
mov esi, dword [edi + eax + 8]
cmp ecx, 0x410509e8
jne 0x4818fa
test esi, esi
je 0x4818fa
cmp dword [ebp - 0x18], ebx
jae 0x481830
mov edx, dword [ebp - 4]
push edx
call fcn.004a5105
push ebx
mov dword [ebp - 0x18], ebx
call fcn.004a5222
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 0x4818fa
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 4]
push ebx
add edx, eax
push edx
push ecx
call fcn.004a4da0
lea edi, [esi + 2]
add esp, 0xc
cmp dword [ebp - 0x1c], edi
jae 0x481872
mov edx, dword [ebp - 8]
push edx
call fcn.004a5105
push edi
mov dword [ebp - 0x1c], edi
call fcn.004a5222
add esp, 8
mov dword [ebp - 8], eax
mov eax, dword [ebp - 0x20]
lea edi, [esi + eax]
cmp edi, dword [ebp - 0xc]
ja 0x4818fa
mov edx, dword [ebp - 0x10]
mov ecx, eax
mov eax, dword [ebp - 8]
push esi
add ecx, edx
push ecx
push eax
call fcn.004a4da0
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 8]
add esp, 0xc
xor ecx, ecx
push ecx
push ebx
push edx
push eax
shr esi, 1
mov word [eax + esi*2], cx
mov eax, dword [ebp + 8]
push eax
lea eax, [ecx + 1]
call fcn.00480ad0
mov esi, dword [ebp - 0x14]
mov eax, dword [ebp - 0x10]
lea ecx, [edi + 0xc]
cmp ecx, dword [ebp - 0xc]
jbe 0x4817e0
push eax
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov edi, dword [ebp - 0x24]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebp - 8]
push edx
call fcn.004a5105
mov eax, dword [ebp - 4]
push eax
call fcn.004a5105
add esp, 8
pop esi
pop ebx
xor eax, eax
pop edi
mov esp, ebp
pop ebp
ret 8
mov esi, dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea edx, [ebp - 0x24]
push str._PATHTREE_LoadTreeFromDisk:_ERROR__tree_is_malformed__LE_d
push edx
call fcn.00462190
mov eax, dword [eax]
push eax
push str.PATHTREE
call fcn.0045fbe0
mov eax, dword [ebp - 0x24]
add eax, 0xfffffff0
add esp, 0x14
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x481941
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 8]
push ecx
call fcn.004a5105
mov edx, dword [ebp - 4]
push edx
call fcn.004a5105
mov eax, dword [ebp + 0xc]
add esp, 8
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov ecx, dword [ebp + 8]
pop esi
pop ebx
mov dword [ecx + 8], 0
mov eax, 2
pop edi
mov esp, ebp
pop ebp
ret 8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push edi
lea ecx, [ebp + 8]
push str._PATHTREE_LoadTreeFromDisk:_FAILED_to_open_file__s__LE_d
push ecx
call fcn.00462190
mov edx, dword [eax]
push edx
push str.PATHTREE
call fcn.0045fbe0
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
add esp, 0x18
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4819c4
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push ebx
call fcn.004a5105
mov ecx, dword [ebp - 4]
push ecx
call fcn.004a5105
add esp, 8
pop esi
pop ebx
mov eax, 1
pop edi
mov esp, ebp
pop ebp
ret 8