Function at 0x40cc50
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x344
mov eax, dword [0x4a1b58]
xor eax, esp
mov dword [esp + 0x340], eax
push ebx
mov ebx, dword [esp + 0x350]
push ebp
mov ebp, dword [esp + 0x35c]
push esi
push edi
mov esi, ecx
cmp ebp, 3
je 0x40cc99
cmp ebp, 2
je 0x40cd69
cmp ebp, 1
je 0x40cd69
mov eax, 0x10000
jmp 0x40d007
mov eax, dword [esi + 4]
mov edi, dword [esp + 0x358]
cmp edi, eax
je 0x40cd07
cmp eax, 0xffffffff
je 0x40ccb7
mov eax, dword [esi]
push eax
call fcn.0040a7f0
add esp, 4
mov eax, dword [esi]
mov dword [esi + 4], 0xffffffff
cmp edi, dword [eax + 4]
jge 0x40cc8f
cmp edi, dword [eax + 0x10]
jge 0x40ccd3
push eax
call fcn.0040a560
add esp, 4
mov ecx, dword [esi]
cmp dword [ecx + 0x10], edi
jge 0x40ccf2
lea ebx, [ebx]
mov edx, dword [esi]
push edx
call fcn.0040a5b0
mov eax, dword [esi]
add esp, 4
cmp dword [eax + 0x10], edi
jl 0x40cce0
mov ecx, dword [esi + 0x138]
mov edx, dword [esi]
push ecx
push edx
call fcn.0040c780
add esp, 8
mov dword [esi + 4], edi
mov ecx, dword [esp + 0x360]
mov edx, dword [esi]
lea eax, [esp + 0x13]
push eax
push ecx
push ebx
push edx
call fcn.0040c910
mov edi, eax
add esp, 0x10
test edi, edi
jg 0x40cd38
mov eax, dword [esi]
push eax
call fcn.0040a7f0
add esp, 4
mov dword [esi + 4], 0xffffffff
cmp byte [esp + 0x13], 0
jne 0x40ce0a
test edi, edi
jle 0x40cd51
mov eax, 0x600
jmp 0x40d007
mov eax, edi
sub eax, 0xffffff96
neg eax
sbb eax, eax
and eax, 0x4fff000
add eax, 0x1000
jmp 0x40d007
or edi, 0xffffffff
cmp dword [esi + 4], edi
je 0x40cd7c
mov ecx, dword [esi]
push ecx
call fcn.0040a7f0
add esp, 4
mov eax, dword [esi]
mov dword [esi + 4], edi
mov edi, dword [esp + 0x358]
cmp edi, dword [eax + 4]
jge 0x40cc8f
cmp edi, dword [eax + 0x10]
jge 0x40cd9f
push eax
call fcn.0040a560
add esp, 4
mov edx, dword [esi]
cmp dword [edx + 0x10], edi
jge 0x40cdb8
mov eax, dword [esi]
push eax
call fcn.0040a5b0
mov ecx, dword [esi]
add esp, 4
cmp dword [ecx + 0x10], edi
jl 0x40cda6
lea edx, [esp + 0x1c]
push edx
push edi
mov ecx, esi
call fcn.0040a9d0
test byte [esp + 0x124], 0x10
je 0x40ce11
cmp ebp, 1
je 0x40ce0a
mov al, byte [ebx]
cmp al, 0x2f
je 0x40cde8
cmp al, 0x5c
je 0x40cde8
test al, al
je 0x40cdfa
cmp byte [ebx + 1], 0x3a
jne 0x40cdfa
push ebx
push 0
call fcn.0040aed0
add esp, 8
xor eax, eax
jmp 0x40d007
push ebx
add esi, 0x140
push esi
call fcn.0040aed0
add esp, 8
xor eax, eax
jmp 0x40d007
cmp ebp, 1
je 0x40ceb0
mov al, byte [ebx]
mov ebp, ebx
mov ecx, ebx
test al, al
je 0x40ce37
cmp al, 0x2f
je 0x40ce2c
cmp al, 0x5c
jne 0x40ce2f
lea ebp, [ecx + 1]
mov al, byte [ecx + 1]
inc ecx
test al, al
jne 0x40ce24
lea edx, [esp + 0x148]
mov eax, ebx
sub edx, ebx
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x40ce42
cmp ebp, ebx
jne 0x40cebf
mov byte [esp + 0x148], cl
push ebp
lea ecx, [esp + 0x14c]
push ecx
lea edi, [esi + 0x140]
push edi
lea edx, [esp + 0x258]
push 0x486f48
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
lea eax, [esp + 0x15c]
push eax
push edi
call fcn.0040aed0
add esp, 0x1c
mov ecx, dword [esp + 0x124]
push 0
push ecx
push 2
push 0
push 0
push 0x40000000
lea edx, [esp + 0x264]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x40cf23
mov eax, 0x200
jmp 0x40d007
mov eax, ebp
sub eax, ebx
mov byte [esp + eax + 0x148], 0
mov al, byte [esp + 0x148]
cmp al, 0x2f
je 0x40cef0
cmp al, 0x5c
je 0x40cef0
test al, al
je 0x40ce57
cmp byte [esp + 0x149], 0x3a
jne 0x40ce57
push ebp
lea ecx, [esp + 0x14c]
push ecx
lea edx, [esp + 0x254]
push str._s_s
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
lea eax, [esp + 0x158]
push eax
push 0
call fcn.0040aed0
add esp, 0x18
jmp 0x40ce8b
mov eax, dword [esi + 0x138]
mov ecx, dword [esi]
push eax
push ecx
call fcn.0040c780
add esp, 8
cmp dword [esi + 0x13c], 0
jne 0x40cf51
push 0x4000
call fcn.0040d28f
add esp, 4
mov dword [esi + 0x13c], eax
mov ebp, dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [esp + 0x14], 0
nop
mov eax, dword [esi + 0x13c]
mov ecx, dword [esi]
lea edx, [esp + 0x13]
push edx
push 0x4000
push eax
push ecx
call fcn.0040c910
mov edi, eax
add esp, 0x10
cmp edi, 0xffffff96
je 0x40cfb4
test edi, edi
jl 0x40cfaa
jle 0x40cf9f
mov eax, dword [esi + 0x13c]
push 0
lea edx, [esp + 0x1c]
push edx
push edi
push eax
push ebx
call ebp
test eax, eax
je 0x40cfbe
cmp byte [esp + 0x13], 0
jne 0x40cfc8
test edi, edi
jne 0x40cf60
mov dword [esp + 0x14], 0x5000000
jmp 0x40cfe7
mov dword [esp + 0x14], 0x1000
jmp 0x40cfe7
mov dword [esp + 0x14], 0x400
jmp 0x40cfe7
lea ecx, [esp + 0x138]
push ecx
lea edx, [esp + 0x12c]
push edx
lea eax, [esp + 0x138]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp dword [esp + 0x364], 1
je 0x40cff8
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esi]
push ecx
call fcn.0040a7f0
mov eax, dword [esp + 0x18]
add esp, 4
mov ecx, dword [esp + 0x350]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0042a4d9
add esp, 0x344
ret 0x10