Function at 0x404067
Capabilities:
Check for time delay via gettickcount
Encode data using xor
Generate random numbers using the delphi lcg
Get file size
Get system information on windows
Read file via mapping

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x8fc
xor eax, eax
push ebx
push esi
push edi
mov dword [esp + 0x30], eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], eax
mov dword [esp + 0xc], eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x24], eax
call fcn.00403c35
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call esi
and eax, 0x11
cmp eax, 0x111
je 0x404455
call esi
mov ebx, dword [esp + 0x18]
mov dword [0x40500c], eax
call fcn.00403d2a
mov ecx, eax
sub ecx, dword [0x40500c]
push 3
xor edx, edx
mov eax, ecx
pop esi
mov edi, 0xffff8000
div esi
test edi, ecx
jne 0x4042f7
and dword [esp + 0x904], 0
xor eax, eax
and dword [esp + 0x4c4], eax
mov word [esp + 0x4f0], ax
mov word [esp + 0xb0], ax
call fcn.00403d2a
mov ecx, eax
sub ecx, dword [0x40500c]
xor edx, edx
mov eax, ecx
div esi
test edi, ecx
jne 0x4042f7
lea eax, [esp + 0x4cc]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemInfo]
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
add eax, 0xfe0
cmp dword [eax], 0x696d7678
jne 0x40414a
cmp dword [eax + 4], 0x74636a6e
je 0x40414c
xor eax, eax
xor ecx, ecx
cmp eax, ecx
je 0x40419d
mov esi, dword [sym.imp.KERNEL32.dll_MapViewOfFile]
push ecx
push ecx
push ecx
push 6
push dword [eax + 0x18]
call esi
xor ecx, ecx
mov dword [esp + 0x30], eax
cmp eax, ecx
je 0x40454f
push ecx
push ecx
push ecx
push 6
push dword [eax + 0x1c]
call esi
mov dword [esp + 0x2c], eax
test eax, eax
je 0x40455f
mov ecx, dword [eax + 0x4c]
add ecx, eax
mov eax, dword [eax + 0x48]
push ecx
lea esi, [esp + 0x4f4]
call fcn.0040478f
jmp 0x4041c4
push 0x104
lea eax, [esp + 0x4f4]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea ecx, [esp + 0x4f0]
call fcn.00404715
mov dword [esp + 0x904], eax
call fcn.00403d2a
mov ecx, eax
sub ecx, dword [0x40500c]
push 3
xor edx, edx
mov eax, ecx
pop esi
div esi
test edi, ecx
jne 0x4042f7
lea eax, [esp + 0x4f0]
push eax
or edi, 0xffffffff
mov eax, edi
lea esi, [esp + 0xb4]
call fcn.0040478f
push 0x401194
mov eax, edi
call fcn.0040478f
xor eax, eax
push eax
push eax
push 3
push eax
push 7
push 0x80000000
lea eax, [esp + 0x508]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [esp + 0x10], eax
cmp eax, edi
je 0x40456f
call fcn.00403c6e
test eax, eax
jne 0x4040be
xor edi, edi
push edi
push edi
push edi
push 2
push edi
push dword [esp + 0x24]
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov dword [esp + 0x14], eax
cmp eax, edi
je 0x4045a4
mov esi, dword [sym.imp.KERNEL32.dll_MapViewOfFile]
push 0x1000
push edi
push edi
push 4
push eax
call esi
mov dword [esp + 0xc], eax
cmp eax, edi
je 0x4045b4
mov edi, eax
call fcn.00403ca7
push dword [esp + 0xc]
mov edi, eax
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
lea eax, [esp + 0x7c]
push eax
push dword [esp + 0x14]
call dword [sym.imp.KERNEL32.dll_GetFileInformationByHandle]
test eax, eax
je 0x4045c4
xor eax, eax
cmp dword [esp + 0x9c], eax
jne 0x4042ba
cmp dword [esp + 0xa0], edi
jbe 0x40470e
add edi, 0x1000
push edi
push eax
push eax
push 4
push dword [esp + 0x24]
call esi
mov edi, eax
mov dword [esp + 0xc], edi
test edi, edi
je 0x4045d4
call fcn.00403d2a
mov ecx, eax
sub ecx, dword [0x40500c]
push 3
xor edx, edx
mov eax, ecx
pop esi
div esi
test ecx, 0xffff8000
je 0x40430d
test edx, edx
je 0x40464f
cmp edx, 1
je 0x4040be
jmp 0x404459
call fcn.00403ca7
add eax, edi
mov ecx, dword [eax]
push 4
pop esi
add eax, esi
cmp ecx, 0x6d7678
jne 0x4045e4
mov ecx, dword [eax]
add eax, esi
cmp ecx, 3
jne 0x4045f3
mov ecx, dword [eax]
mov edx, ecx
imul edx, edx, 0x8088405
add eax, esi
mov edi, dword [eax]
inc edx
mov ebx, edx
xor ebx, ecx
add eax, esi
mov dword [esp + 0x20], edx
cmp ebx, edi
jne 0x404602
mov edi, dword [eax]
mov ecx, edx
imul ecx, ecx, 0x8088405
inc ecx
mov ebx, ecx
xor ebx, edx
add eax, esi
cmp ebx, edi
jne 0x404611
mov edx, dword [eax]
imul ecx, ecx, 0x8088405
inc ecx
xor edx, ecx
imul ecx, ecx, 0x8088405
push dword [esp + 0xc]
add eax, esi
mov esi, dword [eax]
inc ecx
xor esi, ecx
imul ecx, ecx, 0x2b9ad7e7
add eax, 8
mov edi, eax
sub edi, dword [esp + 0x10]
mov ebx, 0x8088406
sub ebx, ecx
xor ebx, dword [eax]
add edi, 4
add ebx, edi
mov dword [esp + 0x20], edx
mov dword [esp + 0x38], esi
add ebx, esi
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push dword [esp + 0x14]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
push eax
push eax
push eax
push 8
push eax
push dword [esp + 0x24]
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov dword [esp + 0x14], eax
test eax, eax
je 0x40461d
lea ecx, [edi + esi]
push ecx
push 0
push 0
push 1
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
xor ecx, ecx
mov dword [esp + 0xc], eax
cmp eax, ecx
je 0x40462a
add eax, edi
mov dword [esp + 0x28], eax
cmp esi, ecx
jbe 0x404425
mov edx, dword [esp + 0x20]
imul edx, edx, 0x343fd
add edx, 0x269ec3
mov dword [esp + 0x20], edx
shr edx, 0x10
xor byte [eax], dl
inc eax
dec esi
jne 0x404408
lea esi, [esp + 0x44]
mov dword [esp + 0x64], ecx
mov dword [esp + 0x68], ecx
mov dword [esp + 0x6c], ecx
mov dword [esp + 0x48], ecx
mov dword [esp + 0x44], ecx
call fcn.00403bc0
test eax, eax
je 0x404459
call fcn.004047d2
push 0x4012a0
jmp 0x404696
mov ebx, dword [esp + 0x18]
push 4
push 0x1000
push dword [esp + 0x24]
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov esi, eax
call fcn.00403d2a
mov ecx, eax
sub ecx, dword [0x40500c]
push 3
xor edx, edx
mov eax, ecx
pop edi
div edi
test ecx, 0xffff8000
je 0x40449e
test edx, edx
je 0x40464f
cmp edx, 1
jne 0x404459
jmp 0x4040be
mov eax, dword [esp + 0x34]
mov dword [esp + 0x48], eax
mov eax, dword [esp + 0x28]
mov dword [esp + 0x44], eax
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x54], eax
lea eax, [esp + 0x44]
push eax
mov dword [esp + 0x54], esi
call fcn.00402d10
pop ecx
cmp eax, 1
jne 0x404637
push dword [esp + 0xc]
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push dword [esp + 0x14]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
call fcn.00403d2a
mov ecx, eax
sub ecx, dword [0x40500c]
push 3
xor edx, edx
mov eax, ecx
pop edi
div edi
test ecx, 0xffff8000
jne 0x4042f7
push esi
call fcn.00403def
mov dword [esp], 0x8000
push dword [esp + 0x20]
mov edi, eax
push esi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
test edi, edi
je 0x4046a3
push edi
call fcn.00403cf4
pop ecx
push edi
call fcn.00403d57
pop ecx
mov dword [esp + 0x18], eax
test eax, eax
jne 0x404643
call fcn.004047d2
push 0x4012c8
jmp 0x404696
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x4010d8
jmp 0x404672
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x401180
jmp 0x404672
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
push 0x40119c
mov eax, edi
lea esi, [esp + 0xb4]
call fcn.0040478f
push 0xa
mov eax, ebx
mov ecx, esi
call fcn.00404726
call fcn.004047d2
mov eax, esi
push eax
mov eax, edi
jmp 0x404699
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x4011e8
jmp 0x404672
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x4011fc
jmp 0x404672
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x401210
jmp 0x404672
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x401224
jmp 0x404672
call fcn.004047d2
push 0x401238
jmp 0x404696
call fcn.004047d2
push 0x401248
jmp 0x404696
call fcn.004047d2
push 0x401258
jmp 0x404696
call fcn.004047d2
push 0x401268
jmp 0x404696
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x401278
jmp 0x404672
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x40128c
jmp 0x404672
call fcn.004047d2
push 0x4012b0
jmp 0x404696
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov dword [esp + 0x24], eax
xor edi, edi
push edi
push edi
push edi
push 2
push edi
push dword [esp + 0x24]
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov esi, eax
cmp esi, edi
jne 0x4046cc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x4012d8
mov edi, eax
or eax, 0xffffffff
lea esi, [esp + 0xb4]
call fcn.0040478f
push 0xa
mov eax, edi
mov ecx, esi
call fcn.00404726
call fcn.004047d2
mov eax, esi
push eax
or eax, 0xffffffff
mov esi, 0x405010
call fcn.0040478f
push 0x4012ec
push 0x4012f8
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push 0x10
push 0x401310
push 0x405010
push 0
call eax
jmp 0x40470e
lea eax, [esp + 0x38]
push eax
push dword [esp + 0x14]
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
push dword [esp + 0x10]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [esp + 0x2c]
add ebx, 0xffff
push dword [esp + 0x34]
shr ebx, 0x10
shl ebx, 0x10
push ebx
push dword [esp + 0x48]
push dword [esp + 0x48]
push esi
push dword [esp + 0x3c]
call dword [esp + 0x34]
add esp, 0x1c
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret