Function at 0x406db0
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x18
push ebx
push ebp
push esi
push edi
mov ebx, ecx
call fcn.00406b50
test al, al
je 0x40707a
mov ebp, dword [esp + 0x2c]
test ebp, ebp
je 0x40707a
mov edi, dword [esp + 0x30]
test edi, edi
je 0x40707a
mov esi, dword [esp + 0x34]
test esi, esi
je 0x40707a
lea eax, [esp + 0x24]
lea ecx, [esp + 0x1c]
push eax
push ecx
push ebp
mov ecx, ebx
call fcn.00407090
test al, al
jne 0x406e2a
push ebp
mov ecx, ebx
call fcn.00406d50
test al, al
je 0x40707a
lea edx, [esp + 0x24]
lea eax, [esp + 0x1c]
push edx
push eax
push ebp
mov ecx, ebx
call fcn.00407090
test al, al
je 0x40707a
mov eax, dword [esp + 0x24]
lea ecx, [esp + 0x14]
lea edx, [esp + 0x10]
push ecx
mov ecx, dword [esp + 0x20]
push edx
push eax
push ecx
push edi
mov ecx, ebx
call fcn.004071d0
test al, al
jne 0x406e56
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], eax
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edi, esi
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea ebp, [edx + ecx + 5]
lea esi, [ebp + 1]
push esi
call sub.MFC42u.DLL_operatornew
mov edx, dword [esp + 0x18]
mov ecx, dword [esp + 0x14]
mov edi, eax
mov eax, dword [ebx + 8]
sub eax, edx
mov dword [esp + 0x24], edi
add eax, ebp
lea edx, [eax + ecx + 1]
push edx
call sub.MFC42u.DLL_operatornew
mov edx, dword [esp + 0x1c]
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x34], eax
mov eax, dword [ebx + 8]
sub eax, edx
add eax, ebp
lea edx, [eax + ecx + 1]
push edx
call sub.MFC42u.DLL_operatornew
add esp, 0xc
mov dword [esp + 0x18], eax
test edi, edi
je 0x407058
mov ecx, dword [esp + 0x2c]
test ecx, ecx
je 0x40704b
test eax, eax
je 0x40704b
mov ecx, esi
xor eax, eax
mov edx, ecx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov edi, dword [esp + 0x2c]
mov ecx, esi
xor eax, eax
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov edi, dword [esp + 0x18]
mov ecx, esi
xor eax, eax
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
mov edx, dword [esp + 0x20]
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esp + 0x34]
mov ecx, dword [esp + 0x30]
push eax
push ecx
push str._s___s_r_n
push edx
call dword [sym.imp.MSVCRT.dll_sprintf]
mov esi, dword [ebx]
mov ecx, dword [esp + 0x20]
mov eax, dword [esp + 0x3c]
sub ecx, esi
mov edx, ecx
mov edi, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edx, dword [ebx]
mov esi, dword [esp + 0x30]
mov edi, eax
mov ecx, ebp
sub edi, edx
mov edx, dword [esp + 0x20]
add edi, edx
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebx + 8]
mov esi, dword [esp + 0x24]
mov edx, dword [ebx]
sub ecx, esi
mov edi, eax
mov eax, dword [esp + 0x30]
sub edi, edx
lea ecx, [ecx + edx + 1]
mov edx, dword [esp + 0x20]
add edi, ebp
add edi, edx
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
push eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call sub.MFC42u.DLL_operatordelete
mov ecx, dword [ebx]
push ecx
call sub.MFC42u.DLL_operatordelete
mov edx, dword [ebx + 4]
push edx
call sub.MFC42u.DLL_operatordelete
mov eax, dword [esp + 0x30]
mov edi, dword [esp + 0x2c]
mov esi, dword [ebx + 8]
sub ebp, eax
add ebp, edi
mov edi, dword [esp + 0x34]
add esi, ebp
mov dword [ebx + 4], edi
mov eax, esi
mov dword [ebx + 8], esi
mov esi, dword [esp + 0x48]
lea ecx, [eax + 1]
mov dword [ebx], esi
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebx + 8]
mov edx, dword [ebx + 4]
inc ecx
push ecx
push edx
call fcn.00407570
lea eax, [ebx + 0xd]
push 0x48c744
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
mov esi, eax
add esp, 0x2c
test esi, esi
je 0x40707a
mov ecx, dword [ebx + 8]
mov edx, dword [ebx]
push esi
push ecx
push 1
push edx
call dword [sym.imp.MSVCRT.dll_fwrite]
mov ecx, dword [ebx + 8]
add esp, 0x10
cmp eax, ecx
push esi
je 0x407036
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret 0xc
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret 0xc
push edi
call sub.MFC42u.DLL_operatordelete
mov eax, dword [esp + 0x1c]
add esp, 4
mov ecx, dword [esp + 0x2c]
test ecx, ecx
je 0x40706d
push ecx
call sub.MFC42u.DLL_operatordelete
mov eax, dword [esp + 0x1c]
add esp, 4
test eax, eax
je 0x40707a
push eax
call sub.MFC42u.DLL_operatordelete
add esp, 4
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x18
ret 0xc