Function at 0x404820
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x50
xor eax, eax
push ebx
mov dword [esp + 0x28], eax
push ebp
mov dword [esp + 0x30], eax
mov ebp, ecx
mov dword [esp + 0x34], eax
push esi
push edi
xor ebx, ebx
mov dword [esp + 0x40], eax
lea ecx, [ebp + 0x94]
push 1
mov dword [esp + 0x18], ebx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x20], ebx
mov dword [esp + 0x28], ebx
mov dword [esp + 0x24], ebx
mov dword [esp + 0x14], 0xffffffff
mov dword [esp + 0x34], ebx
mov dword [esp + 0x48], eax
mov dword [esp + 0x30], ecx
call fcn.004080f0
mov edi, dword [esp + 0x64]
lea ecx, [esp + 0x30]
push ecx
mov ecx, edi
mov esi, dword [edi]
call dword [esi + 0x10]
push eax
mov ecx, ebp
call fcn.00405b10
cmp al, bl
jne 0x4049fe
push 1
mov ecx, ebp
call fcn.004033a0
cmp eax, 0xffffffff
mov dword [esp + 0x10], eax
jne 0x4048af
or ebx, eax
jmp 0x404a1a
lea edx, [esp + 0x18]
mov ecx, edi
push edx
call dword [esi + 4]
mov esi, eax
cmp esi, ebx
mov dword [esp + 0x24], esi
je 0x404a1a
mov eax, dword [esp + 0x10]
push 2
push ebx
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
mov dword [esp + 0x64], eax
je 0x404a1a
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x10]
lea ecx, [esp + 0x14]
push ebx
push ecx
push edx
push esi
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
push eax
call esi
test eax, eax
je 0x404a1a
mov ecx, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
cmp ecx, eax
jb 0x404a1a
mov ecx, dword [ebp + 0x104]
mov edx, dword [ecx]
call dword [edx + 0x18]
and eax, 0xffff
push eax
mov dword [esp + 0x20], eax
call fcn.0040a590
add esp, 4
cmp eax, ebx
mov dword [esp + 0x20], eax
je 0x404a1a
mov ecx, dword [ebp + 0x104]
push eax
mov eax, dword [esp + 0x1c]
mov edx, dword [ecx]
push eax
mov eax, dword [esp + 0x2c]
push eax
call dword [edx]
mov eax, dword [esp + 0x10]
lea ecx, [esp + 0x14]
push ebx
push ecx
lea edx, [esp + 0x24]
push 4
push edx
push eax
call esi
test eax, eax
je 0x404a1a
cmp dword [esp + 0x14], 4
jb 0x404a1a
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x20]
lea ecx, [esp + 0x14]
push ebx
push ecx
mov ecx, dword [esp + 0x18]
push edx
push eax
push ecx
call esi
test eax, eax
je 0x404a1a
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x1c]
cmp edx, eax
jb 0x404a1a
mov eax, dword [esp + 0x10]
mov ecx, ebp
push eax
call fcn.00405360
test al, al
je 0x404a1a
lea esi, [edi + 4]
mov ecx, 6
lea edi, [esp + 0x48]
mov edx, dword [esp + 0x64]
rep movsd dword es:[edi], dword [esi]
mov eax, dword [esp + 0x50]
mov ecx, dword [esp + 0x18]
and al, 0xfd
mov dword [esp + 0x58], ecx
or al, 4
mov ecx, ebp
mov dword [esp + 0x50], eax
lea eax, [esp + 0x48]
push eax
mov dword [esp + 0x60], edx
call fcn.00405770
lea ecx, [esp + 0x10]
push ecx
push 1
mov ecx, ebp
call fcn.00403400
mov ebx, dword [esp + 0x28]
jmp 0x404a1a
test byte [esp + 0x68], 1
je 0x404a15
push ebx
push ebx
push edi
mov ecx, ebp
call fcn.00404a50
mov ebx, dword [esp + 0x28]
jmp 0x404a1a
mov ebx, 0xfffffffe
mov ecx, dword [esp + 0x2c]
push 1
call fcn.00408120
mov edx, dword [esp + 0x20]
push edx
call fcn.0040a130
mov eax, dword [esp + 0x28]
add esp, 4
push eax
call fcn.0040a130
add esp, 4
mov eax, ebx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x50
ret 8