Function at 0x40ca20
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x354
mov eax, dword [0x4a14b4]
xor eax, esp
mov dword [esp + 0x350], eax
push ebx
push ebp
mov ebp, dword [esp + 0x364]
push esi
mov ebx, ecx
or esi, 0xffffffff
push edi
cmp dword [ebx + 4], esi
je 0x40ca50
mov edi, dword [ebx]
call fcn.0040c1e0
mov edi, dword [esp + 0x368]
mov dword [ebx + 4], esi
mov esi, dword [ebx]
cmp edi, dword [esi + 4]
jl 0x40ca6b
mov eax, 0x10000
jmp 0x40ccc8
cmp edi, dword [esi + 0x10]
jge 0x40ca75
call fcn.0040bbc0
mov eax, dword [ebx]
cmp dword [eax + 0x10], edi
jge 0x40ca8e
lea esp, [esp]
mov esi, dword [ebx]
call fcn.0040bc00
mov ecx, dword [ebx]
cmp dword [ecx + 0x10], edi
jl 0x40ca80
lea edx, [esp + 0x1c]
push edx
push edi
mov ecx, ebx
call fcn.0040c420
test byte [esp + 0x124], 0x10
mov al, byte [ebp]
je 0x40cae3
cmp al, 0x2f
je 0x40caba
cmp al, 0x5c
je 0x40caba
test al, al
je 0x40cacc
cmp byte [ebp + 1], 0x3a
jne 0x40cacc
push ebp
push 0
call fcn.0040c910
add esp, 8
xor eax, eax
jmp 0x40ccc8
push ebp
add ebx, 0x140
push ebx
call fcn.0040c910
add esp, 8
xor eax, eax
jmp 0x40ccc8
mov edi, ebp
mov ecx, ebp
test al, al
je 0x40cb03
jmp 0x40caf0
cmp al, 0x2f
je 0x40caf8
cmp al, 0x5c
jne 0x40cafb
lea edi, [ecx + 1]
mov al, byte [ecx + 1]
inc ecx
test al, al
jne 0x40caf0
lea edx, [esp + 0x14c]
mov eax, ebp
sub edx, ebp
mov edi, edi
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x40cb10
cmp edi, ebp
jne 0x40cb90
mov byte [esp + 0x14c], cl
push edi
lea ecx, [esp + 0x150]
push ecx
lea esi, [ebx + 0x140]
push esi
lea edx, [esp + 0x260]
push str._s_s_s
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x14
lea eax, [esp + 0x14c]
push eax
push esi
call fcn.0040c910
add esp, 8
mov ecx, dword [esp + 0x124]
push 0
push ecx
push 2
push 0
push 0
push 0x40000000
lea edx, [esp + 0x26c]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
jne 0x40cbf4
mov eax, 0x200
jmp 0x40ccc8
mov eax, edi
sub eax, ebp
mov byte [esp + eax + 0x14c], 0
mov al, byte [esp + 0x14c]
cmp al, 0x2f
je 0x40cbc1
cmp al, 0x5c
je 0x40cbc1
test al, al
je 0x40cb25
cmp byte [esp + 0x14d], 0x3a
jne 0x40cb25
push edi
lea ecx, [esp + 0x150]
push ecx
lea edx, [esp + 0x25c]
push str._s_s
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
lea eax, [esp + 0x15c]
push eax
push 0
call fcn.0040c910
add esp, 0x18
jmp 0x40cb5c
mov eax, dword [ebx + 0x138]
push eax
mov eax, dword [ebx]
call fcn.0040be30
add esp, 4
cmp dword [ebx + 0x13c], 0
jne 0x40cc21
push 0x4000
call fcn.0040cf81
add esp, 4
mov dword [ebx + 0x13c], eax
mov ebp, dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [esp + 0x14], 0
nop
mov edx, dword [ebx + 0x13c]
mov eax, dword [ebx]
lea ecx, [esp + 0x13]
push ecx
push edx
mov ecx, 0x4000
call fcn.0040bfb0
mov esi, eax
add esp, 8
cmp esi, 0xffffff96
je 0x40cc83
test esi, esi
jl 0x40cc79
jle 0x40cc6e
mov ecx, dword [ebx + 0x13c]
push 0
lea eax, [esp + 0x1c]
push eax
push esi
push ecx
push edi
call ebp
test eax, eax
je 0x40cc8d
cmp byte [esp + 0x13], 0
jne 0x40cc97
test esi, esi
jne 0x40cc30
mov dword [esp + 0x14], 0x5000000
jmp 0x40ccb6
mov dword [esp + 0x14], 0x1000
jmp 0x40ccb6
mov dword [esp + 0x14], 0x400
jmp 0x40ccb6
lea edx, [esp + 0x138]
push edx
lea eax, [esp + 0x12c]
push eax
lea ecx, [esp + 0x138]
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [ebx]
call fcn.0040c1e0
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x360]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.004296eb
add esp, 0x354
ret 8