Function at 0x409370
Capabilities:
Write file on windows

Disassembly:
mov eax, 0x4238
call fcn.0040b7d0
mov eax, dword [0x42d9d0]
xor eax, esp
push ebx
mov ebx, dword [esp + 0x424c]
cmp ebx, 3
push ebp
mov ebp, dword [esp + 0x4248]
push esi
mov dword [esp + 0x4240], eax
push edi
mov esi, ecx
je 0x4093bd
cmp ebx, 2
je 0x409468
cmp ebx, 1
je 0x409468
mov eax, 0x10000
jmp 0x40969f
mov eax, dword [esi + 4]
mov edi, dword [esp + 0x424c]
cmp edi, eax
je 0x409422
cmp eax, 0xffffffff
je 0x4093db
mov eax, dword [esi]
push eax
call fcn.004070a0
add esp, 4
mov eax, dword [esi]
mov dword [esi + 4], 0xffffffff
cmp edi, dword [eax + 4]
jge 0x4093b3
cmp edi, dword [eax + 0x10]
jge 0x4093f7
push eax
call fcn.00406de0
add esp, 4
mov ecx, dword [esi]
cmp dword [ecx + 0x10], edi
jge 0x409414
mov edi, edi
mov edx, dword [esi]
push edx
call fcn.00406e30
mov eax, dword [esi]
mov ecx, dword [eax + 0x10]
add esp, 4
cmp ecx, edi
jl 0x409400
mov ecx, dword [esi]
push ecx
call fcn.00408fa0
add esp, 4
mov dword [esi + 4], edi
mov edx, dword [esp + 0x4254]
mov eax, dword [esi]
push edx
push ebp
push eax
call fcn.004090c0
mov edi, eax
add esp, 0xc
test edi, edi
jle 0x409446
mov eax, 0x600
jmp 0x40969f
mov ecx, dword [esi]
push ecx
call fcn.004070a0
add esp, 4
mov eax, edi
neg eax
sbb eax, eax
mov dword [esi + 4], 0xffffffff
and eax, 0x5000000
jmp 0x40969f
mov eax, dword [esi + 4]
or edi, 0xffffffff
cmp eax, edi
je 0x40947d
mov edx, dword [esi]
push edx
call fcn.004070a0
add esp, 4
mov eax, dword [esi]
mov dword [esi + 4], edi
mov edi, dword [esp + 0x424c]
cmp edi, dword [eax + 4]
jge 0x4093b3
cmp edi, dword [eax + 0x10]
jge 0x4094a0
push eax
call fcn.00406de0
add esp, 4
mov eax, dword [esi]
cmp dword [eax + 0x10], edi
jge 0x4094bb
mov ecx, dword [esi]
push ecx
call fcn.00406e30
mov edx, dword [esi]
mov eax, dword [edx + 0x10]
add esp, 4
cmp eax, edi
jl 0x4094a7
lea eax, [esp + 0x14]
push eax
push edi
mov ecx, esi
call fcn.004071a0
test byte [esp + 0x11c], 0x10
je 0x4094f2
cmp ebx, 1
je 0x4094eb
lea ecx, [esp + 0x18]
push ecx
add esi, 0x138
push esi
call fcn.004075c0
add esp, 8
xor eax, eax
jmp 0x40969f
cmp ebx, 1
mov edi, ebp
je 0x4095d6
mov al, byte [ebp]
test al, al
mov ecx, ebp
je 0x4095b8
lea ebx, [ebx]
cmp al, 0x2f
je 0x409518
cmp al, 0x5c
jne 0x40951b
lea edi, [ecx + 1]
mov al, byte [ecx + 1]
inc ecx
test al, al
jne 0x409510
cmp edi, ebp
je 0x4095b8
lea edx, [esp + 0x140]
mov eax, ebp
sub edx, ebp
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x409536
sub edi, ebp
mov byte [esp + edi + 0x13f], cl
mov al, byte [esp + 0x140]
cmp al, 0x2f
je 0x409566
cmp al, 0x5c
je 0x409566
cmp byte [esp + 0x141], 0x3a
je 0x409566
xor bl, bl
jmp 0x409568
mov bl, 1
lea edx, [esp + 0x140]
push 0x425cfc
push edx
call fcn.0040afc6
mov edi, eax
lea eax, [esp + 0x148]
push 0x425cf8
push eax
call fcn.0040afc6
add esp, 0x10
test eax, eax
setne cl
test edi, edi
setne dl
or cl, dl
or cl, bl
jne 0x4095b8
lea eax, [esp + 0x140]
push eax
lea ecx, [esi + 0x138]
push ecx
call fcn.004075c0
add esp, 8
mov edx, dword [esp + 0x11c]
push 0
push edx
push 2
push 0
push 0
push 0x40000000
push ebp
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
jne 0x4095e5
mov eax, 0x200
jmp 0x40969f
mov eax, dword [esi]
push eax
call fcn.00408fa0
mov edx, dword [esi]
push 0x4000
lea ecx, [esp + 0x24c]
push ecx
push edx
xor bl, bl
call fcn.004090c0
add esp, 0x10
test eax, eax
jl 0x409646
mov ebp, dword [sym.imp.KERNEL32.dll_WriteFile]
je 0x409648
push 0
lea ecx, [esp + 0x14]
push ecx
push eax
lea edx, [esp + 0x250]
push edx
push edi
call ebp
test eax, eax
je 0x409646
mov ecx, dword [esi]
push 0x4000
lea eax, [esp + 0x248]
push eax
push ecx
call fcn.004090c0
add esp, 0xc
test eax, eax
jge 0x409611
mov bl, 1
push edi
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 1
jne 0x409677
test bl, bl
jne 0x409677
lea edx, [esp + 0x130]
push edx
lea eax, [esp + 0x124]
push eax
lea ecx, [esp + 0x130]
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp dword [esp + 0x4258], 1
je 0x409688
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [esi]
push edx
call fcn.004070a0
add esp, 4
neg bl
sbb ebx, ebx
and ebx, 0x400
mov eax, ebx
mov ecx, dword [esp + 0x4244]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0040a861
add esp, 0x4238
ret 0x10