Function at 0x406090
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x428520
mov eax, dword fs:[0]
push eax
sub esp, 0xc
push ebx
push esi
push edi
mov eax, dword [0x433018]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov ebx, ecx
xor eax, eax
mov dword [ebp - 0x18], eax
mov dword [ebp - 4], eax
call fcn.004067d0
mov eax, dword [ebx + 0x10]
lea esi, [ebx + 4]
add eax, 8
cmp eax, dword [esi + 0x10]
jb 0x4060dd
call fcn.0040cef0
mov eax, dword [esi + 0xc]
lea ecx, [eax + 8]
mov dword [esi + 0xc], ecx
test eax, eax
je 0x4060f4
mov dword [eax], 0
mov byte [eax + 4], 0
mov eax, dword [ebx]
mov esi, dword [eax]
push 0x7b
call fcn.00407e30
mov edx, dword [ebp + 8]
mov eax, dword [edx + 4]
mov eax, dword [eax]
add esp, 4
mov dword [ebp - 0x14], eax
lea ecx, [ecx]
mov ecx, dword [ebp + 8]
cmp eax, dword [ecx + 4]
je 0x406179
cmp dword [eax + 0x1c], 8
lea edi, [eax + 8]
jb 0x406123
mov edi, dword [edi]
mov esi, edi
cmp word [esi], 0
je 0x406130
add esi, 2
jmp 0x406125
call fcn.004067d0
sub esi, edi
sar esi, 1
push esi
push edi
push ebx
call fcn.004068f0
mov eax, dword [ebp - 0x14]
add eax, 0x24
push eax
push ebx
call fcn.00406b70
mov edx, dword [ebp - 0x14]
add esp, 8
add dword [ebp - 0x18], eax
mov eax, dword [edx]
mov dword [ebp - 0x14], eax
jmp 0x406110
add dword [ebx + 0x10], 0xfffffff8
mov eax, dword [ebx + 0x10]
cmp dword [eax], 0
je 0x406212
mov ecx, dword [ebx]
mov esi, dword [ecx]
mov eax, dword [esi + 0xc]
cmp eax, dword [esi + 8]
jb 0x4061b8
mov ecx, dword [esi + 4]
cmp eax, ecx
je 0x4061b8
mov edx, dword [esi]
mov edi, dword [sym.imp.MSVCR100.dll_fwrite]
push edx
sub eax, ecx
push eax
push 1
push ecx
call edi
mov eax, dword [esi + 4]
add esp, 0x10
mov dword [esi + 0xc], eax
jmp 0x4061be
mov edi, dword [sym.imp.MSVCR100.dll_fwrite]
mov ecx, dword [esi + 0xc]
mov byte [ecx], 0xa
inc dword [esi + 0xc]
mov eax, dword [esi + 0xc]
cmp eax, dword [esi + 8]
jb 0x4061ea
mov ecx, dword [esi + 4]
cmp eax, ecx
je 0x4061ea
mov edx, dword [esi]
push edx
sub eax, ecx
push eax
push 1
push ecx
call edi
mov eax, dword [esi + 4]
add esp, 0x10
mov dword [esi + 0xc], eax
mov ecx, dword [esi + 0xc]
mov byte [ecx], 0
inc dword [esi + 0xc]
mov eax, dword [ebx + 0x10]
sub eax, dword [ebx + 0xc]
movzx edx, word [ebx + 0x20]
mov ecx, dword [ebx]
shr eax, 3
imul eax, dword [ebx + 0x24]
push edx
push ecx
call fcn.00407ea0
add esp, 8
jmp 0x406218
mov edi, dword [sym.imp.MSVCR100.dll_fwrite]
mov edx, dword [ebx]
mov esi, dword [edx]
mov eax, dword [esi + 0xc]
cmp eax, dword [esi + 8]
jb 0x40623f
mov ecx, dword [esi + 4]
cmp eax, ecx
je 0x40623f
mov edx, dword [esi]
push edx
sub eax, ecx
push eax
push 1
push ecx
call edi
mov eax, dword [esi + 4]
add esp, 0x10
mov dword [esi + 0xc], eax
mov ecx, dword [esi + 0xc]
mov byte [ecx], 0x7d
inc dword [esi + 0xc]
mov eax, dword [esi + 0xc]
cmp eax, dword [esi + 8]
jb 0x40626b
mov ecx, dword [esi + 4]
cmp eax, ecx
je 0x40626b
mov edx, dword [esi]
push edx
sub eax, ecx
push eax
push 1
push ecx
call edi
mov eax, dword [esi + 4]
add esp, 0x10
mov dword [esi + 0xc], eax
mov ecx, dword [esi + 0xc]
mov byte [ecx], 0
inc dword [esi + 0xc]
mov edx, dword [ebx + 0x10]
cmp edx, dword [ebx + 0xc]
jne 0x40629e
mov eax, dword [ebx]
mov esi, dword [eax]
mov eax, dword [esi + 0xc]
mov ecx, dword [esi + 4]
cmp eax, ecx
je 0x40629e
mov edx, dword [esi]
push edx
sub eax, ecx
push eax
push 1
push ecx
call edi
mov eax, dword [esi + 4]
add esp, 0x10
mov dword [esi + 0xc], eax
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret