Function at 0x40a510
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x3c
push ebx
mov ebx, ecx
push ebp
push esi
mov eax, dword [ebx + 0xc]
mov ecx, dword [ebx + 0x10]
mov dword [esp + 0x14], eax
push edi
lea ebp, [eax + eax*2]
mov dword [esp + 0x14], ecx
mov eax, ebp
shr eax, 2
lea edx, [eax*4]
cmp edx, ebp
je 0x40a541
lea ebp, [eax*4 + 4]
mov eax, ebp
xor edi, edi
imul eax, ecx
push 0x418304
mov byte [esp + 0x16], 0x42
lea ecx, [eax + eax*2 + 0x36]
lea edx, [eax + eax*2]
mov eax, dword [esp + 0x54]
mov byte [esp + 0x17], 0x4d
push eax
mov dword [esp + 0x34], edi
mov dword [esp + 0x24], ecx
mov dword [esp + 0x38], 0x28
mov dword [esp + 0x28], 0x36
mov dword [esp + 0x3c], 1
mov dword [esp + 0x2c], 0x18
mov dword [esp + 0x40], edi
mov dword [esp + 0x30], edx
mov dword [esp + 0x44], 0x127a
mov dword [esp + 0x48], edi
call dword [sym.imp.MSVCRT.dll_fopen]
mov esi, eax
add esp, 8
cmp esi, edi
jne 0x40a5bd
pop edi
pop esi
pop ebp
mov eax, 2
pop ebx
add esp, 0x3c
ret 4
mov edi, dword [sym.imp.MSVCRT.dll_fwrite]
push esi
push 2
lea ecx, [esp + 0x1a]
push 1
push ecx
call edi
mov eax, ebp
push esi
imul eax, dword [esp + 0x28]
add eax, 0x12
push 4
push 1
lea edx, [eax + eax*2]
lea eax, [esp + 0x38]
push eax
mov dword [esp + 0x3c], edx
call edi
push esi
push 4
lea ecx, [esp + 0x54]
push 1
push ecx
call edi
push esi
push 4
lea edx, [esp + 0x58]
push 1
push edx
mov dword [esp + 0x60], 0x36
call edi
add esp, 0x40
lea eax, [esp + 0x30]
push esi
push 4
push 1
push eax
call edi
push esi
push 4
lea ecx, [esp + 0x30]
push 1
push ecx
call edi
push esi
push 4
lea edx, [esp + 0x3c]
push 1
push edx
call edi
push esi
push 2
lea eax, [esp + 0x6c]
push 1
push eax
call edi
add esp, 0x40
lea ecx, [esp + 0x24]
mov dword [esp + 0x24], 0x18
push esi
push 2
push 1
push ecx
call edi
push esi
push 4
lea edx, [esp + 0x50]
push 1
push edx
call edi
mov eax, ebp
push esi
imul eax, dword [esp + 0x38]
push 4
lea ecx, [esp + 0x50]
lea eax, [eax + eax*2]
push 1
push ecx
mov dword [esp + 0x58], eax
call edi
push esi
push 8
lea edx, [esp + 0x74]
push 1
push edx
call edi
add esp, 0x40
lea eax, [esp + 0x40]
push esi
push 8
push 1
push eax
call edi
push 0
push 0x36
push esi
call dword [sym.imp.MSVCRT.dll_fseek]
mov ecx, dword [ebx + 8]
push ebp
mov dword [esp + 0x64], ecx
call sub.MFC42.DLL_operatornew
mov ebx, eax
mov eax, dword [esp + 0x34]
add esp, 0x20
mov dword [esp + 0x48], ebx
test eax, eax
mov dword [esp + 0x50], 0
jbe 0x40a729
mov eax, dword [esp + 0x50]
mov ecx, dword [esp + 0x18]
imul eax, ecx
shl eax, 2
xor edx, edx
test ecx, ecx
jbe 0x40a70a
lea ecx, [ebx + 2]
mov ebx, dword [esp + 0x44]
lea eax, [eax + ebx + 2]
mov bl, byte [eax - 2]
inc edx
mov byte [ecx - 2], bl
mov bl, byte [eax - 1]
mov byte [ecx - 1], bl
mov bl, byte [eax]
mov byte [ecx], bl
mov ebx, dword [esp + 0x18]
add eax, 4
add ecx, 3
cmp edx, ebx
jb 0x40a6e7
mov ebx, dword [esp + 0x48]
push esi
push ebp
push 1
push ebx
call edi
add esp, 0x10
cmp eax, ebp
jne 0x40a739
mov eax, dword [esp + 0x50]
mov ecx, dword [esp + 0x14]
inc eax
cmp eax, ecx
mov dword [esp + 0x50], eax
jb 0x40a6c8
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
push ebx
call sub.MFC42.DLL_operatordelete
add esp, 8
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x3c
ret 4