Function at 0x415f06
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x46ebd6
mov eax, dword fs:[0]
push eax
sub esp, 0x58
mov eax, dword [0x489c20]
xor eax, esp
mov dword [esp + 0x50], eax
push ebx
push esi
push edi
mov eax, dword [0x489c20]
xor eax, esp
push eax
lea eax, [esp + 0x68]
mov dword fs:[0], eax
mov edi, dword [ebp + 8]
mov eax, 0xffff
mov esi, ecx
cmp ax, di
jne 0x415f53
xor eax, eax
jmp 0x4160fb
mov eax, dword [esi + 0x24]
mov ecx, dword [eax]
xor ebx, ebx
cmp ecx, ebx
je 0x415f81
mov eax, dword [esi + 0x34]
mov edx, dword [eax]
lea edx, [ecx + edx*2]
cmp ecx, edx
jae 0x415f81
dec dword [eax]
mov esi, dword [esi + 0x24]
mov eax, dword [esi]
lea ecx, [eax + 2]
mov dword [esi], ecx
mov word [eax], di
mov ax, di
jmp 0x4160fb
mov eax, dword [esi + 0x4c]
cmp eax, ebx
je 0x4160f6
cmp dword [esi + 0x3c], ebx
jne 0x415fb4
push eax
push edi
call fcn.004569ed
pop ecx
pop ecx
mov ecx, 0xffff
mov edx, ecx
cmp ax, dx
movzx eax, di
jne 0x4160fb
mov eax, ecx
jmp 0x4160fb
movzx eax, di
push ebx
push 8
lea ecx, [esp + 0x4c]
mov dword [esp + 0x18], eax
call fcn.004161a2
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x48]
mov dword [esp + 0x74], ebx
call fcn.004162e2
mov ecx, eax
call fcn.0041625c
mov edi, dword [esp + 0x58]
mov ebx, eax
lea eax, [esp + 0x2c]
push eax
lea ecx, [esp + 0x48]
call fcn.004162e2
mov ecx, eax
call fcn.0041625c
lea edx, [esp + 0x18]
add edi, ebx
push edx
lea ebx, [esi + 0x44]
jmp 0x4160c3
cmp eax, 1
jg 0x41611b
lea eax, [esp + 0x34]
push eax
lea ecx, [esp + 0x48]
call fcn.004162e2
mov ecx, eax
call fcn.0041625c
mov edi, dword [esp + 0x18]
sub edi, eax
je 0x41605c
lea eax, [esp + 0x3c]
push eax
lea ecx, [esp + 0x48]
call fcn.004162e2
mov ecx, eax
call fcn.0041625c
push dword [esi + 0x4c]
push edi
push 1
push eax
call fcn.0045622e
add esp, 0x10
cmp edi, eax
jne 0x4160e9
lea eax, [esp + 0x10]
mov byte [esi + 0x42], 1
cmp dword [esp + 0x1c], eax
jne 0x416152
test edi, edi
ja 0x416086
cmp dword [esp + 0x58], 0x20
push 0
lea ecx, [esp + 0x48]
jae 0x4160ef
push 8
call fcn.0041634c
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x48]
call fcn.004162e2
mov ecx, eax
call fcn.0041625c
mov edi, dword [esp + 0x58]
mov dword [esp + 0x20], eax
lea eax, [esp + 0x2c]
push eax
lea ecx, [esp + 0x48]
call fcn.004162e2
mov ecx, eax
call fcn.0041625c
lea edx, [esp + 0x18]
push edx
mov edx, dword [esp + 0x24]
add edi, edx
mov ecx, dword [esi + 0x3c]
push edi
push eax
lea edx, [esp + 0x28]
push edx
lea edx, [esp + 0x22]
push edx
lea edx, [esp + 0x24]
push edx
mov dword [esp + 0x2c], eax
mov eax, dword [ecx]
push ebx
call dword [eax + 0x14]
test eax, eax
jge 0x41600a
push 0
lea ecx, [esp + 0x48]
push 1
call fcn.004032a5
mov eax, 0xffff
mov ecx, dword [esp + 0x68]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x50]
xor ecx, esp
call fcn.0044eff8
mov esp, ebp
pop ebp
ret 4
cmp eax, 3
jne 0x4160e9
push dword [esi + 0x4c]
push dword [esp + 0x14]
call fcn.004569ed
movzx esi, word [ebp + 8]
pop ecx
pop ecx
mov ecx, 0xffff
mov edx, ecx
cmp ax, dx
jne 0x416140
mov esi, ecx
push 0
push 1
lea ecx, [esp + 0x4c]
call fcn.004032a5
mov ax, si
jmp 0x4160fb
push 0
push 1
lea ecx, [esp + 0x4c]
call fcn.004032a5
mov ax, word [ebp + 8]
jmp 0x4160fb