Function at 0x409750
Capabilities:
Check if file exists
Get file attributes
Write file on windows

Disassembly:
push ebp
lea ebp, [esp - 0x1004]
mov eax, 0x1004
call fcn.004f8350
push 0xffffffffffffffff
push 0x50fb88
mov eax, dword fs:[0]
push eax
sub esp, 0x20
mov eax, dword [0x544354]
xor eax, ebp
mov dword [ebp + 0x1000], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
cmp dword [0x563a34], 0
je 0x4099c4
push 0
push 1
push 0x562a1a
mov ecx, 0x56e128
call fcn.00405c30
cmp eax, 1
jne 0x4099c4
mov eax, dword [0x55b4e0]
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x10], 0
cmp eax, 3
je 0x4097ef
cmp eax, 4
je 0x4097ef
push 1
lea eax, [ebp - 0x10]
mov ecx, 0x56e128
push eax
lea eax, [ebp - 0x14]
push eax
call fcn.004051d0
jmp 0x409803
push 1
lea eax, [ebp - 0x10]
mov ecx, 0x56e128
push eax
lea eax, [ebp - 0x18]
push eax
call fcn.004052b0
cmp dword [ebp - 0x10], 0
je 0x4099c4
push 0x800
lea eax, [ebp]
mov ecx, 0x563a1c
push eax
call fcn.004949c0
lea eax, [ebp]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40986f
push 0
push 0
push SysReAllocString
push SysReAllocString
push 0x800
lea eax, [ebp]
push eax
push 0x5574c8
call fcn.004973c0
cmp eax, 6
je 0x40985f
cmp eax, 1
je 0x40985f
cmp eax, 3
jne 0x40986f
push dword [ebp - 0x14]
call fcn.004f8488
add esp, 4
jmp 0x4099c4
push 0x517df8
lea eax, [ebp]
push eax
call fcn.0046dd80
mov esi, eax
test esi, esi
jne 0x4098ac
lea eax, [ebp]
push eax
push 0x1f6
call fcn.0048e4c0
push eax
push 0x562a1a
call fcn.004d1f40
push dword [ebp - 0x14]
call fcn.004f8488
add esp, 0x10
jmp 0x4099c4
mov eax, dword [0x55b4e0]
cmp eax, 3
jne 0x40990b
push esi
push 0xff
call fcn.004fee90
push esi
push 0xfe
call fcn.004fee90
xor edi, edi
add esp, 0x10
cmp dword [ebp - 0x10], edi
jbe 0x4099ab
lea ebx, [ebx]
mov eax, dword [ebp - 0x18]
push esi
movzx eax, word [eax + edi*2]
push eax
call fcn.004fee90
mov eax, dword [ebp - 0x18]
push esi
movzx eax, byte [eax + edi*2 + 1]
push eax
call fcn.004fee90
inc edi
add esp, 0x10
cmp edi, dword [ebp - 0x10]
jb 0x4098e0
jmp 0x4099ab
cmp eax, 4
jne 0x409987
push esi
push 0xef
call fcn.004fee90
push esi
push 0xbb
call fcn.004fee90
push esi
push 0xbf
call fcn.004fee90
mov eax, dword [ebp - 0x10]
lea ecx, [ebp - 0x2c]
add esp, 0x18
shl eax, 2
push eax
call fcn.00407f70
mov dword [ebp - 4], 0
push dword [ebp - 0x28]
mov edi, dword [ebp - 0x2c]
push edi
push dword [ebp - 0x18]
call fcn.00497a60
mov ecx, edi
lea edx, [ecx + 1]
mov edi, edi
mov al, byte [ecx]
inc ecx
test al, al
jne 0x409960
push esi
sub ecx, edx
push ecx
push 1
push edi
call fcn.004ff1cc
add esp, 0x10
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x2c]
call fcn.004040b0
jmp 0x4099ab
cmp eax, 2
jne 0x40999a
push dword [ebp - 0x10]
mov eax, dword [ebp - 0x14]
push eax
push eax
call dword [sym.imp.USER32.dll_CharToOemBuffA]
push esi
push dword [ebp - 0x10]
push 1
push dword [ebp - 0x14]
call fcn.004ff1cc
add esp, 0x10
push esi
call fcn.004fede7
push dword [ebp - 0x14]
call fcn.004f8488
push dword [ebp - 0x18]
call fcn.004f8488
add esp, 0xc
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp + 0x1000]
xor ecx, ebp
call fcn.004f833c
lea esp, [ebp + 0x1004]
pop ebp
ret 4