Function at 0x407230
Capabilities:
Write file on windows

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x4c
mov esi, dword [esp + 0x60]
mov eax, dword [esp + 0x68]
mov edx, dword [esp + 0x6c]
mov edi, dword [esp + 0x70]
cmp dword [esi + 0x3c], 1
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], edx
je 0x4073c6
mov eax, dword [esi]
xor ebp, ebp
mov dword [esp + 0x2c], 0
mov ecx, dword [esp + 0x2c]
mov eax, dword [eax + 0x14]
mov dword [esp + 0xc], ecx
mov dword [esp + 0x28], eax
mov edx, dword [esp + 0x28]
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x18]
mov dword [esp + 8], edx
mov edx, dword [esp + 0x1c]
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.0040ff60
mov ecx, eax
mov ebx, edx
or edx, ecx
je 0x4072f2
mov eax, dword [esp + 0x28]
mov edx, dword [esp + 0x2c]
sub eax, ecx
sbb edx, ebx
cmp ebp, edx
jl 0x4073bd
jle 0x4073b5
mov eax, dword [esp + 0x20]
sub eax, ecx
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x18]
xor eax, dword [esi + 0x4c]
xor edx, dword [esi + 0x48]
or eax, edx
je 0x4075d0
mov eax, dword [esp + 0x3c]
xor edx, edx
add dword [esp + 0x18], eax
adc dword [esp + 0x1c], edx
xor ebp, ebp
sub edi, dword [esp + 0x3c]
mov ecx, dword [esp + 0x3c]
add dword [esp + 0x64], ecx
cmp dword [esp + 0x20], edi
jbe 0x407337
test edi, edi
jne 0x407314
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
mov dword [esi + 0x48], eax
mov dword [esi + 0x4c], edx
add esp, 0x4c
mov eax, ebp
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [esi + 0x40]
mov ecx, dword [esp + 0x64]
mov dword [esp + 8], edi
mov dword [esp], eax
mov dword [esp + 4], ecx
call sub.msvcrt.dll_memcpy
xor edx, edx
add dword [esp + 0x18], edi
adc dword [esp + 0x1c], edx
jmp 0x4072fc
mov eax, edi
xor edx, edx
mov ebx, dword [esi]
div dword [esp + 0x20]
mov edx, dword [ebx + 0x14]
mov dword [esp + 0xc], 0
mov dword [esp + 8], edx
mov edx, dword [esp + 0x1c]
mov dword [esp + 4], edx
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x18]
mov dword [esp], eax
call fcn.0040fe10
mov ecx, dword [esp + 0x28]
lea edx, [ecx + eax - 1]
mov ecx, dword [esp + 0x64]
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov dword [esp + 4], ecx
mov eax, dword [ebx]
mov dword [esp], eax
call fcn.0040a570
test eax, eax
mov eax, 1
cmovne ebp, eax
mov eax, dword [esp + 0x28]
imul eax, dword [esp + 0x20]
add dword [esp + 0x64], eax
mov edx, eax
sub edi, eax
sar edx, 0x1f
add dword [esp + 0x18], eax
adc dword [esp + 0x1c], edx
jmp 0x4072f8
cmp edi, eax
ja 0x4072b6
mov dword [esp + 0x3c], edi
jmp 0x4072c0
mov edx, dword [esi]
xor ebp, ebp
test edi, edi
mov ecx, dword [edx + 0x14]
mov dword [esp + 0x28], ecx
je 0x40730a
mov eax, dword [esi + 0xc]
mov ecx, dword [esp + 0x64]
mov dword [esi + 8], edi
test eax, eax
mov dword [esi + 4], ecx
je 0x4073fa
mov ecx, dword [esp + 0x1c]
xor eax, dword [esp + 0x18]
or ecx, eax
je 0x4076e6
lea eax, [esi + 0x48]
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x18]
mov dword [esp], edx
mov dword [esp + 8], eax
lea eax, [esi + 4]
mov dword [esp + 4], eax
call fcn.004070a0
mov eax, dword [esi + 0x48]
mov edx, dword [esi + 0x4c]
mov ecx, dword [esp + 0x28]
mov dword [esp + 0xc], 0
mov dword [esp], eax
mov dword [esp + 4], edx
mov dword [esp + 8], ecx
call fcn.0040ff60
mov ecx, dword [esp + 0x28]
mov edi, dword [esi + 8]
sub ecx, eax
mov eax, dword [esi + 0x40]
mov dword [esi + 0x14], ecx
mov dword [esi + 0x10], eax
lea ecx, [esi + 4]
xor ebx, ebx
mov dword [esp + 0x18], ecx
mov ecx, dword [esp + 0x28]
xor ebp, ebp
mov dword [esp + 0x34], 0
mov dword [esp + 0x30], ecx
test ebx, ebx
jne 0x40730a
test edi, edi
je 0x40730a
mov ecx, dword [esp + 0x18]
mov dword [esp + 4], 2
mov dword [esp], ecx
call fcn.0040b880
test eax, eax
jne 0x4074b0
xor eax, eax
xor ebx, ebx
test al, al
mov edi, dword [esi + 0x14]
jne 0x4074f7
test edi, edi
je 0x4074f7
xor ebx, ebx
mov edi, dword [esi + 8]
test ebx, ebx
je 0x40746f
jmp 0x40730a
cmp eax, 1
je 0x4075a4
cmp eax, 0xfffffffb
lea esi, [esi]
je 0x40748f
mov dword [esp + 0xc], eax
mov eax, dword [esi + 0x1c]
mov ebx, 1
mov dword [esp + 4], str.zlib_error:__s___d__n
mov ebp, 0xffffffff
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov edi, dword [esi + 8]
jmp 0x407467
mov edx, dword [esi + 0x4c]
mov eax, dword [esi + 0x48]
mov ecx, dword [esp + 0x34]
mov dword [esp + 0x24], edx
mov edx, dword [esp + 0x30]
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x20]
mov dword [esp + 0xc], ecx
mov dword [esp + 8], edx
mov edx, dword [esp + 0x24]
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.0040ff60
or edx, eax
jne 0x4075b3
test edi, edi
jne 0x407690
mov edi, dword [esi]
mov eax, dword [esp + 0x20]
mov edx, dword [esp + 0x24]
mov ecx, dword [edi + 0x14]
mov dword [esp + 0xc], 0
mov dword [esp], eax
mov dword [esp + 4], edx
mov dword [esp + 8], ecx
call fcn.0040fe10
mov dword [esp + 0xc], eax
mov dword [esp + 8], eax
mov eax, dword [esi + 0x40]
mov dword [esp + 4], eax
mov eax, dword [edi]
mov dword [esp], eax
call fcn.0040a570
mov edx, dword [esi + 0x14]
mov ecx, dword [esp + 0x34]
or eax, ebp
test edx, edx
mov edx, dword [esp + 0x30]
cmove ebp, eax
add dword [esi + 0x48], edx
adc dword [esi + 0x4c], ecx
mov ecx, dword [esi + 0x40]
mov eax, dword [esp + 0x28]
mov dword [esi + 0x10], ecx
mov edi, dword [esi + 8]
mov dword [esi + 0x14], eax
jmp 0x407467
mov eax, 1
mov ebx, 1
jmp 0x407493
mov ecx, dword [esi + 0x40]
mov eax, dword [esi + 0x10]
sub eax, ecx
mov edx, eax
sar edx, 0x1f
add eax, dword [esp + 0x20]
adc edx, dword [esp + 0x24]
mov dword [esi + 0x48], eax
mov dword [esi + 0x4c], edx
jmp 0x407592
test edi, edi
je 0x4076c0
mov edx, dword [esp + 0x3c]
mov eax, dword [esp + 0x64]
add ecx, dword [esi + 0x40]
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov dword [esp], ecx
call sub.msvcrt.dll_memcpy
sub edi, dword [esp + 0x3c]
mov eax, dword [esp + 0x28]
xor ebx, ebx
mov edx, dword [esp + 0x2c]
mov ecx, dword [esp + 0x3c]
add dword [esp + 0x18], ecx
adc dword [esp + 0x1c], ebx
xor ebp, ebp
mov dword [esp + 8], eax
mov eax, dword [esp + 0x18]
mov dword [esp + 0xc], edx
mov edx, dword [esp + 0x1c]
mov dword [esp + 0x14], ecx
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.0040ff60
mov ecx, dword [esp + 0x14]
or edx, eax
jne 0x4072ea
mov ebp, dword [esi]
add ecx, dword [esi + 0x48]
adc ebx, dword [esi + 0x4c]
sub ecx, dword [esp + 0x28]
mov edx, dword [ebp + 0x14]
sbb ebx, dword [esp + 0x2c]
mov dword [esp], ecx
mov dword [esp + 0xc], 0
mov dword [esp + 8], edx
mov dword [esp + 4], ebx
call fcn.0040fe10
mov dword [esp + 0xc], eax
mov dword [esp + 8], eax
mov eax, dword [esi + 0x40]
mov dword [esp + 4], eax
mov eax, dword [ebp]
mov dword [esp], eax
call fcn.0040a570
xor ecx, ecx
test eax, eax
setne cl
mov ebp, ecx
jmp 0x4072ea
mov eax, dword [esi + 0x10]
mov dword [esp + 8], edi
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.msvcrt.dll_memset
mov edx, dword [esi + 0x48]
mov ecx, dword [esi + 0x4c]
mov dword [esp + 0x20], edx
mov dword [esp + 0x24], ecx
jmp 0x407539
mov edx, dword [esp + 0x20]
sub edx, ecx
add ecx, dword [esi + 0x40]
mov dword [esp + 0x3c], edx
mov dword [esp + 8], edx
mov dword [esp + 4], 0
mov dword [esp], ecx
call sub.msvcrt.dll_memset
jmp 0x4075f7
mov eax, dword [esi + 0x48]
and eax, dword [esi + 0x4c]
cmp eax, 0xffffffff
jne 0x40744c
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov ebp, 1
mov dword [esp + 8], 0x3b
mov dword [esp + 4], 1
mov dword [esp], str.data_didnt_align_with_block_boundary_in_compressed_stream_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
jmp 0x40730a