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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x48c
xor eax, eax
push ebx
push esi
push edi
mov dword [esp + 0x24], eax
mov dword [esp + 0x3c], eax
mov dword [esp + 0x10], eax
mov dword [esp + 0x18], eax
mov dword [esp + 0xc], eax
mov dword [esp + 0x14], eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x28], eax
call fcn.00403e65
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call esi
and eax, 0x11
mov ebx, 0x406030
cmp eax, 0x111
je 0x404d7a
call esi
mov dword [0x40602c], eax
call fcn.00404312
mov ecx, eax
sub ecx, dword [0x40602c]
push 3
xor edx, edx
mov eax, ecx
pop esi
mov edi, 0xffff8000
div esi
test edi, ecx
jne 0x404c16
call fcn.0040508f
and dword [esp + 0x494], 0
xor eax, eax
mov word [esp + 0x80], ax
call fcn.00404312
mov ecx, eax
sub ecx, dword [0x40602c]
xor edx, edx
mov eax, ecx
div esi
test edi, ecx
jne 0x404c16
call fcn.0040429e
mov esi, eax
add esi, 0xfe0
cmp dword [esi], 0x696d7678
jne 0x404a3c
cmp dword [esi + 4], 0x74636a6e
je 0x404a61
call fcn.00404003
test eax, eax
je 0x404f78
cmp eax, 1
jne 0x404a5f
push esi
call fcn.00404634
pop ecx
test al, al
je 0x404f78
jmp 0x404a61
xor esi, esi
xor eax, eax
cmp esi, eax
je 0x404ab2
push eax
push eax
push eax
push 6
push dword [esi + 0x18]
mov esi, dword [sym.imp.KERNEL32.dll_MapViewOfFile]
call esi
xor ecx, ecx
mov dword [esp + 0x24], eax
cmp eax, ecx
je 0x404e75
push ecx
push ecx
push ecx
push 6
push dword [eax + 0x1c]
call esi
mov dword [esp + 0x3c], eax
test eax, eax
je 0x404e7f
mov ecx, dword [eax + 0x4c]
add ecx, eax
mov eax, dword [eax + 0x48]
push ecx
lea esi, [esp + 0x84]
call fcn.00405047
jmp 0x404ad9
push 0x104
lea ecx, [esp + 0x84]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea ecx, [esp + 0x80]
call fcn.00404fda
mov dword [esp + 0x494], eax
call fcn.00404312
mov ecx, eax
sub ecx, dword [0x40602c]
push 3
xor edx, edx
mov eax, ecx
pop esi
div esi
test edi, ecx
jne 0x404c16
lea eax, [esp + 0x80]
push eax
or edi, 0xffffffff
mov eax, edi
mov esi, ebx
call fcn.00405047
push 0x401330
mov eax, edi
call fcn.00405047
xor eax, eax
push eax
push eax
push 3
push eax
push 7
push 0x80000000
lea eax, [esp + 0x98]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [esp + 0x10], eax
cmp eax, edi
je 0x404e89
call fcn.00403f7d
test eax, eax
jne 0x4049c9
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 + 0x18], eax
cmp eax, edi
je 0x404e95
mov esi, 0x1000
push esi
push edi
push edi
push 4
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [esp + 0xc], eax
cmp eax, edi
je 0x404e9f
mov edi, eax
call fcn.00403fb6
push dword [esp + 0xc]
mov edi, eax
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
lea eax, [esp + 0x30]
push eax
push dword [esp + 0x14]
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
je 0x404ea9
xor eax, eax
push eax
mov ecx, edi
add ecx, esi
mov esi, dword [esp + 0x38]
pop edx
adc eax, edx
cmp esi, eax
jl 0x404eb3
jg 0x404bd5
mov eax, dword [esp + 0x30]
cmp eax, ecx
jbe 0x404eb3
add edi, 0x1000
push edi
push edx
push edx
push 4
pop esi
push esi
push dword [esp + 0x28]
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [esp + 0xc], eax
test eax, eax
je 0x404ee5
call fcn.00404312
mov ecx, eax
sub ecx, dword [0x40602c]
push 3
xor edx, edx
mov eax, ecx
pop edi
div edi
test ecx, 0xffff8000
je 0x404c2c
test edx, edx
je 0x404f42
cmp edx, 1
je 0x4049c9
jmp 0x404d7a
mov edi, dword [esp + 0xc]
call fcn.00403fb6
add eax, edi
mov ecx, dword [eax]
add eax, esi
cmp ecx, 0x6d7678
jne 0x404eec
mov ecx, dword [eax]
add eax, esi
cmp ecx, 3
jne 0x404ef6
mov ecx, dword [eax]
mov edx, ecx
imul edx, edx, 0x8088405
add eax, esi
mov edi, dword [eax]
inc edx
mov dword [esp + 0x14], edi
mov edi, edx
xor edi, ecx
add eax, esi
mov dword [esp + 0x20], edx
cmp edi, dword [esp + 0x14]
jne 0x404f00
mov edi, dword [eax]
mov ecx, edx
imul ecx, ecx, 0x8088405
inc ecx
mov dword [esp + 0x14], edi
mov edi, ecx
xor edi, edx
add eax, esi
cmp edi, dword [esp + 0x14]
jne 0x404f0a
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
mov dword [esp + 0x20], edx
add eax, 8
mov edi, eax
sub edi, dword [esp + 0x10]
mov edx, 0x8088406
sub edx, ecx
xor edx, dword [eax]
add edi, 4
add edx, edi
add edx, esi
mov dword [esp + 0x44], esi
mov dword [esp + 0x48], edx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push dword [esp + 0x18]
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 + 0x18], eax
test eax, eax
je 0x404f14
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 0x404f1b
add eax, edi
mov dword [esp + 0x14], eax
cmp esi, ecx
jbe 0x404d55
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 0x404d38
lea esi, [esp + 0x48]
mov dword [esp + 0x68], ecx
mov dword [esp + 0x6c], ecx
mov dword [esp + 0x70], ecx
mov dword [esp + 0x4c], ecx
mov dword [esp + 0x48], ecx
call fcn.00403df0
test eax, eax
jne 0x404f22
push 4
push 0x1000
push dword [esp + 0x24]
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov esi, eax
call fcn.00404312
mov ecx, eax
sub ecx, dword [0x40602c]
push 3
xor edx, edx
mov eax, ecx
pop edi
div edi
test ecx, 0xffff8000
je 0x404dbf
test edx, edx
je 0x404f42
cmp edx, 1
jne 0x404d7a
jmp 0x4049c9
mov eax, dword [esp + 0x40]
mov dword [esp + 0x4c], eax
mov eax, dword [esp + 0x14]
mov dword [esp + 0x48], eax
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x58], eax
lea eax, [esp + 0x48]
push eax
mov dword [esp + 0x58], esi
call fcn.00402f40
pop ecx
cmp eax, 1
jne 0x404f2c
push dword [esp + 0xc]
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push dword [esp + 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
call fcn.00404312
mov ecx, eax
sub ecx, dword [0x40602c]
push 3
xor edx, edx
mov eax, ecx
pop edi
div edi
test ecx, 0xffff8000
jne 0x404c16
push esi
call fcn.004043d2
mov dword [esp], 0x8000
push dword [esp + 0x20]
mov edi, eax
push esi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
test edi, edi
je 0x404f78
push edi
call fcn.004042dc
pop ecx
push edi
call fcn.0040433f
pop ecx
mov dword [esp + 0x2c], eax
test eax, eax
jne 0x404f36
push 0x401478
or eax, 0xffffffff
mov esi, ebx
call fcn.00405047
jmp 0x404f78
push 0x401308
jmp 0x404f5f
push 0x40131c
jmp 0x404f5f
push 0x401338
mov eax, edi
jmp 0x404f64
push 0x401384
jmp 0x404f61
push 0x401398
jmp 0x404f5f
push 0x4013ac
jmp 0x404f5f
push 0x4013c0
or eax, 0xffffffff
mov esi, ebx
call fcn.00405047
mov eax, dword [esp + 0x30]
push 0xa
mov ecx, ebx
call fcn.00404feb
push 0x401330
or eax, 0xffffffff
call fcn.00405047
push 0xa
mov eax, edi
jmp 0x404f71
push 0x4013d4
jmp 0x404f5f
push 0x4013e8
jmp 0x404e66
push 0x4013f8
jmp 0x404e66
push 0x401408
jmp 0x404e66
push 0x401418
jmp 0x404e66
push 0x401428
jmp 0x404f5f
push 0x40143c
jmp 0x404f5f
push 0x401450
jmp 0x404e66
push 0x401460
jmp 0x404e66
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov dword [esp + 0x28], 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 0x404f9d
push 0x401488
mov esi, ebx
or eax, 0xffffffff
call fcn.00405047
push 0xa
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, ebx
call fcn.00404feb
push 0x40149c
push 0x4014a8
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push 0x10
push 0x4014c0
push ebx
push 0
call eax
jmp 0x404fd3
push dword [esp + 0x10]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [esp + 0x3c]
mov eax, dword [esp + 0x48]
push dword [esp + 0x28]
add eax, 0xffff
shr eax, 0x10
shl eax, 0x10
push eax
push dword [esp + 0x40]
push dword [esp + 0x40]
push esi
push dword [esp + 0x40]
call dword [esp + 0x48]
add esp, 0x1c
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret