Function at 0x40d3c0
Capabilities:
Write file on windows

Disassembly:
mov eax, 0x4238
call fcn.0040f910
mov eax, dword [0x421260]
push ebx
mov ebx, dword [esp + 0x424c]
cmp ebx, 3
push esi
mov dword [esp + 0x423c], eax
push edi
mov esi, ecx
je 0x40d416
cmp ebx, 2
je 0x40d4ec
cmp ebx, 1
je 0x40d4ec
pop edi
pop esi
mov eax, 0x10000
pop ebx
mov ecx, dword [esp + 0x4234]
call fcn.0040e818
add esp, 0x4238
ret 0x10
mov eax, dword [esi + 4]
mov edi, dword [esp + 0x4248]
cmp edi, eax
je 0x40d479
cmp eax, 0xffffffff
je 0x40d434
mov eax, dword [esi]
push eax
call fcn.0040b0c0
add esp, 4
mov eax, dword [esi]
mov dword [esi + 4], 0xffffffff
cmp edi, dword [eax + 4]
jge 0x40d3f9
cmp edi, dword [eax + 0x10]
jge 0x40d450
push eax
call fcn.0040ae00
add esp, 4
mov ecx, dword [esi]
cmp dword [ecx + 0x10], edi
jge 0x40d46b
mov edx, dword [esi]
push edx
call fcn.0040ae50
mov eax, dword [esi]
mov ecx, dword [eax + 0x10]
add esp, 4
cmp ecx, edi
jl 0x40d457
mov ecx, dword [esi]
push ecx
call fcn.0040cff0
add esp, 4
mov dword [esi + 4], edi
mov edx, dword [esp + 0x4250]
mov eax, dword [esp + 0x424c]
mov ecx, dword [esi]
push edx
push eax
push ecx
call fcn.0040d110
mov edi, eax
add esp, 0xc
test edi, edi
jle 0x40d4b7
pop edi
pop esi
mov eax, 0x600
pop ebx
mov ecx, dword [esp + 0x4234]
call fcn.0040e818
add esp, 0x4238
ret 0x10
mov edx, dword [esi]
push edx
call fcn.0040b0c0
add esp, 4
mov eax, edi
neg eax
pop edi
mov dword [esi + 4], 0xffffffff
sbb eax, eax
pop esi
and eax, 0x5000000
pop ebx
mov ecx, dword [esp + 0x4234]
call fcn.0040e818
add esp, 0x4238
ret 0x10
mov eax, dword [esi + 4]
or edi, 0xffffffff
cmp eax, edi
je 0x40d501
mov eax, dword [esi]
push eax
call fcn.0040b0c0
add esp, 4
mov eax, dword [esi]
mov dword [esi + 4], edi
mov edi, dword [esp + 0x4248]
cmp edi, dword [eax + 4]
jge 0x40d3f9
cmp edi, dword [eax + 0x10]
jge 0x40d524
push eax
call fcn.0040ae00
add esp, 4
mov ecx, dword [esi]
cmp dword [ecx + 0x10], edi
jge 0x40d544
jmp 0x40d530
mov edx, dword [esi]
push edx
call fcn.0040ae50
mov eax, dword [esi]
mov ecx, dword [eax + 0x10]
add esp, 4
cmp ecx, edi
jl 0x40d530
lea ecx, [esp + 0x114]
push ecx
push edi
mov ecx, esi
call fcn.0040b1c0
test byte [esp + 0x21c], 0x10
je 0x40d578
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x4234]
call fcn.0040e818
add esp, 0x4238
ret 0x10
cmp ebx, 1
mov edi, dword [esp + 0x424c]
push ebp
je 0x40d64c
mov al, byte [edi]
test al, al
mov ebx, edi
mov ecx, edi
je 0x40d626
cmp al, 0x2f
je 0x40d59f
cmp al, 0x5c
jne 0x40d5a2
lea ebx, [ecx + 1]
mov al, byte [ecx + 1]
inc ecx
test al, al
jne 0x40d597
cmp ebx, edi
je 0x40d626
lea edx, [esp + 0x14]
mov eax, edi
sub edx, edi
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x40d5b6
sub ebx, edi
mov byte [esp + ebx + 0x13], cl
mov al, byte [esp + 0x14]
cmp al, 0x2f
je 0x40d5dd
cmp al, 0x5c
je 0x40d5dd
cmp byte [esp + 0x15], 0x3a
je 0x40d5dd
xor bl, bl
jmp 0x40d5df
mov bl, 1
lea edx, [esp + 0x14]
push 0x41d0b4
push edx
call fcn.0040f5d3
mov ebp, eax
lea eax, [esp + 0x1c]
push 0x41d0b0
push eax
call fcn.0040f5d3
add esp, 0x10
test eax, eax
setne cl
test ebp, ebp
setne dl
or cl, dl
or cl, bl
jne 0x40d626
lea eax, [esp + 0x14]
push eax
lea ecx, [esi + 0x138]
push ecx
call fcn.0040b610
add esp, 8
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push edi
mov dword [esp + 0x23c], 0x80
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
jne 0x40d65b
mov eax, 0x200
jmp 0x40d715
mov edx, dword [esi]
push edx
call fcn.0040cff0
mov ecx, dword [esi]
push 0x4000
lea eax, [esp + 0x24c]
push eax
push ecx
xor bl, bl
call fcn.0040d110
add esp, 0x10
test eax, eax
jl 0x40d6bc
mov ebp, dword [sym.imp.KERNEL32.dll_WriteFile]
je 0x40d6be
push 0
lea edx, [esp + 0x14]
push edx
push eax
lea eax, [esp + 0x250]
push eax
push edi
call ebp
test eax, eax
je 0x40d6bc
mov edx, dword [esi]
push 0x4000
lea ecx, [esp + 0x248]
push ecx
push edx
call fcn.0040d110
add esp, 0xc
test eax, eax
jge 0x40d687
mov bl, 1
push edi
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 1
jne 0x40d6ed
test bl, bl
jne 0x40d6ed
lea eax, [esp + 0x234]
push eax
lea ecx, [esp + 0x228]
push ecx
lea edx, [esp + 0x234]
push edx
push edi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp dword [esp + 0x4258], 1
je 0x40d6fe
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esi]
push eax
call fcn.0040b0c0
add esp, 4
neg bl
sbb ebx, ebx
and ebx, 0x400
mov eax, ebx
mov ecx, dword [esp + 0x4244]
pop ebp
pop edi
pop esi
pop ebx
call fcn.0040e818
add esp, 0x4238
ret 0x10