Function at 0x40ba70
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x44
push ebx
push ebp
mov ebp, dword [esp + 0x50]
mov eax, dword [ebp]
push esi
push edi
mov edi, dword [eax + 0x8644]
mov ecx, dword [edi]
push 0x5c
push ecx
call fcn.0041fd60
mov esi, dword [ebp]
mov ebx, eax
xor eax, eax
add esp, 8
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], eax
call fcn.004168e0
test ebx, ebx
mov ecx, dword [ebp]
mov dword [esp + 0x20], edx
mov edx, dword [esi + 0x14c]
mov dword [esp + 0x1c], eax
mov dword [ebp + 0x274], edx
mov eax, dword [esi + 0xfc]
mov dword [ebp + 0x278], eax
lea eax, [esi + 0x524]
mov dword [ecx + 0xd4], eax
je 0x40badf
mov al, byte [ebx + 1]
test al, al
jne 0x40baec
pop edi
pop esi
pop ebp
mov eax, 0x25
pop ebx
add esp, 0x44
ret
mov eax, dword [esi + 0x8634]
mov edx, dword [esi + 0x8630]
or edx, eax
mov eax, dword [edi]
je 0x40bb0e
push 0x4338e0
push eax
call fcn.0041fbab
add esp, 8
jmp 0x40bb45
mov ecx, dword [ebp]
mov edx, dword [ecx + 0x318]
push edx
push 0x8301
push eax
call fcn.0042c7ca
add esp, 0xc
test eax, eax
jge 0x40bb2f
mov ecx, dword [edi]
push ecx
jmp 0x40bb52
push eax
call fcn.00427022
mov edx, dword [edi]
push 0x4338dc
push edx
call fcn.0041fbab
add esp, 0xc
mov ebx, eax
test ebx, ebx
mov dword [esp + 0x58], ebx
jne 0x40bb6d
mov eax, dword [edi]
push eax
push str.Cant_open__s_for_writing
push esi
call fcn.00403490
add esp, 0xc
pop edi
pop esi
pop ebp
mov eax, 0x17
pop ebx
add esp, 0x44
ret
mov eax, dword [esi + 0x1a0]
cmp eax, 0xffffffff
mov ecx, dword [esi + 0x1a4]
jne 0x40bb82
cmp ecx, eax
je 0x40bb8d
push ecx
push eax
push esi
call fcn.00416e80
add esp, 0xc
mov eax, dword [esi + 0x8634]
test eax, eax
jg 0x40bbf6
jl 0x40bba3
mov eax, dword [esi + 0x8630]
test eax, eax
jae 0x40bbf6
lea ecx, [esp + 0x24]
push ecx
push ebx
call fcn.004263f3
add esp, 4
push eax
call fcn.00429d34
add esp, 8
test eax, eax
je 0x40bbe2
push ebx
call fcn.0041fa7b
mov edx, dword [edi]
push edx
push str.Cant_get_the_size_of__s
push esi
call fcn.00403490
add esp, 0x10
pop edi
pop esi
pop ebp
mov eax, 0x17
pop ebx
add esp, 0x44
ret
mov eax, dword [esp + 0x3c]
mov dword [esi + 0x8630], eax
mov ecx, dword [esp + 0x40]
mov dword [esi + 0x8634], ecx
lea edx, [esp + 0x10]
push edx
push 0x4000
push ebp
call fcn.004024f0
mov edi, eax
add esp, 0xc
test edi, edi
jne 0x40bd1c
mov edx, dword [esp + 0x10]
test edx, edx
jle 0x40bd0a
mov ecx, dword [esi + 0x8630]
mov eax, dword [esi + 0x8634]
mov ebx, ecx
or ebx, eax
mov edi, edx
je 0x40bc5b
xor edi, edi
xor ebx, ebx
cmp edi, eax
jg 0x40bcd0
jl 0x40bc49
cmp edx, ecx
ja 0x40bcd0
sub ecx, edx
sbb eax, edi
mov dword [esi + 0x8630], ecx
mov dword [esi + 0x8634], eax
xor edi, edi
lea eax, [esi + 0x524]
mov ebx, dword [esp + 0x58]
push ebx
push edi
push 1
push eax
call fcn.0041f994
add esp, 0x10
cmp eax, edi
jne 0x40bcf2
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
add eax, edi
adc ecx, 0
push ecx
push eax
push esi
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], ecx
call fcn.00416e20
push ebp
call fcn.00416ec0
add esp, 0x10
test eax, eax
jne 0x40bd17
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x1c]
push eax
push ecx
push esi
call fcn.004178b0
mov edi, eax
add esp, 0xc
test edi, edi
je 0x40bbf6
push ebx
call fcn.0041fa7b
add esp, 4
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x44
ret
mov ecx, dword [esi + 0x8630]
sub edx, ecx
lea eax, [ecx + esi + 0x524]
mov edi, edx
mov dword [esi + 0x8630], ebx
mov dword [esi + 0x8634], ebx
jmp 0x40bc61
push ebx
mov edi, 0x37
call fcn.0041fa7b
add esp, 4
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x44
ret
push ebp
call fcn.00416ec0
add esp, 4
test eax, eax
je 0x40bd1c
mov edi, 0x2a
push ebx
call fcn.0041fa7b
add esp, 4
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x44
ret