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

Disassembly:
push ebp
lea ebp, [esp - 0x1004]
mov eax, 0x1004
call fcn.00507730
push 0xffffffffffffffff
push 0x537368
mov eax, dword fs:[0]
push eax
sub esp, 0x20
mov eax, dword [0x5755c4]
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 [0x599f04], 0
je 0x40bed4
push 0
push 1
push 0x598eea
mov ecx, 0x5a6670
call fcn.004074c0
cmp eax, 1
jne 0x40bed4
mov eax, dword [0x58f9b0]
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x10], 0
cmp eax, 3
je 0x40bcff
cmp eax, 4
je 0x40bcff
push 1
lea eax, [ebp - 0x10]
mov ecx, 0x5a6670
push eax
lea eax, [ebp - 0x14]
push eax
call fcn.00406710
jmp 0x40bd13
push 1
lea eax, [ebp - 0x10]
mov ecx, 0x5a6670
push eax
lea eax, [ebp - 0x18]
push eax
call fcn.00406810
cmp dword [ebp - 0x10], 0
je 0x40bed4
push 0x800
lea eax, [ebp]
mov ecx, 0x599eec
push eax
call fcn.0049de10
lea eax, [ebp]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40bd7f
push 0
push 0
push SysReAllocString
push SysReAllocString
push 0x800
lea eax, [ebp]
push eax
push 0x58b998
call fcn.004a0910
cmp eax, 6
je 0x40bd6f
cmp eax, 1
je 0x40bd6f
cmp eax, 3
jne 0x40bd7f
push dword [ebp - 0x14]
call fcn.0050786d
add esp, 4
jmp 0x40bed4
push 0x5421b8
lea eax, [ebp]
push eax
call fcn.00476380
mov esi, eax
test esi, esi
jne 0x40bdbc
lea eax, [ebp]
push eax
push 0x1f6
call fcn.00497960
push eax
push 0x598eea
call fcn.004dd4d0
push dword [ebp - 0x14]
call fcn.0050786d
add esp, 0x10
jmp 0x40bed4
mov eax, dword [0x58f9b0]
cmp eax, 3
jne 0x40be1b
push esi
push 0xff
call fcn.00525af6
push esi
push 0xfe
call fcn.00525af6
xor edi, edi
add esp, 0x10
cmp dword [ebp - 0x10], edi
jbe 0x40bebb
lea ebx, [ebx]
mov eax, dword [ebp - 0x18]
push esi
movzx eax, word [eax + edi*2]
push eax
call fcn.00525af6
mov eax, dword [ebp - 0x18]
push esi
movzx eax, byte [eax + edi*2 + 1]
push eax
call fcn.00525af6
inc edi
add esp, 0x10
cmp edi, dword [ebp - 0x10]
jb 0x40bdf0
jmp 0x40bebb
cmp eax, 4
jne 0x40be97
push esi
push 0xef
call fcn.00525af6
push esi
push 0xbb
call fcn.00525af6
push esi
push 0xbf
call fcn.00525af6
mov eax, dword [ebp - 0x10]
lea ecx, [ebp - 0x2c]
add esp, 0x18
shl eax, 2
push eax
call fcn.00404ad0
mov dword [ebp - 4], 0
push dword [ebp - 0x28]
mov edi, dword [ebp - 0x2c]
push edi
push dword [ebp - 0x18]
call fcn.004a1010
mov ecx, edi
lea edx, [ecx + 1]
mov edi, edi
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40be70
push esi
sub ecx, edx
push ecx
push 1
push edi
call fcn.00525e32
add esp, 0x10
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x2c]
call fcn.00404d90
jmp 0x40bebb
cmp eax, 2
jne 0x40beaa
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.00525e32
add esp, 0x10
push esi
call fcn.00525a4d
push dword [ebp - 0x14]
call fcn.0050786d
push dword [ebp - 0x18]
call fcn.0050786d
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.00507712
lea esp, [ebp + 0x1004]
pop ebp
ret 4