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

Disassembly:
sub esp, 0x68
mov eax, dword [0x42419c]
xor eax, esp
mov dword [esp + 0x64], eax
mov eax, dword [esp + 0x6c]
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x80]
mov esi, edx
mov dword [esp + 0x28], ecx
mov dword [esp + 0x2c], edi
mov dword [esp + 0x18], esi
test edi, edi
jne 0x4039f7
mov dword [esp + 0x18], 0x8000
mov dword [esp + 0x14], 0
mov ebp, edi
test edi, edi
jne 0x403a0a
mov ebp, 0x42b948
test eax, eax
jl 0x403a27
mov edx, dword [0x4415f8]
push 0
push 0
add edx, eax
mov eax, dword [0x4255bc]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [0x4255bc]
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
lea ecx, [esp + 0x24]
push ecx
push 4
lea edx, [esp + 0x1c]
push edx
push eax
call ebx
test eax, eax
je 0x403a4e
cmp dword [esp + 0x20], 4
je 0x403a68
pop edi
pop esi
pop ebp
mov eax, 0xfffffffd
pop ebx
mov ecx, dword [esp + 0x64]
xor ecx, esp
call fcn.0040f602
add esp, 0x68
ret 8
mov eax, dword [esp + 0x10]
test eax, eax
jns 0x403c37
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [esp + 0x20], eax
mov eax, 0x80
sub eax, 1
mov byte [eax + 0x43b948], 0
jne 0x403a83
mov eax, 1
mov dword [0x43b9b0], eax
mov dword [0x43b9ac], eax
mov dword [0x43b9a8], eax
mov dword [0x43b9a4], eax
mov eax, dword [esp + 0x10]
and eax, 0x7fffffff
mov dword [0x43b9c0], 0xffffffff
mov dword [esp + 0x10], eax
mov ebx, eax
jle 0x403ce6
cmp eax, 0x4000
mov esi, eax
jl 0x403ad5
mov esi, 0x4000
mov edx, dword [0x4255bc]
push 0
lea ecx, [esp + 0x34]
push ecx
push esi
push 0x427948
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x403a4e
cmp esi, dword [esp + 0x30]
jne 0x403a4e
sub dword [esp + 0x10], esi
mov dword [0x43b960], 0x427948
mov dword [0x43b964], esi
jmp 0x403b20
mov eax, dword [esp + 0x18]
push 0x43b948
mov dword [0x43b968], ebp
mov dword [0x43b96c], eax
call fcn.00403d30
mov dword [esp + 0x1c], eax
test eax, eax
jl 0x403c03
mov esi, dword [0x43b968]
sub esi, ebp
call dword [sym.imp.KERNEL32.dll_GetTickCount]
test byte [0x4436d4], 1
mov edi, eax
mov eax, dword [esp + 0x10]
je 0x403ba9
mov ecx, edi
sub ecx, dword [esp + 0x20]
cmp ecx, 0xc8
ja 0x403b74
test eax, eax
jne 0x403ba9
push ebx
mov edx, ebx
push 0x64
sub edx, eax
push edx
call dword [sym.imp.KERNEL32.dll_MulDiv]
push eax
lea eax, [esp + 0x38]
push str....__d__
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea ecx, [esp + 0x34]
xor eax, eax
call fcn.00407330
mov eax, dword [esp + 0x10]
mov dword [esp + 0x20], edi
test esi, esi
je 0x403bf6
cmp dword [esp + 0x2c], 0
jne 0x403bd8
mov edx, dword [esp + 0x28]
push 0
lea ecx, [esp + 0x28]
push ecx
push esi
push ebp
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x403c1d
cmp dword [esp + 0x24], esi
jne 0x403c1d
add dword [esp + 0x14], esi
jmp 0x403be6
add dword [esp + 0x14], esi
sub dword [esp + 0x18], esi
mov ebp, dword [0x43b968]
cmp dword [esp + 0x1c], 1
jne 0x403b20
jmp 0x403ce6
test eax, eax
jg 0x403ac7
jmp 0x403ce6
pop edi
pop esi
pop ebp
mov eax, 0xfffffffc
pop ebx
mov ecx, dword [esp + 0x64]
xor ecx, esp
call fcn.0040f602
add esp, 0x68
ret 8
pop edi
pop esi
pop ebp
mov eax, 0xfffffffe
pop ebx
mov ecx, dword [esp + 0x64]
xor ecx, esp
call fcn.0040f602
add esp, 0x68
ret 8
test edi, edi
jne 0x403cb8
test eax, eax
jle 0x403ce6
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
lea esp, [esp]
mov esi, dword [esp + 0x18]
cmp eax, esi
jge 0x403c5a
mov esi, eax
mov ecx, dword [0x4255bc]
push 0
lea eax, [esp + 0x20]
push eax
push esi
push 0x427948
push ecx
call ebx
test eax, eax
je 0x403a4e
cmp esi, dword [esp + 0x1c]
jne 0x403a4e
mov eax, dword [esp + 0x28]
push 0
lea edx, [esp + 0x28]
push edx
push esi
push 0x427948
push eax
call edi
test eax, eax
je 0x403c1d
cmp esi, dword [esp + 0x24]
jne 0x403c1d
mov eax, dword [esp + 0x10]
add dword [esp + 0x14], esi
sub eax, esi
mov dword [esp + 0x10], eax
test eax, eax
jg 0x403c50
jmp 0x403ce6
cmp eax, esi
jge 0x403cbe
mov esi, eax
mov edx, dword [0x4255bc]
push 0
lea ecx, [esp + 0x20]
push ecx
push esi
push edi
push edx
call ebx
test eax, eax
je 0x403a4e
cmp esi, dword [esp + 0x1c]
jne 0x403a4e
mov dword [esp + 0x14], esi
mov ecx, dword [esp + 0x74]
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0040f602
add esp, 0x68
ret 8