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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
mov dword [ebp - 4], 0
cmp dword [ebp + 8], 0
jg 0x10004bff
mov eax, 0x3ea
jmp 0x10004ee8
cmp dword [ebp + 0x14], 0
jg 0x10004c0f
mov eax, 0x3ea
jmp 0x10004ee8
mov eax, dword [ebp + 0xc]
push eax
call fcn.1000ef40
add esp, 4
test eax, eax
jne 0x10004c29
mov eax, 0x3ea
jmp 0x10004ee8
cmp dword [0x1001fb18], 0
jne 0x10004c3c
mov eax, 0x3f5
jmp 0x10004ee8
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 0x20], eax
mov ecx, dword [ebp - 0x20]
add ecx, dword [ebp + 0x14]
mov dword [ebp - 0xc], ecx
mov edx, dword [ebp + 8]
add edx, 1
push edx
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [ebp - 0x18], eax
cmp dword [0x1001fb18], 1
jne 0x10004d14
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp - 0x20]
jle 0x10004ced
lea ecx, [ebp - 0x2c]
push ecx
lea edx, [ebp - 0x1c]
push edx
mov eax, dword [0x10017050]
push eax
call dword [sym.imp.KERNEL32.dll_ClearCommError]
cmp dword [ebp - 0x28], 0
jbe 0x10004ce2
push 0
lea ecx, [ebp - 8]
push ecx
mov edx, dword [ebp + 8]
push edx
mov eax, dword [ebp - 0x18]
add eax, dword [ebp - 4]
push eax
mov ecx, dword [0x10017050]
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x10004cc5
mov edx, dword [ebp - 0x18]
push edx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, 0x3e9
jmp 0x10004ee8
mov eax, dword [ebp - 4]
add eax, dword [ebp - 8]
mov dword [ebp - 4], eax
mov ecx, dword [ebp - 4]
cmp ecx, dword [ebp + 8]
jl 0x10004ce0
mov edx, dword [ebp + 0x10]
mov eax, dword [ebp - 4]
mov dword [edx], eax
jmp 0x10004ced
jmp 0x10004ceb
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 0x20], eax
jmp 0x10004c6d
mov ecx, dword [ebp - 0x20]
cmp ecx, dword [ebp - 0xc]
jl 0x10004d0f
cmp dword [ebp - 4], 0
jg 0x10004d0f
mov edx, dword [ebp - 0x18]
push edx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, 0x3f2
jmp 0x10004ee8
jmp 0x10004e3e
cmp dword [0x1001fb18], 4
jne 0x10004d5e
mov eax, dword [ebp + 8]
push eax
mov ecx, dword [ebp - 0x18]
push ecx
push 1
mov edx, dword [0x1001705c]
push edx
call dword [0x10029b40]
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 0
jge 0x10004d51
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, 0x3e9
jmp 0x10004ee8
mov ecx, dword [ebp + 0x10]
mov edx, dword [ebp - 0x30]
mov dword [ecx], edx
jmp 0x10004e3e
cmp dword [0x1001fb18], 5
jne 0x10004d9f
mov eax, dword [ebp + 8]
push eax
mov ecx, dword [ebp - 0x18]
push ecx
call dword [0x10029b58]
mov dword [ebp - 0x34], eax
cmp dword [ebp - 0x34], 0
jge 0x10004d92
mov edx, dword [ebp - 0x18]
push edx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, 0x3e9
jmp 0x10004ee8
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp - 0x34]
mov dword [eax], ecx
jmp 0x10004e3e
cmp dword [0x1001fb18], 3
jne 0x10004de3
mov edx, dword [ebp + 0x14]
push edx
mov eax, dword [ebp + 0x10]
push eax
mov ecx, dword [ebp + 8]
push ecx
mov edx, dword [ebp - 0x18]
push edx
mov eax, dword [0x10017054]
push eax
call fcn.1000d8b6
add esp, 0x14
cmp eax, 0x3e8
je 0x10004de1
mov ecx, dword [ebp - 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, 0x3e9
jmp 0x10004ee8
jmp 0x10004e3e
cmp dword [0x1001fb18], 7
jne 0x10004e2a
mov edx, dword [ebp + 0x14]
push edx
mov eax, dword [ebp + 8]
push eax
mov ecx, dword [ebp - 0x18]
push ecx
mov edx, dword [0x10017060]
push edx
call fcn.1000d4fc
add esp, 0x10
mov ecx, dword [ebp + 0x10]
mov dword [ecx], eax
mov edx, dword [ebp + 0x10]
cmp dword [edx], 0
jg 0x10004e28
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, 0x3e9
jmp 0x10004ee8
jmp 0x10004e3e
mov ecx, dword [ebp - 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, 0x3e9
jmp 0x10004ee8
push 0
push 0
push 2
push 0
push 0
push 0xc0000000
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0xffffffff
jne 0x10004e71
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, 0x3eb
jmp 0x10004ee8
push 0
lea ecx, [ebp - 0x14]
push ecx
mov edx, dword [ebp + 0x10]
mov eax, dword [edx]
push eax
mov ecx, dword [ebp - 0x18]
push ecx
mov edx, dword [ebp - 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x10004eaa
mov eax, dword [ebp - 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, 0x3ed
jmp 0x10004ee8
mov edx, dword [ebp + 0x10]
mov eax, dword [ebp - 0x14]
cmp eax, dword [edx]
je 0x10004ecf
mov ecx, dword [ebp - 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebp - 0x18]
push edx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, 0x3ed
jmp 0x10004ee8
mov eax, dword [ebp - 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, 0x3e8
mov esp, ebp
pop ebp
ret 0x10