Function at 0x40e8c0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
push ebx
push esi
push edi
mov ebx, eax
call fcn.00406390
mov eax, dword [ebx + 0x10]
lea esi, [ebx + 4]
add eax, 8
cmp eax, dword [esi + 0x10]
jb 0x40e8e3
call fcn.0040cac0
mov eax, dword [esi + 0xc]
lea ecx, [eax + 8]
mov dword [esi + 0xc], ecx
test eax, eax
je 0x40e8fa
mov dword [eax], 0
mov byte [eax + 4], 1
mov edx, dword [ebx]
mov esi, dword [edx]
push 0x5b
call fcn.004079f0
mov esi, dword [ebp + 8]
add esp, 4
lea eax, [ebp - 0xc]
mov ecx, esi
call fcn.00413b00
lea eax, [ebp - 0x18]
mov edx, esi
call fcn.00416b90
mov esi, dword [ebp - 4]
cmp esi, dword [eax + 8]
je 0x40e96d
mov eax, dword [ebp - 0xc]
test eax, eax
jne 0x40e932
xor edx, edx
jmp 0x40e934
mov edx, dword [eax]
mov edi, dword [edx + 8]
mov eax, esi
mov ecx, esi
shr eax, 2
and ecx, 3
cmp edi, eax
ja 0x40e947
sub eax, edi
mov edx, dword [edx + 4]
mov eax, dword [edx + eax*4]
mov edi, dword [eax + ecx*4]
call fcn.00406390
push edi
push ebx
call fcn.004128a0
mov edx, dword [ebp + 8]
lea eax, [ebp - 0x18]
inc esi
call fcn.00416b90
cmp esi, dword [eax + 8]
jne 0x40e927
add dword [ebx + 0x10], 0xfffffff8
mov eax, dword [ebx + 0x10]
cmp dword [eax], 0
mov edi, dword [sym.imp.MSVCR100.dll_fwrite]
je 0x40e9f8
mov ecx, dword [ebx]
mov esi, dword [ecx]
mov eax, dword [esi + 0xc]
cmp eax, dword [esi + 8]
jb 0x40e9a6
mov ecx, dword [esi + 4]
cmp eax, ecx
je 0x40e9a6
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], 0xa
inc dword [esi + 0xc]
mov eax, dword [esi + 0xc]
cmp eax, dword [esi + 8]
jb 0x40e9d2
mov ecx, dword [esi + 4]
cmp eax, ecx
je 0x40e9d2
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.00407a60
add esp, 8
mov edx, dword [ebx]
mov esi, dword [edx]
mov eax, dword [esi + 0xc]
cmp eax, dword [esi + 8]
jb 0x40ea1f
mov ecx, dword [esi + 4]
cmp eax, ecx
je 0x40ea1f
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], 0x5d
inc dword [esi + 0xc]
mov eax, dword [esi + 0xc]
cmp eax, dword [esi + 8]
jb 0x40ea4b
mov ecx, dword [esi + 4]
cmp eax, ecx
je 0x40ea4b
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 0x40ea7e
mov eax, dword [ebx]
mov esi, dword [eax]
mov eax, dword [esi + 0xc]
mov ecx, dword [esi + 4]
cmp eax, ecx
je 0x40ea7e
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
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret