Function at 0x40eca0
Capabilities:
Check for time delay via gettickcount
Get common file path
Set current directory
Write file on windows

Disassembly:
push ebp
lea ebp, [esp - 0x78]
sub esp, 0x484
push ebx
push esi
push edi
mov ebx, ecx
call fcn.00419cf2
test eax, eax
jne 0x40ece0
cmp byte [ebx + 0x1f6], al
je 0x40ece0
cmp dword [ebx + 0x14], eax
je 0x40ece0
push 4
push eax
push 0xfb8
push dword [ebx + 0x128]
mov dword [ebx + 0x14], eax
mov dword [ebx + 0x18], eax
call dword [sym.imp.USER32.dll_PostMessageA]
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount]
lea edi, [ebx + 0x124]
call esi
sub eax, dword [edi]
cmp eax, 0x7530
jbe 0x40eeea
call esi
lea ecx, [ebx + 0x134]
mov dword [edi], eax
call fcn.0040a615
test eax, eax
je 0x40eeea
lea eax, [ebp - 0x40c]
push eax
push 0x105
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
xor edi, edi
cmp dword [ebx + 0x180], edi
jne 0x40ed3a
cmp dword [ebx + 0x138], edi
je 0x40eedb
push edi
push 0x8000000
push 2
push edi
push 1
push 0x40000000
lea eax, [ebx + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp + 0x70], eax
je 0x40eedb
lea ecx, [ebx + 0x134]
mov dword [ebx + 0x180], edi
call fcn.0040a615
test eax, eax
je 0x40eed2
push edi
lea eax, [ebp + 0x6c]
push eax
push 4
push 0x4562c0
push dword [ebp + 0x70]
call dword [sym.imp.KERNEL32.dll_WriteFile]
lea ecx, [ebx + 0x134]
mov dword [ebp + 0x74], edi
call fcn.0040a615
test eax, eax
jbe 0x40eed2
lea eax, [ebp - 0x304]
push eax
push dword [ebp + 0x74]
lea ecx, [ebx + 0x134]
call fcn.0040aae6
mov eax, dword [ebp - 0x304]
mov dword [ebp + 0x40], eax
mov al, byte [ebp + 0x13]
and al, 0x1f
mov byte [ebp + 0x4e], al
mov al, byte [ebp + 0x14]
or al, byte [ebp + 0x12]
lea esi, [ebp + 0x16]
mov byte [ebp + 0x4f], al
mov eax, dword [ebp - 0x300]
mov dword [ebp + 0x38], eax
mov eax, dword [ebp - 0x2f8]
mov dword [ebp + 0x44], eax
mov eax, dword [ebp - 0x2f4]
mov dword [ebp + 0x48], eax
mov eax, dword [ebp + 0x28]
lea edi, [ebp + 0x50]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
mov dword [ebp + 0x68], eax
lea eax, [ebp - 0x1ee]
push eax
call fcn.004279a0
mov word [ebp + 0x62], ax
mov ax, word [ebp - 0x2f0]
mov word [ebp + 0x4c], ax
lea eax, [ebp - 0xee]
push eax
call fcn.004279a0
mov word [ebp + 0x64], ax
mov ax, word [ebp - 0x2fc]
mov word [ebp + 0x3c], ax
lea eax, [ebp - 0x2ee]
push eax
call fcn.004279a0
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
add esp, 0xc
mov word [ebp + 0x60], ax
xor edi, edi
push edi
lea eax, [ebp + 0x6c]
push eax
push 0x34
lea eax, [ebp + 0x38]
push eax
push dword [ebp + 0x70]
call esi
cmp word [ebp + 0x60], di
je 0x40ee7b
push edi
lea eax, [ebp + 0x6c]
push eax
movzx eax, word [ebp + 0x60]
push eax
lea eax, [ebp - 0x2ee]
push eax
push dword [ebp + 0x70]
call esi
cmp word [ebp + 0x62], di
je 0x40ee97
push edi
lea eax, [ebp + 0x6c]
push eax
movzx eax, word [ebp + 0x62]
push eax
lea eax, [ebp - 0x1ee]
push eax
push dword [ebp + 0x70]
call esi
cmp word [ebp + 0x64], di
je 0x40eeb3
push edi
lea eax, [ebp + 0x6c]
push eax
movzx eax, word [ebp + 0x64]
push eax
lea eax, [ebp - 0xee]
push eax
push dword [ebp + 0x70]
call esi
inc dword [ebp + 0x74]
lea ecx, [ebx + 0x134]
call fcn.0040a615
cmp dword [ebp + 0x74], eax
jb 0x40eda4
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount]
xor edi, edi
push dword [ebp + 0x70]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [ebp - 0x40c]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
jmp 0x40eeec
xor edi, edi
call esi
sub eax, dword [ebx + 4]
cmp eax, 0x186a0
jbe 0x40ef06
call esi
mov ecx, dword [ebx + 8]
push edi
mov dword [ebx + 4], eax
call fcn.0041b61e
cmp dword [ebx + 0x1e6c], edi
jne 0x40efd5
cmp dword [ebx + 0x17c], edi
jne 0x40efd5
cmp byte [ebx + 0x1f6], 0
je 0x40ef3b
call fcn.00419cf2
test eax, eax
jne 0x40ef3b
cmp byte [ebx + 0x1fd], al
jne 0x40ef3b
mov dword [ebx + 0x18], edi
cmp dword [ebx + 0x18], edi
je 0x40efbc
cmp byte [ebx + 0x223], 0
je 0x40efbc
mov eax, dword [ebx + 0x1a8]
cmp eax, dword [ebx + 0x1f98]
jbe 0x40efd5
cmp dword [ebx + 0x14], edi
je 0x40efd5
lea esi, [ebx + 0x134]
mov ecx, esi
mov dword [ebp + 0x74], edi
call fcn.0040a615
cmp eax, edi
mov dword [ebp + 0x6c], eax
jbe 0x40efd5
lea eax, [ebp - 0x304]
push eax
push dword [ebp + 0x74]
mov ecx, esi
call fcn.0040aae6
test byte [ebp + 0x13], 0x80
je 0x40efae
test byte [ebp + 0x13], 0x60
jne 0x40efae
push edi
push dword [ebp + 0x74]
mov ecx, ebx
call fcn.0040e7e3
mov eax, dword [ebx + 0x1a8]
cmp eax, dword [ebx + 0x1f98]
ja 0x40efae
push 0xfffffffffffffffe
pop eax
jmp 0x40efb1
mov eax, dword [ebp + 0x74]
inc eax
cmp eax, dword [ebp + 0x6c]
mov dword [ebp + 0x74], eax
jb 0x40ef73
jmp 0x40efd5
cmp byte [ebx + 0x1fd], 0
jne 0x40efc8
mov dword [ebx + 0xc], edi
push dword [ebx + 0xc]
mov ecx, ebx
call fcn.0040d168
mov dword [ebx + 0xc], edi
pop edi
pop esi
pop ebx
add ebp, 0x78
leave
ret