Function at 0x402440
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x314
push ebx
push ebp
mov ebp, ecx
xor ebx, ebx
push esi
push edi
mov eax, dword [ebp + 4]
mov dword [esp + 0x14], 0
test eax, eax
je 0x402605
push 0x800
call sub.MFC42.DLL_operatornew
mov esi, eax
push 0x234
mov dword [esp + 0x1c], esi
call sub.MFC42.DLL_operatornew
add esp, 8
mov ebx, eax
test esi, esi
je 0x402679
test ebx, ebx
je 0x402679
mov esi, dword [esp + 0x328]
test esi, esi
jne 0x40249e
lea esi, [ebp + 8]
push esi
call fcn.004026c0
add esp, 4
mov dword [esp + 0x10], eax
test eax, eax
jne 0x402681
mov ecx, 0x8d
mov edi, ebx
rep stosd dword es:[edi], eax
push ebx
mov ecx, ebp
call fcn.00402330
test al, al
je 0x40266f
mov al, byte [ebx + 0x230]
test al, al
jne 0x40260f
mov al, byte [esp + 0x32c]
mov edi, dword [sym.imp.MSVCRT.dll__makepath]
test al, al
je 0x40251a
lea eax, [esp + 0x224]
lea ecx, [esp + 0x1c]
push eax
push ecx
push 0
push 0
push ebx
call dword [sym.imp.MSVCRT.dll__splitpath]
lea edx, [esp + 0x238]
lea eax, [esp + 0x30]
push edx
push eax
push 0
push 0
push ebx
call edi
add esp, 0x28
push 0
push ebx
push esi
lea ecx, [esp + 0x12c]
push 0
push ecx
call edi
lea edx, [esp + 0x134]
push edx
call fcn.00402770
add esp, 0x18
mov dword [esp + 0x10], eax
test eax, eax
jne 0x402681
push eax
push 0x80
push 2
push eax
push eax
lea eax, [esp + 0x134]
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
je 0x402659
mov ecx, dword [ebp + 4]
push ecx
call fcn.00403b50
test eax, eax
jne 0x402665
mov edx, dword [esp + 0x14]
mov eax, dword [ebp + 4]
push 0x800
push edx
push eax
call fcn.004034c0
mov esi, eax
test esi, esi
jle 0x4025d4
mov edx, dword [esp + 0x14]
lea ecx, [esp + 0x18]
push 0
push ecx
push esi
push edx
push edi
mov dword [esp + 0x2c], 0
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4025c0
cmp dword [esp + 0x18], esi
jne 0x4025cc
jmp 0x40257f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x10], eax
jmp 0x4025d4
mov dword [esp + 0x10], 0x1d
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp + 4]
push eax
call fcn.004036c0
test esi, esi
jne 0x40266f
mov ecx, dword [ebx + 0x218]
lea edx, [esp + 0x120]
push ecx
push edx
call fcn.004027d0
add esp, 8
jmp 0x402681
mov dword [esp + 0x10], 0x15
jmp 0x402681
push 0
add ebp, 8
push ebx
push ebp
lea eax, [esp + 0x28]
push 0
push eax
call dword [sym.imp.MSVCRT.dll__makepath]
lea edi, [esp + 0x30]
or ecx, 0xffffffff
xor eax, eax
add esp, 0x14
repne scasb al, byte es:[edi]
not ecx
dec ecx
je 0x402646
lea eax, [esp + ecx + 0x1b]
mov cl, byte [esp + ecx + 0x1b]
cmp cl, 0x5c
jne 0x402646
mov byte [eax], 0
lea ecx, [esp + 0x1c]
push ecx
call fcn.004026c0
add esp, 4
mov dword [esp + 0x10], eax
jmp 0x402681
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x10], eax
jmp 0x402681
mov dword [esp + 0x10], 0x54f
jmp 0x402689
mov dword [esp + 0x10], 0x54f
jmp 0x402681
mov dword [esp + 0x10], 8
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test ebx, ebx
je 0x402696
push ebx
call sub.MFC42.DLL_operatordelete
add esp, 4
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebp
test eax, eax
pop ebx
je 0x4026ab
push eax
call sub.MFC42.DLL_operatordelete
add esp, 4
mov eax, dword [esp]
add esp, 0x314
ret 8