Function at 0x4127e0
Capabilities:
Check if file exists
Get common file path
Get file attributes

Disassembly:
sub esp, 0x868
mov eax, dword [0x451050]
xor eax, esp
mov dword [esp + 0x864], eax
push ebx
push ebp
mov ebp, dword [esp + 0x874]
push esi
push edi
push 0x54
lea eax, [esp + 0x20]
mov edi, edx
push 0
push eax
mov esi, ecx
mov dword [esp + 0x20], edi
mov dword [esp + 0x24], 0x58
call fcn.00437610
add esp, 0xc
mov dword [esp + 0x1c], esi
test edi, edi
je 0x41282c
mov eax, edi
jmp 0x41283f
cmp dword [0x4587f8], 8
mov eax, dword [0x4587e4]
jae 0x41283f
mov eax, 0x4587e4
push eax
mov dword [esp + 0x48], eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x412853
test al, 0x10
jne 0x41285b
mov dword [esp + 0x44], 0
push 0x800
lea ecx, [esp + 0x74]
push 0
push ecx
call fcn.00437610
add esp, 0xc
xor esi, esi
xor edi, edi
cmp esi, 0x400
jae 0x4128e9
lea edx, [esp + esi*2 + 0x70]
push edx
lea eax, [edi + 0x4e48]
mov ebx, 0x400
sub ebx, esi
push eax
call fcn.0040af30
mov ebx, dword [edi*4 + 0x452520]
lea esi, [esi + eax + 1]
mov ecx, 0x400
add esp, 8
sub ecx, esi
mov edx, 0
je 0x4128b7
cmp ecx, 0x7fffffff
jbe 0x4128bc
mov edx, 0x80070057
mov eax, edx
test edx, edx
jl 0x4128cd
lea edx, [esp + esi*2 + 0x70]
mov eax, ebx
call fcn.004012b0
test eax, eax
jne 0x4128e3
mov ecx, dword [edi*4 + 0x452520]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
lea esi, [esi + eax + 1]
inc edi
cmp edi, 5
jb 0x412873
xor edx, edx
lea eax, [esp + esi*2 + 0x70]
xor ecx, ecx
mov word [eax], dx
lea edx, [esp + 0x70]
mov word [eax - 2], cx
mov dword [esp + 0x24], edx
cmp dword [0x4587d8], ecx
jbe 0x41295e
cmp dword [0x4587dc], 8
mov eax, dword [0x4587c8]
jae 0x41291b
mov eax, 0x4587c8
mov ecx, 0x404
mov edx, ebp
call fcn.004012b0
mov eax, dword [0x452504]
lea ecx, [eax - 1]
cmp ecx, 4
ja 0x412947
mov edx, dword [0x452508]
mov dword [0x4524fc], eax
mov dword [0x452500], edx
jmp 0x412972
mov eax, dword [0x4524fc]
push eax
mov edi, 0x404
mov eax, ebp
call fcn.00430b30
add esp, 4
jmp 0x412972
push 0xffffffffffffffff
push 0
push 0x404
push ebp
xor ecx, ecx
call fcn.004115e0
add esp, 0x10
mov ecx, dword [0x4524fc]
mov edx, dword [0x459f78]
lea eax, [esp + 0x18]
mov esi, 1
add dword [0x459ff4], esi
push eax
mov dword [esp + 0x38], ebp
mov dword [esp + 0x3c], 0x404
mov dword [esp + 0x34], ecx
mov dword [esp + 0x50], 0x80066
mov dword [esp + 0x60], 0x412320
mov dword [esp + 0x24], edx
mov dword [esp + 0x64], 0xc7
call dword [sym.imp.COMDLG32.dll_GetSaveFileNameW]
sub dword [0x459ff4], esi
mov ebx, eax
test ebx, ebx
je 0x412a2e
mov eax, dword [esp + 0x30]
mov dword [0x4524fc], eax
push eax
mov edi, 0x404
mov eax, ebp
call fcn.00430b30
xor ecx, ecx
add esp, 4
mov word [esp + 0x70], cx
cmp dword [esp + 0x14], ecx
jne 0x412a2e
lea edx, [esp + 0x70]
push edx
push 0x400
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
test eax, eax
jbe 0x412a2e
lea eax, [esp + 0x70]
lea edx, [eax + 2]
lea ecx, [ecx]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x412a10
sub eax, edx
sar eax, 1
push eax
lea eax, [esp + 0x74]
mov esi, 0x4587e0
call fcn.00403960
mov ecx, dword [esp + 0x874]
pop edi
pop esi
pop ebp
mov eax, ebx
pop ebx
xor ecx, esp
call fcn.00433c32
add esp, 0x868
ret