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

Disassembly:
push ebp
lea ebp, [esp - 0x1004]
mov eax, 0x1004
call fcn.00502fa0
push 0xffffffffffffffff
push 0x51ae08
mov eax, dword fs:[0]
push eax
sub esp, 0x20
mov eax, dword [0x5513d4]
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 [0x570b14], 0
je 0x40ba24
push 0
push 1
push 0x56fafa
mov ecx, 0x57b208
call fcn.00406f60
cmp eax, 1
jne 0x40ba24
mov eax, dword [0x5685c0]
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x10], 0
cmp eax, 3
je 0x40b84f
cmp eax, 4
je 0x40b84f
push 1
lea eax, [ebp - 0x10]
mov ecx, 0x57b208
push eax
lea eax, [ebp - 0x14]
push eax
call fcn.004061b0
jmp 0x40b863
push 1
lea eax, [ebp - 0x10]
mov ecx, 0x57b208
push eax
lea eax, [ebp - 0x18]
push eax
call fcn.004062b0
cmp dword [ebp - 0x10], 0
je 0x40ba24
push 0x800
lea eax, [ebp]
mov ecx, 0x570afc
push eax
call fcn.0049d080
lea eax, [ebp]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40b8cf
push 0
push 0
push SysReAllocString
push SysReAllocString
push 0x800
lea eax, [ebp]
push eax
push 0x5645a8
call fcn.0049fbd0
cmp eax, 6
je 0x40b8bf
cmp eax, 1
je 0x40b8bf
cmp eax, 3
jne 0x40b8cf
push dword [ebp - 0x14]
call fcn.005030dd
add esp, 4
jmp 0x40ba24
push 0x524ae0
lea eax, [ebp]
push eax
call fcn.00475430
mov esi, eax
test esi, esi
jne 0x40b90c
lea eax, [ebp]
push eax
push 0x1f6
call fcn.00496b20
push eax
push 0x56fafa
call fcn.004dbba0
push dword [ebp - 0x14]
call fcn.005030dd
add esp, 0x10
jmp 0x40ba24
mov eax, dword [0x5685c0]
cmp eax, 3
jne 0x40b96b
push esi
push 0xff
call fcn.00509d89
push esi
push 0xfe
call fcn.00509d89
xor edi, edi
add esp, 0x10
cmp dword [ebp - 0x10], edi
jbe 0x40ba0b
lea ebx, [ebx]
mov eax, dword [ebp - 0x18]
push esi
movzx eax, word [eax + edi*2]
push eax
call fcn.00509d89
mov eax, dword [ebp - 0x18]
push esi
movzx eax, byte [eax + edi*2 + 1]
push eax
call fcn.00509d89
inc edi
add esp, 0x10
cmp edi, dword [ebp - 0x10]
jb 0x40b940
jmp 0x40ba0b
cmp eax, 4
jne 0x40b9e7
push esi
push 0xef
call fcn.00509d89
push esi
push 0xbb
call fcn.00509d89
push esi
push 0xbf
call fcn.00509d89
mov eax, dword [ebp - 0x10]
lea ecx, [ebp - 0x2c]
add esp, 0x18
shl eax, 2
push eax
call fcn.00404630
mov dword [ebp - 4], 0
push dword [ebp - 0x28]
mov edi, dword [ebp - 0x2c]
push edi
push dword [ebp - 0x18]
call fcn.004a02c0
mov ecx, edi
lea edx, [ecx + 1]
mov edi, edi
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40b9c0
push esi
sub ecx, edx
push ecx
push 1
push edi
call fcn.0050a0c5
add esp, 0x10
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x2c]
call fcn.004048e0
jmp 0x40ba0b
cmp eax, 2
jne 0x40b9fa
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.0050a0c5
add esp, 0x10
push esi
call fcn.00509ce0
push dword [ebp - 0x14]
call fcn.005030dd
push dword [ebp - 0x18]
call fcn.005030dd
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.00502f8e
lea esp, [ebp + 0x1004]
pop ebp
ret 4