Function at 0x40e520
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
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 0x40e540
call fcn.0040cac0
mov eax, dword [esi + 0xc]
lea ecx, [eax + 8]
mov dword [esi + 0xc], ecx
test eax, eax
je 0x40e557
mov dword [eax], 0
mov byte [eax + 4], 1
mov edx, dword [ebx]
mov esi, dword [edx]
push 0x5b
call fcn.004079f0
mov eax, dword [ebp + 8]
mov eax, dword [eax + 4]
mov esi, dword [eax]
add esp, 4
cmp esi, eax
je 0x40e5cf
mov edi, dword [esi + 0xc]
call fcn.00406390
push edi
mov ecx, ebx
call fcn.004127d0
cmp byte [esi + 0x11], 0
jne 0x40e5c7
mov eax, dword [esi + 8]
cmp byte [eax + 0x11], 0
jne 0x40e5ac
mov esi, eax
mov eax, dword [esi]
cmp byte [eax + 0x11], 0
jne 0x40e5c7
lea ebx, [ebx]
mov esi, eax
mov eax, dword [esi]
cmp byte [eax + 0x11], 0
je 0x40e5a0
jmp 0x40e5c7
mov eax, dword [esi + 4]
cmp byte [eax + 0x11], 0
jne 0x40e5c5
cmp esi, dword [eax + 8]
jne 0x40e5c5
mov esi, eax
mov eax, dword [eax + 4]
cmp byte [eax + 0x11], 0
je 0x40e5b5
mov esi, eax
mov ecx, dword [ebp + 8]
cmp esi, dword [ecx + 4]
jne 0x40e571
add dword [ebx + 0x10], 0xfffffff8
mov eax, dword [ebx + 0x10]
cmp dword [eax], 0
mov edi, dword [sym.imp.MSVCR100.dll_fwrite]
je 0x40e65a
mov edx, dword [ebx]
mov esi, dword [edx]
mov eax, dword [esi + 0xc]
cmp eax, dword [esi + 8]
jb 0x40e608
mov ecx, dword [esi + 4]
cmp eax, ecx
je 0x40e608
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 0x40e634
mov ecx, dword [esi + 4]
cmp eax, ecx
je 0x40e634
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 0x40e681
mov ecx, dword [esi + 4]
cmp eax, ecx
je 0x40e681
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 0x40e6ad
mov ecx, dword [esi + 4]
cmp eax, ecx
je 0x40e6ad
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 0x40e6e0
mov eax, dword [ebx]
mov esi, dword [eax]
mov eax, dword [esi + 0xc]
mov ecx, dword [esi + 4]
cmp eax, ecx
je 0x40e6e0
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
pop ebp
ret