Function at 0x4506fe
Capabilities:
Check if file exists
Resolve function by parsing pe exports
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x5740dd
mov eax, dword fs:[0]
push eax
sub esp, 0x888
mov eax, dword [0x5c8910]
xor eax, esp
mov dword [esp + 0x880], eax
push ebx
push esi
push edi
mov eax, dword [0x5c8910]
xor eax, esp
push eax
lea eax, [esp + 0x898]
mov dword fs:[0], eax
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp + 0x14]
mov esi, dword [ebp + 8]
push eax
lea eax, [esp + 0x480]
mov dword [esp + 0x34], esi
push 0x5a25f8
push eax
mov dword [esp + 0x40], ecx
call fcn.00450ea9
xor ebx, ebx
mov dword [esp + 0x38], eax
xor edi, edi
mov dword [esp + 0x20], ebx
add esp, 0xc
mov dword [esp + 0x18], edi
cmp dword [ebp + 0xc], 0x1e
jbe 0x450af7
mov ecx, dword [esi]
call fcn.00450064
test eax, eax
je 0x450af3
movzx eax, word [esi + 0x1a]
movzx ecx, word [esi + 0x1c]
add ecx, eax
mov eax, dword [esi + 0x12]
add eax, 0x1e
add ecx, eax
mov eax, dword [ebp + 0xc]
sub eax, ebx
mov dword [esp + 0x28], ecx
cmp ecx, eax
jg 0x450af3
or dword [esp + 0x10], 0xffffffff
xor edi, edi
or dword [esp + 0x20], 0xffffffff
and dword [esp + 0x24], edi
cmp dword [esi + 0x16], 0x100000
jbe 0x450876
xor eax, eax
push 0x206
push eax
mov word [esp + 0x68c], ax
lea eax, [esp + 0x68e]
push eax
call fcn.00538910
add esp, 0xc
lea ecx, [esp + 0x684]
call fcn.004500ad
xor eax, eax
push eax
push 0x4000100
push 2
push eax
push eax
push 0x10000000
lea eax, [esp + 0x69c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [esp + 0x10], eax
cmp eax, 0xffffffff
je 0x450abe
push edi
push edi
push dword [esi + 0x16]
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push dword [esp + 0x10]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
xor eax, eax
push eax
push eax
push eax
push 4
push eax
push dword [esp + 0x24]
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov dword [esp + 0x20], eax
cmp eax, 0xffffffff
je 0x450abe
xor ecx, ecx
push ecx
push ecx
push ecx
push 0xf001f
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [esp + 0x24], 1
jmp 0x45087f
push dword [esi + 0x16]
call fcn.0051b796
pop ecx
mov edi, eax
test edi, edi
je 0x450aae
mov ecx, dword [esi + 0x12]
mov eax, dword [esp + 0x28]
and dword [esp + 0x1c], 0
sub eax, ecx
add eax, esi
cmp ecx, dword [esi + 0x16]
je 0x4508b9
lea edx, [esp + 0x1c]
push edx
push dword [esi + 0x16]
mov edx, ecx
mov ecx, eax
push edi
call fcn.0045885e
mov ebx, dword [esp + 0x28]
add esp, 0xc
jmp 0x4508ca
mov ebx, dword [esi + 0xe]
push ecx
push eax
push dword [esi + 0x16]
push edi
call fcn.00539312
add esp, 0x10
cmp dword [esi + 0xe], ebx
jne 0x450aaa
movzx eax, word [esi + 0x1a]
lea ecx, [esp + 0x54]
push eax
lea eax, [esi + 0x1e]
mov dword [esp + 0x6c], 0xf
xor ebx, ebx
push eax
mov dword [esp + 0x6c], ebx
mov byte [esp + 0x5c], bl
call fcn.0040eb6a
mov dword [esp + 0x8a0], ebx
xor eax, eax
mov dword [esp + 0x50], 7
mov dword [esp + 0x4c], ebx
mov word [esp + 0x3c], ax
lea eax, [esp + 0x3c]
mov byte [esp + 0x8a0], 1
push eax
lea eax, [esp + 0x58]
push 0xfde9
push eax
call fcn.0043e484
mov ebx, dword [esp + 0x40]
add esp, 0xc
test ebx, ebx
je 0x4509ab
xor eax, eax
push 0x206
push eax
mov word [esp + 0x27c], ax
lea eax, [esp + 0x27e]
push eax
call fcn.00538910
add esp, 0xc
lea eax, [esp + 0x3c]
cmp dword [esp + 0x50], 8
cmovae eax, dword [esp + 0x3c]
push eax
lea eax, [esp + 0x278]
push 0x104
push eax
call fcn.005393dd
add esp, 0xc
lea eax, [esp + 0x274]
push eax
call ebx
pop ecx
test al, al
je 0x4509ab
lea eax, [esp + 0x274]
push eax
call fcn.004086f2
pop ecx
push eax
lea eax, [esp + 0x278]
push eax
lea ecx, [esp + 0x44]
call fcn.00408679
cmp dword [esp + 0x50], 8
lea eax, [esp + 0x3c]
mov ecx, dword [esp + 0x2c]
cmovae eax, dword [esp + 0x3c]
push eax
mov eax, 0x104
sub eax, ecx
push 0x5a2600
push eax
lea eax, [esp + 0x488]
lea eax, [eax + ecx*2]
push eax
call fcn.00537692
add esp, 0xc
lea eax, [esp + 0x480]
push eax
call fcn.0045007b
xor eax, eax
xor ebx, ebx
push 0x206
mov word [esp + 0x78], ax
lea eax, [esp + 0x7a]
push ebx
push eax
call fcn.00538910
add esp, 0x14
lea eax, [esp + 0x47c]
push eax
lea eax, [esp + 0x70]
push 0x104
push eax
call fcn.005393dd
add esp, 0xc
lea eax, [esp + 0x6c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
lea eax, [esp + 0x6c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x450a47
lea eax, [esp + 0x6c]
push eax
push ebx
call dword [sym.imp.SHELL32.dll_SHCreateDirectory]
push ebx
push 0x80
push 2
push ebx
push ebx
push 0x40000000
lea eax, [esp + 0x494]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x450a84
push 0
lea eax, [esp + 0x3c]
push eax
push dword [esi + 0x16]
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
inc dword [esp + 0x18]
lea ecx, [esp + 0x3c]
push 0
push 1
call fcn.00403256
or dword [esp + 0x8a0], 0xffffffff
lea ecx, [esp + 0x54]
push 0
push 1
call fcn.00403364
mov ebx, dword [esp + 0x14]
cmp dword [esp + 0x24], 0
je 0x450abe
push edi
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
jmp 0x450ac5
push edi
call fcn.0053b82d
pop ecx
push dword [esp + 0x20]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call edi
push dword [esp + 0x10]
call edi
add ebx, dword [esp + 0x28]
mov ecx, dword [ebp + 0xc]
mov esi, dword [esp + 0x30]
sub ecx, ebx
add esi, ebx
mov dword [esp + 0x14], ebx
cmp ecx, 0x1e
ja 0x45077f
mov edi, dword [esp + 0x18]
mov eax, edi
mov ecx, dword [esp + 0x898]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x880]
xor ecx, esp
call fcn.0053bd6c
mov esp, ebp
pop ebp
ret