Function at 0x403658
Capabilities:
Check for time delay via gettickcount
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x9c
mov eax, dword [ebp + 8]
cmp dword [ebp + 0x10], 0
mov ebx, dword [ebp + 0x14]
je 0x40367b
mov edx, dword [ebp + 0x10]
mov dword [ebp - 0x6c], ebx
mov dword [ebp - 0x70], edx
jmp 0x403689
mov dword [ebp - 0x6c], 0x8000
mov dword [ebp - 0x70], 0x411c44
test eax, eax
js 0x40369c
add eax, dword [0x7a43e4]
mov dword [esp], eax
call fcn.004035dc
push edi
lea eax, [ebp - 0x1c]
mov dword [esp + 4], 4
mov dword [esp], eax
call fcn.0040360d
test eax, eax
push esi
push esi
je 0x4038cc
mov eax, dword [ebp - 0x1c]
test eax, eax
jns 0x403848
call sub.KERNEL32.dll_GetTickCount
mov edi, dword [ebp - 0x1c]
xor ebx, ebx
mov byte [0x421c60], 0xb
mov dword [0x421c78], 0
and edi, 0x7fffffff
mov dword [ebp - 0x1c], edi
mov dword [ebp - 0x74], eax
mov dword [ebp - 0x78], edi
jmp 0x403838
cmp esi, 0x4000
jle 0x403700
mov esi, 0x4000
mov dword [esp + 4], esi
mov dword [esp], 0x40dc44
call fcn.0040360d
test eax, eax
push ecx
push ecx
je 0x4038cc
sub dword [ebp - 0x1c], esi
mov dword [0x421c50], 0x40dc44
mov dword [0x421c54], esi
mov edx, dword [ebp - 0x6c]
mov eax, dword [ebp - 0x70]
mov dword [esp], 0x421c50
mov dword [0x421c5c], edx
mov dword [0x421c58], eax
call fcn.00407fe8
test eax, eax
mov edi, eax
push edx
jns 0x40375b
mov ebx, 0xfffffffc
jmp 0x4038d8
mov esi, dword [0x421c58]
sub esi, dword [ebp - 0x70]
call sub.KERNEL32.dll_GetTickCount
test byte [0x7a4370], 1
mov edx, eax
je 0x4037d6
sub eax, dword [ebp - 0x74]
cmp eax, 0xc8
ja 0x403784
cmp dword [ebp - 0x1c], 0
jne 0x4037d6
mov eax, dword [ebp - 0x78]
mov dword [ebp - 0x7c], edx
mov dword [esp + 4], 0x64
mov dword [esp + 8], eax
sub eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sub.KERNEL32.dll_MulDiv
sub esp, 0xc
mov dword [esp + 8], eax
lea eax, [ebp - 0x60]
mov dword [esp + 4], str....__d__
mov dword [esp], eax
call sub.USER32.dll_wsprintfA
lea eax, [ebp - 0x60]
mov dword [esp + 4], eax
mov dword [esp], 0
call fcn.00404460
mov edx, dword [ebp - 0x7c]
mov dword [ebp - 0x74], edx
push eax
push eax
test esi, esi
je 0x403838
cmp dword [ebp + 0x10], 0
jne 0x40381d
lea edx, [ebp - 0x20]
mov eax, dword [ebp - 0x70]
mov dword [esp + 0xc], edx
mov edx, dword [ebp + 0xc]
mov dword [esp + 0x10], 0
mov dword [esp + 8], esi
mov dword [esp + 4], eax
mov dword [esp], edx
call sub.KERNEL32.dll_WriteFile
sub esp, 0x14
test eax, eax
je 0x4038d3
cmp dword [ebp - 0x20], esi
jne 0x4038d3
add ebx, esi
jmp 0x40382a
mov eax, dword [0x421c58]
add ebx, esi
sub dword [ebp - 0x6c], esi
mov dword [ebp - 0x70], eax
cmp edi, 4
jne 0x40372d
jmp 0x4038d8
mov esi, dword [ebp - 0x1c]
test esi, esi
jg 0x4036f3
jmp 0x4038d8
cmp dword [ebp + 0x10], 0
jne 0x4038b1
xor ebx, ebx
lea edi, [ebp - 0x20]
jmp 0x4038a8
mov esi, dword [ebp - 0x6c]
cmp esi, eax
jle 0x40385e
mov esi, eax
mov dword [esp + 4], esi
mov dword [esp], 0x40dc44
call fcn.0040360d
test eax, eax
push ecx
push ecx
je 0x4038cc
mov edx, dword [ebp + 0xc]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], edi
mov dword [esp + 8], esi
mov dword [esp + 4], 0x40dc44
mov dword [esp], edx
call sub.KERNEL32.dll_WriteFile
sub esp, 0x14
test eax, eax
je 0x4038d3
cmp esi, dword [ebp - 0x20]
jne 0x4038d3
sub dword [ebp - 0x1c], esi
add ebx, esi
mov eax, dword [ebp - 0x1c]
test eax, eax
jg 0x403855
jmp 0x4038d8
cmp ebx, eax
jle 0x4038b7
mov ebx, eax
mov eax, dword [ebp + 0x10]
mov dword [esp + 4], ebx
mov dword [esp], eax
call fcn.0040360d
test eax, eax
push edx
push edx
jne 0x4038d8
mov ebx, 0xfffffffd
jmp 0x4038d8
mov ebx, 0xfffffffe
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret 0x10