Function at 0x404090
Capabilities:
Write file on windows

Disassembly:
sub esp, 8
push ebx
mov ebx, dword [esp + 0x10]
push ebp
push esi
mov eax, dword [ebx]
push edi
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov ecx, dword [0x406668]
mov ebp, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 1
push 0
mov esi, eax
push 0
push ecx
inc esi
call ebp
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [esp + 0x14], eax
add eax, 0x15
push 0
mov dword [esp + 0x14], eax
mov eax, dword [0x406668]
push 0x4066b4
lea edx, [esp + 0x18]
push 4
push edx
push eax
call edi
mov eax, dword [ebx + 4]
test eax, eax
je 0x4040f8
mov ecx, dword [esp + 0x14]
lea edx, [ecx + esi + 0x15]
mov dword [esp + 0x10], edx
jmp 0x404100
mov dword [esp + 0x10], 0
mov ecx, dword [0x406668]
push 0
push 0x4066b4
lea eax, [esp + 0x18]
push 4
push eax
push ecx
call edi
mov edx, dword [0x406668]
push 0
lea eax, [ebx + 8]
push 0x4066b4
push 8
push eax
push edx
call edi
mov ecx, dword [0x406668]
push 0
push 0x4066b4
lea eax, [esp + 0x28]
push 4
push eax
push ecx
call edi
mov eax, dword [0x406668]
push 0
push 0x4066b4
lea edx, [esp + 0x18]
push 1
push edx
push eax
mov dword [esp + 0x24], 0
call edi
mov ecx, dword [ebx]
mov edx, dword [0x406668]
push 0
push 0x4066b4
push esi
push ecx
push edx
call edi
mov esi, dword [ebx + 4]
test esi, esi
je 0x4042bb
jmp 0x404189
mov ebp, dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [esi + 8]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov ecx, dword [0x406668]
push 1
push 0
mov ebx, eax
push 0
push ecx
inc ebx
call ebp
mov edx, dword [0x406668]
push 0
push 0x4066b4
push 8
push esi
push edx
mov ebp, eax
call edi
mov edx, dword [0x406668]
push 0
push 0x4066b4
lea ecx, [esp + 0x18]
push 4
lea eax, [ebp + 0x19]
push ecx
push edx
mov dword [esp + 0x24], eax
call edi
mov eax, dword [esi + 4]
test eax, eax
jbe 0x4041e9
lea eax, [ebx + ebp + 0x19]
mov dword [esp + 0x10], eax
jmp 0x4041f1
mov dword [esp + 0x10], 0
mov edx, dword [0x406668]
push 0
push 0x4066b4
lea ecx, [esp + 0x18]
push 4
push ecx
push edx
call edi
mov eax, dword [esi + 0x10]
test eax, eax
je 0x40421e
mov eax, dword [esi + 4]
add eax, ebp
lea ecx, [eax + ebx + 0x19]
mov dword [esp + 0x10], ecx
jmp 0x404226
mov dword [esp + 0x10], 0
mov eax, dword [0x406668]
push 0
push 0x4066b4
lea edx, [esp + 0x18]
push 4
push edx
push eax
call edi
mov eax, dword [0x406668]
mov ecx, dword [esp + 0x14]
push 0
push 0x4066b4
lea edx, [esp + 0x18]
push 4
push edx
push eax
mov dword [esp + 0x24], ecx
call edi
mov edx, dword [0x406668]
push 0
push 0x4066b4
lea ecx, [esp + 0x18]
push 1
push ecx
push edx
mov dword [esp + 0x24], 0
call edi
mov eax, dword [esi + 8]
mov ecx, dword [0x406668]
push 0
push 0x4066b4
push ebx
push eax
push ecx
call edi
mov edx, dword [esi + 4]
mov eax, dword [esi + 0xc]
mov ecx, dword [0x406668]
push 0
push 0x4066b4
push edx
push eax
push ecx
call edi
mov esi, dword [esi + 0x10]
test esi, esi
jne 0x404183
mov ebx, dword [esp + 0x1c]
mov ebp, dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [ebx + 8]
test eax, eax
je 0x4042d4
mov ecx, dword [esp + 0x14]
lea edx, [ecx + 8]
push edx
push ecx
push eax
call fcn.00404090
add esp, 0xc
mov ebx, dword [ebx + 0xc]
test ebx, ebx
je 0x4042f1
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x20]
add eax, 0xc
push eax
push ecx
push ebx
call fcn.00404090
add esp, 0xc
mov ebx, dword [esp + 0x24]
test ebx, ebx
jbe 0x40433b
mov edx, dword [0x406668]
push 1
push 0
push 0
push edx
call ebp
mov esi, eax
mov eax, dword [0x406668]
push 0
push 0
push ebx
push eax
call ebp
mov edx, dword [0x406668]
push 0
push 0x4066b4
lea ecx, [esp + 0x1c]
push 4
push ecx
push edx
call edi
mov eax, dword [0x406668]
push 0
push 0
push esi
push eax
call ebp
mov ecx, dword [0x4068b8]
pop edi
inc ecx
pop esi
mov dword [0x4068b8], ecx
mov ecx, dword [0x406630]
pop ebp
pop ebx
test ecx, ecx
je 0x4043b0
mov eax, dword [0x4068b8]
xor edx, edx
div ecx
cmp edx, dword [0x4066ac]
jbe 0x4043b0
mov ecx, dword [0x406848]
push 0
push 0
push 0x405
push 0x400
push ecx
mov dword [0x4068b8], 0
call dword [sym.imp.USER32.dll_SendDlgItemMessageA]
mov edx, dword [0x406848]
push edx
call dword [sym.imp.USER32.dll_UpdateWindow]
mov eax, dword [0x406848]
push 1
push 6
push 6
push eax
push 0x4066e0
call dword [sym.imp.USER32.dll_PeekMessageA]
add esp, 8
ret