Function at 0x407dd0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x28], eax
mov ebx, dword [ebp + 0x10]
mov dword [ebp - 0x24], ebx
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
mov dword [ebp - 0x1c], edx
mov esi, dword [ebp + 8]
mov edi, dword [esi + 4]
mov dword [ebp - 0x18], edi
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x28]
mov dword [ebp - 0x14], edx
mov esi, dword [ebp + 8]
mov dword [ebp - 8], esi
cmp dword [esi + 0x2c], 0xffffffff
je 0x407e1f
cmp dword [esi + 0x18], 0xffffffff
je 0x407e14
cmp dword [esi + 0x18], 0
jne 0x407e1f
push dword [esi + 0x2c]
call sub.KERNEL32.dll_GetStdHandle
mov dword [esi + 0x18], eax
mov eax, dword [ebp + 8]
mov ebx, dword [eax]
add ebx, dword [ebp + 0x10]
mov dword [ebp - 0x10], ebx
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 4]
cmp ebx, edx
jle 0x407f85
mov eax, dword [ebp + 8]
cmp dword [eax + 0x20], 0
je 0x407f7c
mov eax, dword [ebp + 8]
mov ch, byte [eax + 0x1c]
mov byte [ebp - 4], ch
cmp ch, 2
je 0x407e57
or ch, ch
jne 0x407e6b
neg ebx
and ebx, 0xfff
add ebx, dword [ebp - 0x10]
add ebx, 0x1000
mov dword [ebp - 0x10], ebx
push 0
push 0
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x24]
push ecx
call sub.KERNEL32.dll_FlushViewOfFile
or al, al
setne bh
movzx ebx, bh
push ebx
call fcn.00407a10
push 0
mov edx, dword [ebp + 8]
mov esi, dword [edx + 0x24]
push esi
call sub.KERNEL32.dll_UnmapViewOfFile
or al, al
setne ah
movzx edi, ah
push edi
call fcn.00407a10
mov eax, dword [ebp + 8]
mov dword [eax + 0x24], 0
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x28], 0
push 0
mov ebx, dword [ebp + 8]
push dword [ebx + 0x20]
call sub.KERNEL32.dll_CloseHandle
or eax, eax
setne dh
movzx edx, dh
push edx
call fcn.00407a10
push 0
mov esi, dword [ebp - 0x10]
push esi
push 0
mov edi, dword [ebp + 8]
movzx ecx, byte [edi + 0x10]
push dword [ecx*4 + 0x4124b8]
push 0
mov ebx, dword [ebp + 8]
push dword [ebx + 0x18]
call sub.KERNEL32.dll_CreateFileMappingA
mov edx, dword [ebp + 8]
mov dword [edx + 0x20], eax
push 0
mov edi, dword [ebp + 8]
cmp dword [edi + 0x20], 0
setne ch
movzx ecx, ch
push ecx
call fcn.00407a10
push 0
push 0
push 0
mov esi, dword [ebp + 8]
movzx ebx, byte [esi + 0x10]
push dword [ebx*4 + 0x4124a8]
mov eax, dword [ebp + 8]
push dword [eax + 0x20]
call sub.KERNEL32.dll_MapViewOfFile
mov edx, dword [ebp + 8]
mov dword [edx + 0x28], eax
push 0
mov edi, dword [ebp + 8]
mov ecx, dword [edi + 0x28]
or ecx, ecx
setne bh
movzx esi, bh
push esi
call fcn.00407a10
mov ebx, dword [ebp + 8]
mov eax, dword [ebx + 0x28]
mov edx, dword [ebp + 8]
mov dword [edx + 0x24], eax
mov edi, dword [ebp + 8]
mov ecx, dword [edi + 0x28]
mov dword [ebp - 0x14], ecx
mov esi, dword [ebp + 8]
push dword [esi]
lea ebx, [ebp - 0x14]
push ebx
call fcn.00402750
add esp, 8
mov eax, dword [ebp - 0x14]
mov edx, dword [ebp + 8]
mov dword [edx + 0x28], eax
mov eax, dword [ebp + 8]
mov ebx, dword [ebp - 0x10]
mov dword [eax + 4], ebx
mov eax, dword [ebp + 8]
mov ebx, dword [eax + 0x28]
mov dword [ebp - 0x14], ebx
mov ecx, dword [ebp - 0x14]
or ecx, ecx
jne 0x407fe7
cmp dword [ebp - 0x24], 0
jbe 0x408006
push 0
lea eax, [ebp - 0x20]
push eax
push dword [ebp - 0x24]
mov ebx, dword [ebp - 0x28]
push ebx
mov ecx, dword [ebp + 8]
push dword [ecx + 0x18]
call sub.KERNEL32.dll_WriteFile
mov dword [ebp - 0xc], eax
mov edx, dword [ebp + 8]
push edx
cmp eax, 1
sete bh
movzx esi, bh
push esi
call fcn.00407a10
mov edi, dword [ebp - 0x24]
sub edi, dword [ebp - 0x20]
mov dword [ebp - 0x24], edi
mov ebx, dword [ebp - 0x28]
mov ecx, dword [ebp - 0x20]
lea ebx, [ebx + ecx]
mov dword [ebp - 0x28], ebx
cmp edi, 0
ja 0x407f9b
jmp 0x408006
push dword [ebp - 0x24]
mov eax, dword [ebp - 0x28]
push eax
lea ebx, [ebp - 0x14]
push ebx
call fcn.004026f0
add esp, 0xc
mov dword [ebp - 0x20], eax
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp + 8]
mov dword [edx + 0x28], ecx
mov eax, dword [ebp + 8]
mov ebx, dword [eax]
add ebx, dword [ebp + 0x10]
mov ecx, dword [ebp + 8]
mov dword [ecx], ebx
mov edx, dword [ebp + 8]
mov esi, dword [edx + 4]
cmp dword [edx], esi
jle 0x408025
mov eax, dword [ebp + 8]
mov ebx, dword [eax]
mov dword [eax + 4], ebx
mov eax, dword [ebp + 0x10]
mov esp, ebp
pop ebp
ret 0xc