Function at 0x40a550
Capabilities:
Check if file exists
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x458e84
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0xc3c
push ebx
push ebp
mov ebx, ecx
push esi
push edi
mov dword [esp + 0x14], ebx
lea edi, [ebx + 4]
mov dword [edi], 0
mov dword [esp + 0xc54], 0
mov dword [ebx + 8], 0
mov eax, dword [esp + 0xc68]
mov eax, dword [eax]
test eax, eax
mov dword [ebx + 0xc], eax
je 0x40a5aa
add eax, 8
push eax
call dword [0x45d1b4]
mov ebp, dword [esp + 0xc60]
mov dword [ebx], 0x45d644
mov byte [esp + 0xc54], 2
mov eax, dword [ebp]
test eax, eax
je 0x40a9c8
mov eax, dword [eax]
test eax, eax
je 0x40a9c8
push eax
call dword [0x45d354]
test eax, eax
jbe 0x40a9c8
mov eax, dword [ebp]
test eax, eax
je 0x40a5ee
mov eax, dword [eax]
jmp 0x40a5f0
xor eax, eax
push eax
call dword [0x45d3a0]
test eax, eax
jne 0x40a8eb
call fcn.00403780
mov esi, eax
test esi, esi
je 0x40a9c8
mov ecx, edi
call fcn.0040d5d0
mov dword [edi], 0
mov ecx, dword [esi]
push edi
push esi
call dword [ecx + 0x78]
test eax, eax
jl 0x40a9c8
push ebp
lea ecx, [ebx + 8]
call fcn.0040a9f0
mov esi, dword [esp + 0xc64]
mov ecx, edi
mov dword [ebx + 0x10], esi
call fcn.0040d400
mov edx, dword [eax]
push 0xffffffffffffffff
push eax
call dword [edx + 0x4c]
mov ecx, edi
call fcn.0040d400
mov ecx, dword [eax]
push 0
push eax
call dword [ecx + 0x50]
test esi, esi
je 0x40a699
push str.version1.0_encodingutf_8
lea ecx, [esp + 0x14]
call fcn.00401090
lea edx, [esp + 0x10]
mov ecx, ebx
push edx
mov byte [esp + 0xc58], 3
call fcn.0040abd0
lea ecx, [esp + 0x10]
mov esi, eax
mov byte [esp + 0xc54], 2
call fcn.00409ee0
jmp 0x40a8d4
mov eax, dword [ebp]
mov dword [esp + 0x18], 0
test eax, eax
je 0x40a6ac
mov eax, dword [eax]
jmp 0x40a6ae
xor eax, eax
push eax
call dword [0x45d394]
test eax, eax
je 0x40a72a
push ebp
lea ecx, [esp + 0x30]
call fcn.0040aa90
mov ebx, dword [eax]
mov ebp, dword [eax + 4]
mov esi, dword [eax + 8]
mov eax, dword [eax + 0xc]
mov ecx, edi
mov byte [esp + 0xc54], 4
mov dword [esp + 0x28], eax
call fcn.0040d400
lea edx, [esp + 0x18]
mov ecx, dword [eax]
push edx
sub esp, 0x10
mov edx, esp
push eax
mov dword [edx], ebx
mov dword [edx + 4], ebp
mov dword [edx + 8], esi
mov esi, dword [esp + 0x40]
mov dword [edx + 0xc], esi
call dword [ecx + 0x30]
mov dword [esp + 0x10], eax
lea eax, [esp + 0x2c]
push eax
mov byte [esp + 0xc58], 2
call dword [0x45d374]
test eax, eax
jge 0x40a8c4
push eax
call fcn.00457710
jmp 0x40a8c4
mov dword [esp + 0x10], 0x80004005
call fcn.00403780
test eax, eax
je 0x40a8c8
mov ecx, dword [eax]
push eax
call dword [ecx + 0x6c]
mov esi, eax
test esi, esi
je 0x40a8c8
mov ebp, dword [ebp]
test ebp, ebp
je 0x40a75b
mov eax, dword [ebp]
jmp 0x40a75d
xor eax, eax
mov edx, dword [esi]
push eax
push 0
push esi
call dword [edx + 0x10]
mov ebp, eax
test ebp, ebp
jle 0x40a8c8
push ebp
call dword [0x45d32c]
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x40a8c4
mov ecx, ebp
xor eax, eax
mov edx, ecx
mov edi, ebx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esp + 0xc60]
mov eax, dword [eax]
test eax, eax
je 0x40a7a9
mov eax, dword [eax]
jmp 0x40a7ab
xor eax, eax
mov ecx, dword [esi]
push ebp
push ebx
push eax
push 0
push esi
call dword [ecx + 0x14]
lea edx, [esp + 0x244]
mov ecx, 0x82
xor eax, eax
lea edi, [esp + 0x244]
push edx
push 0x104
rep stosd dword es:[edi], eax
call dword [0x45d178]
mov ecx, 0x82
xor eax, eax
lea edi, [esp + 0x3c]
rep stosd dword es:[edi], eax
mov eax, dword [0x4647b0]
mov ecx, eax
inc eax
mov dword [0x4647b0], eax
lea eax, [esp + 0x3c]
push eax
push ecx
lea ecx, [esp + 0x24c]
push 0x4647a8
push ecx
call dword [0x45d17c]
lea edx, [esp + 0x3c]
push 0x4647a0
push edx
call dword [0x45d308]
mov esi, eax
add esp, 8
test esi, esi
je 0x40a8ba
push esi
push 1
push ebp
push ebx
call dword [0x45d30c]
push esi
call dword [0x45d310]
add esp, 0x14
lea eax, [esp + 0x3c]
lea ecx, [esp + 0x1c]
push eax
call fcn.0040aad0
mov ecx, dword [eax + 0xc]
mov edx, dword [esp + 0x14]
mov esi, dword [eax]
mov edi, dword [eax + 4]
mov ebp, dword [eax + 8]
mov dword [esp + 0x38], ecx
lea ecx, [edx + 4]
mov byte [esp + 0xc54], 5
call fcn.0040d400
lea edx, [esp + 0x18]
mov ecx, dword [eax]
push edx
sub esp, 0x10
mov edx, esp
push eax
mov dword [edx], esi
mov esi, dword [esp + 0x50]
mov dword [edx + 4], edi
mov dword [edx + 8], ebp
mov dword [edx + 0xc], esi
call dword [ecx + 0x30]
mov dword [esp + 0x10], eax
lea eax, [esp + 0x1c]
push eax
mov byte [esp + 0xc58], 2
call dword [0x45d374]
test eax, eax
jge 0x40a8af
push eax
call fcn.00457710
lea ecx, [esp + 0x3c]
push ecx
call dword [0x45d180]
push ebx
call dword [0x45d338]
add esp, 4
mov ebx, dword [esp + 0x14]
cmp word [esp + 0x18], 0
je 0x40a8dc
mov esi, dword [esp + 0x10]
test esi, esi
jge 0x40a9c8
push 0
lea ecx, [ebx + 4]
call fcn.0040d3d0
jmp 0x40a9c8
mov eax, dword [esp + 0xc5c]
lea edx, [esp + 0x44c]
push 0x400
push edx
push eax
call dword [0x45d1e0]
lea ecx, [esp + 0x44c]
push ecx
call dword [0x45d39c]
mov ebp, dword [ebp]
test ebp, ebp
je 0x40a920
mov ebp, dword [ebp]
jmp 0x40a922
xor ebp, ebp
lea edx, [esp + 0x44c]
push ebp
lea eax, [esp + 0x450]
push edx
push eax
call dword [0x45d398]
push 0xc
call fcn.00458152
add esp, 4
mov dword [esp + 0x18], eax
test eax, eax
mov byte [esp + 0xc54], 6
je 0x40a964
lea ecx, [esp + 0x44c]
push ecx
mov ecx, eax
call fcn.00409f30
jmp 0x40a966
xor eax, eax
test eax, eax
mov byte [esp + 0xc54], 2
mov dword [esp + 0x10], eax
jne 0x40a980
push 0x8007000e
call fcn.00457710
mov edx, dword [esp + 0xc64]
lea eax, [esp + 0x10]
push edx
push eax
mov ecx, ebx
mov byte [esp + 0xc5c], 7
call fcn.0040add0
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40a9c8
mov esi, eax
add eax, 8
push eax
call dword [0x45d1b0]
test eax, eax
jne 0x40a9c8
test esi, esi
je 0x40a9c8
mov ecx, esi
call fcn.0040aa60
push esi
call fcn.0044c87a
add esp, 4
mov ecx, dword [esp + 0xc4c]
pop edi
pop esi
mov eax, ebx
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0xc48
ret 0x10