Function at 0x40dba0
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x650
mov eax, dword [0x448e90]
xor eax, esp
mov dword [esp + 0x64c], eax
push ebx
mov ebx, dword [esp + 0x65c]
push ebp
mov ebp, dword [esp + 0x668]
push esi
push edi
mov esi, ecx
cmp ebp, 3
je 0x40dbe9
cmp ebp, 2
je 0x40dcb9
cmp ebp, 1
je 0x40dcb9
mov eax, 0x10000
jmp 0x40df79
mov eax, dword [esi + 4]
mov edi, dword [esp + 0x664]
cmp edi, eax
je 0x40dc57
cmp eax, 0xffffffff
je 0x40dc07
mov eax, dword [esi]
push eax
call fcn.0040b710
add esp, 4
mov eax, dword [esi]
mov dword [esi + 4], 0xffffffff
cmp edi, dword [eax + 4]
jge 0x40dbdf
cmp edi, dword [eax + 0x10]
jge 0x40dc23
push eax
call fcn.0040b470
add esp, 4
mov ecx, dword [esi]
cmp dword [ecx + 0x10], edi
jge 0x40dc42
lea ebx, [ebx]
mov edx, dword [esi]
push edx
call fcn.0040b4c0
mov eax, dword [esi]
add esp, 4
cmp dword [eax + 0x10], edi
jl 0x40dc30
mov ecx, dword [esi + 0x23c]
mov edx, dword [esi]
push ecx
push edx
call fcn.0040d5a0
add esp, 8
mov dword [esi + 4], edi
mov ecx, dword [esp + 0x66c]
mov edx, dword [esi]
lea eax, [esp + 0x13]
push eax
push ecx
push ebx
push edx
call fcn.0040d730
mov edi, eax
add esp, 0x10
test edi, edi
jg 0x40dc88
mov eax, dword [esi]
push eax
call fcn.0040b710
add esp, 4
mov dword [esi + 4], 0xffffffff
cmp byte [esp + 0x13], 0
jne 0x40dd61
test edi, edi
jle 0x40dca1
mov eax, 0x600
jmp 0x40df79
mov eax, edi
sub eax, 0xffffff96
neg eax
sbb eax, eax
and eax, 0x4fff000
add eax, 0x1000
jmp 0x40df79
or edi, 0xffffffff
cmp dword [esi + 4], edi
je 0x40dccc
mov ecx, dword [esi]
push ecx
call fcn.0040b710
add esp, 4
mov eax, dword [esi]
mov dword [esi + 4], edi
mov edi, dword [esp + 0x664]
cmp edi, dword [eax + 4]
jge 0x40dbdf
cmp edi, dword [eax + 0x10]
jge 0x40dcef
push eax
call fcn.0040b470
add esp, 4
mov edx, dword [esi]
cmp dword [edx + 0x10], edi
jge 0x40dd08
mov eax, dword [esi]
push eax
call fcn.0040b4c0
mov ecx, dword [esi]
add esp, 4
cmp dword [ecx + 0x10], edi
jl 0x40dcf6
lea edx, [esp + 0x1c]
push edx
push edi
mov ecx, esi
call fcn.0040b890
test byte [esp + 0x228], 0x10
je 0x40dd68
cmp ebp, 1
je 0x40dd61
movzx eax, word [ebx]
cmp ax, 0x2f
je 0x40dd3f
cmp ax, 0x5c
je 0x40dd3f
test ax, ax
je 0x40dd51
cmp word [ebx + 2], 0x3a
jne 0x40dd51
push ebx
push 0
call fcn.0040da90
add esp, 8
xor eax, eax
jmp 0x40df79
push ebx
add esi, 0x244
push esi
call fcn.0040da90
add esp, 8
xor eax, eax
jmp 0x40df79
cmp ebp, 1
je 0x40de18
movzx eax, word [ebx]
mov edi, ebx
mov ecx, ebx
test ax, ax
je 0x40dd9b
movzx eax, ax
cmp ax, 0x2f
je 0x40dd8c
cmp ax, 0x5c
jne 0x40dd8f
lea edi, [ecx + 2]
movzx eax, word [ecx + 2]
add ecx, 2
test ax, ax
jne 0x40dd80
push ebx
lea eax, [esp + 0x250]
push 0x104
push eax
call fcn.004221fb
add esp, 0xc
cmp edi, ebx
jne 0x40de27
xor ecx, ecx
mov word [esp + 0x24c], cx
push edi
lea ecx, [esp + 0x250]
push ecx
lea ebx, [esi + 0x244]
push ebx
lea edx, [esp + 0x460]
push str._s_s_s
push edx
call dword [sym.imp.USER32.dll_wsprintfW]
lea eax, [esp + 0x260]
push eax
push ebx
call fcn.0040da90
add esp, 0x1c
mov ecx, dword [esp + 0x228]
push 0
push ecx
push 2
push 0
push 0
push 0x40000000
lea edx, [esp + 0x46c]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x40de96
mov eax, 0x200
jmp 0x40df79
mov edx, edi
sub edx, ebx
xor eax, eax
sar edx, 1
mov word [esp + edx*2 + 0x24c], ax
mov ax, word [esp + 0x24c]
cmp ax, 0x2f
je 0x40de63
cmp ax, 0x5c
je 0x40de63
test ax, ax
je 0x40ddbf
cmp word [esp + 0x24e], 0x3a
jne 0x40ddbf
push edi
lea ecx, [esp + 0x250]
push ecx
lea edx, [esp + 0x45c]
push str._s_s
push edx
call dword [sym.imp.USER32.dll_wsprintfW]
lea eax, [esp + 0x25c]
push eax
push 0
call fcn.0040da90
add esp, 0x18
jmp 0x40ddf3
mov eax, dword [esi + 0x23c]
mov ecx, dword [esi]
push eax
push ecx
call fcn.0040d5a0
add esp, 8
cmp dword [esi + 0x240], 0
jne 0x40dec4
push 0x4000
call fcn.00421260
add esp, 4
mov dword [esi + 0x240], eax
mov ebp, dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [esp + 0x14], 0
mov eax, dword [esi + 0x240]
mov ecx, dword [esi]
lea edx, [esp + 0x13]
push edx
push 0x4000
push eax
push ecx
call fcn.0040d730
mov edi, eax
add esp, 0x10
cmp edi, 0xffffff96
je 0x40df26
test edi, edi
jl 0x40df1c
jle 0x40df11
mov eax, dword [esi + 0x240]
push 0
lea edx, [esp + 0x1c]
push edx
push edi
push eax
push ebx
call ebp
test eax, eax
je 0x40df30
cmp byte [esp + 0x13], 0
jne 0x40df3a
test edi, edi
jne 0x40ded2
mov dword [esp + 0x14], 0x5000000
jmp 0x40df59
mov dword [esp + 0x14], 0x1000
jmp 0x40df59
mov dword [esp + 0x14], 0x400
jmp 0x40df59
lea ecx, [esp + 0x23c]
push ecx
lea edx, [esp + 0x230]
push edx
lea eax, [esp + 0x23c]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp dword [esp + 0x670], 1
je 0x40df6a
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esi]
push ecx
call fcn.0040b710
mov eax, dword [esp + 0x18]
add esp, 4
mov ecx, dword [esp + 0x65c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.004210cf
add esp, 0x650
ret 0x10