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

Disassembly:
sub esp, 0x6c
push ebx
mov ebx, dword [esp + 0x80]
push ebp
mov ebp, dword [esp + 0x80]
test ebp, ebp
push esi
push edi
mov dword [esp + 0x1c], ebx
jne 0x403915
mov dword [esp + 0x1c], 0x8000
test ebp, ebp
mov dword [esp + 0x14], 0
je 0x403927
mov dword [esp + 0x18], ebp
jmp 0x403933
mov dword [esp + 0x18], 0x4110e8
mov ebp, dword [esp + 0x18]
mov edi, dword [esp + 0x80]
test edi, edi
jl 0x403957
mov eax, dword [0x425c18]
mov ecx, dword [0x40b088]
push 0
push 0
add eax, edi
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, dword [0x40b088]
push 0
lea edx, [esp + 0x24]
push edx
mov esi, 4
push esi
lea eax, [esp + 0x98]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x403983
cmp dword [esp + 0x20], esi
je 0x403992
mov eax, 0xfffffffd
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x6c
ret 0x10
mov eax, dword [esp + 0x8c]
cmp eax, 0xffffffff
jne 0x403ada
mov ecx, dword [0x40b088]
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
lea edx, [esp + 0x20]
push edx
push esi
lea eax, [esp + 0x98]
push eax
push ecx
mov dword [esp + 0x94], 0
call ebx
test eax, eax
je 0x403983
cmp dword [esp + 0x1c], esi
jne 0x403983
mov ecx, dword [0x40b088]
push 0
lea edx, [esp + 0x24]
push edx
push esi
lea eax, [esp + 0x94]
push eax
push ecx
call ebx
test eax, eax
je 0x403983
cmp dword [esp + 0x20], esi
jne 0x403983
mov edx, dword [esp + 0x88]
push edx
push 0
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov esi, eax
mov eax, dword [esp + 0x88]
push eax
lea ebp, [edi + 0xc]
mov edi, dword [esp + 0x88]
push esi
push edi
push ebp
call fcn.004038f0
mov ecx, dword [esp + 0x88]
lea eax, [esi + 0x404]
lea ebx, [esi + ecx - 0x10]
mov ecx, dword [eax - 4]
mov dword [0x425c2c], eax
call fcn.00404960
mov eax, dword [0x40b088]
mov edx, dword [esp + 0x8c]
push 0
push 0
push edi
push 1
push 0
push 0
push eax
mov dword [ebx + 0x10], edx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
sub eax, dword [0x425c18]
push eax
call fcn.004038f0
mov ecx, dword [esp + 0x88]
push ecx
push esi
push edi
push ebp
mov ebx, eax
mov dword [0x425c2c], 0
call fcn.004038f0
push 0
lea edx, [esp + 0x84]
push edx
add ebx, eax
mov eax, dword [esp + 0x90]
push eax
push esi
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov ecx, dword [esp + 0x80]
cmp ecx, dword [esp + 0x88]
je 0x403ace
mov eax, 0xfffffffe
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x6c
ret 0x10
mov eax, ebx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x6c
ret 0x10
test eax, eax
jns 0x403d55
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [esp + 0x80], eax
xor edi, edi
mov eax, 0x80
jmp 0x403b00
sub eax, 1
mov byte [eax + 0x4210e8], 0
jne 0x403b00
mov eax, 1
mov dword [0x421150], eax
mov dword [0x42114c], eax
mov dword [0x421148], eax
mov dword [0x421144], eax
mov eax, dword [esp + 0x8c]
and eax, 0x7fffffff
mov dword [0x421160], 0xffffffff
mov dword [esp + 0x8c], eax
mov dword [esp + 0x28], eax
jle 0x403e44
lea esp, [esp]
cmp eax, 0x4000
mov esi, eax
jl 0x403b5e
mov esi, 0x4000
mov eax, dword [0x40b088]
push 0
lea edx, [esp + 0x28]
push edx
push esi
push 0x40d0e8
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x403983
cmp dword [esp + 0x24], esi
jne 0x403983
sub dword [esp + 0x8c], esi
mov dword [0x421100], 0x40d0e8
mov dword [0x421104], esi
test edi, edi
je 0x403bab
mov ecx, dword [esp + 0x30]
mov dword [ebp], ecx
mov eax, dword [esp + 0x1c]
lea edx, [edi + ebp]
sub eax, edi
push 0x4210e8
mov dword [0x421108], edx
mov dword [0x42110c], eax
call fcn.00407a40
mov ebx, eax
test ebx, ebx
mov dword [esp + 0x2c], ebx
jl 0x403d46
call dword [sym.imp.KERNEL32.dll_GetTickCount]
test byte [0x425cb4], 1
mov esi, eax
mov eax, dword [esp + 0x8c]
je 0x403c41
mov ecx, esi
sub ecx, dword [esp + 0x80]
cmp ecx, 0xc8
ja 0x403c04
test eax, eax
jne 0x403c41
mov ecx, dword [esp + 0x28]
push ecx
push 0x64
sub ecx, eax
push ecx
call dword [sym.imp.KERNEL32.dll_MulDiv]
push eax
lea edx, [esp + 0x3c]
push str....__d__
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea ecx, [esp + 0x38]
xor eax, eax
call fcn.00406620
mov eax, dword [esp + 0x8c]
mov dword [esp + 0x80], esi
mov esi, dword [0x421108]
sub esi, ebp
cmp esi, edi
je 0x403d30
mov eax, dword [0x425c2c]
test eax, eax
je 0x403ccc
mov ecx, dword [eax]
mov edi, esi
and edi, 3
sub esi, edi
test esi, esi
mov edx, ebp
mov dword [esp + 0x20], edi
jle 0x403cbc
mov ebx, dword [esp + 0x14]
sub ebx, ebp
lea ebp, [esi - 1]
shr ebp, 2
add ebp, 1
lea esp, [esp]
lea edi, [ebx + edx]
cmp edi, dword [eax + 0x28]
jl 0x403c9b
jmp 0x403c90
mov ecx, dword [eax + 0x18]
add eax, 0x18
cmp edi, dword [eax + 0x28]
jge 0x403c90
add ecx, 0x57a17a25
xor dword [edx], ecx
add edx, 4
sub ebp, 1
jne 0x403c80
mov ebp, dword [esp + 0x18]
mov edi, dword [esp + 0x20]
mov ebx, dword [esp + 0x2c]
mov dword [0x425c2c], eax
test edi, edi
je 0x403cc6
mov edx, dword [edx]
mov dword [esp + 0x30], edx
mov edi, dword [esp + 0x20]
mov dword [eax], ecx
cmp dword [esp + 0x88], 0
jne 0x403d05
mov ecx, dword [esp + 0x84]
push 0
lea eax, [esp + 0x38]
push eax
push esi
push ebp
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x403abf
cmp dword [esp + 0x34], esi
jne 0x403abf
add dword [esp + 0x14], esi
jmp 0x403d19
mov edx, dword [0x421108]
add dword [esp + 0x14], esi
sub dword [esp + 0x1c], esi
mov dword [esp + 0x18], edx
mov ebp, edx
cmp ebx, 1
jne 0x403ba0
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x6c
ret 0x10
test eax, eax
jg 0x403b50
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x6c
ret 0x10
mov eax, 0xfffffffc
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x6c
ret 0x10
mov ecx, dword [esp + 0x88]
test ecx, ecx
jne 0x403e0a
test eax, eax
jle 0x403e44
mov edi, dword [esp + 0x84]
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
lea esp, [esp]
mov esi, dword [esp + 0x1c]
cmp eax, esi
jge 0x403d8a
mov esi, eax
mov ecx, dword [0x40b088]
push 0
lea eax, [esp + 0x8c]
push eax
push esi
push 0x40d0e8
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x403983
cmp dword [esp + 0x88], esi
jne 0x403983
push 0
lea edx, [esp + 0x88]
push edx
push esi
push 0x40d0e8
push edi
call ebx
test eax, eax
je 0x403abf
cmp esi, dword [esp + 0x84]
jne 0x403abf
mov eax, dword [esp + 0x8c]
add dword [esp + 0x14], esi
sub eax, esi
test eax, eax
mov dword [esp + 0x8c], eax
jg 0x403d80
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x6c
ret 0x10
cmp eax, ebx
mov esi, eax
jl 0x403e12
mov esi, ebx
push 0
lea eax, [esp + 0x8c]
push eax
push esi
push ecx
mov ecx, dword [0x40b088]
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x403983
cmp dword [esp + 0x88], esi
jne 0x403983
mov dword [esp + 0x14], esi
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x6c
ret 0x10