Function at 0x41e480
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ecx
push esi
push edi
mov edi, eax
xor esi, esi
test edi, edi
je 0x41e704
cmp byte [edi + 0x5c], 0x77
jne 0x41e704
mov dword [edi + 4], esi
nop
mov eax, 0x4000
sub eax, dword [edi + 0x10]
mov dword [ebp - 4], eax
je 0x41e4d6
mov ecx, dword [edi + 0x40]
mov edx, dword [edi + 0x48]
push ecx
push eax
push 1
push edx
call fcn.0045a140
add esp, 0x10
cmp eax, dword [ebp - 4]
jne 0x41e6f8
mov eax, dword [edi + 0x48]
mov dword [edi + 0xc], eax
mov dword [edi + 0x10], 0x4000
test esi, esi
jne 0x41e6e6
mov esi, dword [edi + 0x1c]
test esi, esi
je 0x41e6a3
cmp dword [edi + 0xc], 0
je 0x41e69a
cmp dword [edi], 0
jne 0x41e502
cmp dword [edi + 4], 0
jne 0x41e69a
cmp dword [edi + 0x10], 0
jne 0x41e51b
mov ecx, dword [str.buffer_error]
mov dword [edi + 0x18], ecx
mov eax, 0xfffffffb
jmp 0x41e6a8
cmp dword [esi + 4], 0x2a
mov dword [esi], edi
mov dword [esi + 0x20], 4
jne 0x41e59d
mov ecx, dword [esi + 0x28]
mov eax, dword [esi + 0x7c]
sub ecx, 8
dec eax
shl ecx, 0xc
sar eax, 1
add ecx, 0x800
cmp eax, 3
jbe 0x41e549
mov eax, 3
shl eax, 6
or ecx, eax
cmp dword [esi + 0x64], 0
je 0x41e557
or ecx, 0x20
mov eax, 0x8421085
mul ecx
sub ecx, edx
shr ecx, 1
lea eax, [edx + ecx]
shr eax, 4
inc eax
mov ecx, eax
shl ecx, 5
sub ecx, eax
mov eax, esi
mov dword [esi + 4], 0x71
call fcn.0041ece0
cmp dword [esi + 0x64], 0
je 0x41e596
movzx ecx, word [edi + 0x32]
call fcn.0041ece0
movzx ecx, word [edi + 0x30]
call fcn.0041ece0
mov dword [edi + 0x30], 1
cmp dword [esi + 0x14], 0
je 0x41e5be
mov eax, edi
call fcn.0041ed10
cmp dword [edi + 0x10], 0
jne 0x41e5be
mov dword [esi + 0x20], 0xffffffff
xor eax, eax
jmp 0x41e6a8
mov eax, dword [esi + 4]
cmp eax, 0x29a
jne 0x41e5e1
cmp dword [edi + 4], 0
je 0x41e5e7
mov edx, dword [str.buffer_error]
mov dword [edi + 0x18], edx
mov eax, 0xfffffffb
jmp 0x41e6a8
cmp dword [edi + 4], 0
jne 0x41e5f4
cmp dword [esi + 0x6c], 0
jne 0x41e5f4
cmp eax, 0x29a
je 0x41e650
mov eax, dword [esi + 0x7c]
lea eax, [eax + eax*2]
mov ecx, dword [eax*4 + 0x481a50]
push 4
push esi
call ecx
add esp, 8
cmp eax, 2
je 0x41e613
cmp eax, 3
jne 0x41e61a
mov dword [esi + 4], 0x29a
test eax, eax
je 0x41e689
cmp eax, 2
je 0x41e689
cmp eax, 1
jne 0x41e650
push 0
push 0
xor ecx, ecx
mov eax, esi
call fcn.00420ec0
add esp, 8
mov eax, edi
call fcn.0041ed10
cmp dword [edi + 0x10], 0
jne 0x41e650
mov dword [esi + 0x20], 0xffffffff
xor eax, eax
jmp 0x41e6a8
cmp dword [esi + 0x18], 0
je 0x41e65d
mov eax, 1
jmp 0x41e6a8
movzx ecx, word [edi + 0x32]
mov eax, esi
call fcn.0041ece0
movzx ecx, word [edi + 0x30]
call fcn.0041ece0
mov eax, edi
call fcn.0041ed10
xor eax, eax
cmp dword [esi + 0x14], eax
mov dword [esi + 0x18], 0xffffffff
sete al
jmp 0x41e6a8
cmp dword [edi + 0x10], 0
jne 0x41e696
mov dword [esi + 0x20], 0xffffffff
xor eax, eax
jmp 0x41e6a8
mov edx, dword [str.stream_error]
mov dword [edi + 0x18], edx
mov eax, 0xfffffffe
cmp dword [ebp - 4], 0
mov dword [edi + 0x38], eax
jne 0x41e6bd
cmp eax, 0xfffffffb
jne 0x41e6bd
mov dword [edi + 0x38], 0
cmp dword [edi + 0x10], 0
jne 0x41e6cd
cmp dword [edi + 0x38], 1
je 0x41e6cd
xor esi, esi
jmp 0x41e6d2
mov esi, 1
mov eax, dword [edi + 0x38]
test eax, eax
je 0x41e4a0
cmp eax, 1
je 0x41e4a0
mov edi, dword [edi + 0x38]
lea eax, [edi - 1]
neg eax
sbb eax, eax
and eax, edi
pop edi
pop esi
mov esp, ebp
pop ebp
ret
or eax, 0xffffffff
mov dword [edi + 0x38], eax
pop edi
pop esi
mov esp, ebp
pop ebp
ret
pop edi
mov eax, 0xfffffffe
pop esi
mov esp, ebp
pop ebp
ret