Function at 0x1004971
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.01003e65
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call esi
and eax, 0x11
mov ebx, 0x1006030
cmp eax, 0x111
je 0x1004d7a
call esi
mov dword [0x100602c], eax
call fcn.01004312
mov ecx, eax
sub ecx, dword [0x100602c]
push 3
xor edx, edx
mov eax, ecx
pop esi
mov edi, 0xffff8000
div esi
test edi, ecx
jne 0x1004c16
call fcn.0100508f
and dword [esp + 0x494], 0
xor eax, eax
mov word [esp + 0x80], ax
call fcn.01004312
mov ecx, eax
sub ecx, dword [0x100602c]
xor edx, edx
mov eax, ecx
div esi
test edi, ecx
jne 0x1004c16
call fcn.0100429e
mov esi, eax
add esi, 0xfe0
cmp dword [esi], 0x696d7678
jne 0x1004a3c
cmp dword [esi + 4], 0x74636a6e
je 0x1004a61
call fcn.01004003
test eax, eax
je 0x1004f78
cmp eax, 1
jne 0x1004a5f
push esi
call fcn.01004634
pop ecx
test al, al
je 0x1004f78
jmp 0x1004a61
xor esi, esi
xor eax, eax
cmp esi, eax
je 0x1004ab2
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 0x1004e75
push ecx
push ecx
push ecx
push 6
push dword [eax + 0x1c]
call esi
mov dword [esp + 0x3c], eax
test eax, eax
je 0x1004e7f
mov ecx, dword [eax + 0x4c]
add ecx, eax
mov eax, dword [eax + 0x48]
push ecx
lea esi, [esp + 0x84]
call fcn.01005047
jmp 0x1004ad9
push 0x104
lea ecx, [esp + 0x84]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea ecx, [esp + 0x80]
call fcn.01004fda
mov dword [esp + 0x494], eax
call fcn.01004312
mov ecx, eax
sub ecx, dword [0x100602c]
push 3
xor edx, edx
mov eax, ecx
pop esi
div esi
test edi, ecx
jne 0x1004c16
lea eax, [esp + 0x80]
push eax
or edi, 0xffffffff
mov eax, edi
mov esi, ebx
call fcn.01005047
push 0x1001330
mov eax, edi
call fcn.01005047
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 0x1004e89
call fcn.01003f7d
test eax, eax
jne 0x10049c9
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 0x1004e95
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 0x1004e9f
mov edi, eax
call fcn.01003fb6
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 0x1004ea9
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 0x1004eb3
jg 0x1004bd5
mov eax, dword [esp + 0x30]
cmp eax, ecx
jbe 0x1004eb3
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 0x1004ee5
call fcn.01004312
mov ecx, eax
sub ecx, dword [0x100602c]
push 3
xor edx, edx
mov eax, ecx
pop edi
div edi
test ecx, 0xffff8000
je 0x1004c2c
test edx, edx
je 0x1004f42
cmp edx, 1
je 0x10049c9
jmp 0x1004d7a
mov edi, dword [esp + 0xc]
call fcn.01003fb6
add eax, edi
mov ecx, dword [eax]
add eax, esi
cmp ecx, 0x6d7678
jne 0x1004eec
mov ecx, dword [eax]
add eax, esi
cmp ecx, 3
jne 0x1004ef6
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 0x1004f00
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 0x1004f0a
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 0x1004f14
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 0x1004f1b
add eax, edi
mov dword [esp + 0x14], eax
cmp esi, ecx
jbe 0x1004d55
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 0x1004d38
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.01003df0
test eax, eax
jne 0x1004f22
push 4
push 0x1000
push dword [esp + 0x24]
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov esi, eax
call fcn.01004312
mov ecx, eax
sub ecx, dword [0x100602c]
push 3
xor edx, edx
mov eax, ecx
pop edi
div edi
test ecx, 0xffff8000
je 0x1004dbf
test edx, edx
je 0x1004f42
cmp edx, 1
jne 0x1004d7a
jmp 0x10049c9
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.01002f40
pop ecx
cmp eax, 1
jne 0x1004f2c
push dword [esp + 0xc]
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push dword [esp + 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
call fcn.01004312
mov ecx, eax
sub ecx, dword [0x100602c]
push 3
xor edx, edx
mov eax, ecx
pop edi
div edi
test ecx, 0xffff8000
jne 0x1004c16
push esi
call fcn.010043d2
mov dword [esp], 0x8000
push dword [esp + 0x20]
mov edi, eax
push esi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
test edi, edi
je 0x1004f78
push edi
call fcn.010042dc
pop ecx
push edi
call fcn.0100433f
pop ecx
mov dword [esp + 0x2c], eax
test eax, eax
jne 0x1004f36
push 0x1001478
or eax, 0xffffffff
mov esi, ebx
call fcn.01005047
jmp 0x1004f78
push 0x1001308
jmp 0x1004f5f
push 0x100131c
jmp 0x1004f5f
push 0x1001338
mov eax, edi
jmp 0x1004f64
push 0x1001384
jmp 0x1004f61
push 0x1001398
jmp 0x1004f5f
push 0x10013ac
jmp 0x1004f5f
push 0x10013c0
or eax, 0xffffffff
mov esi, ebx
call fcn.01005047
mov eax, dword [esp + 0x30]
push 0xa
mov ecx, ebx
call fcn.01004feb
push 0x1001330
or eax, 0xffffffff
call fcn.01005047
push 0xa
mov eax, edi
jmp 0x1004f71
push 0x10013d4
jmp 0x1004f5f
push 0x10013e8
jmp 0x1004e66
push 0x10013f8
jmp 0x1004e66
push 0x1001408
jmp 0x1004e66
push 0x1001418
jmp 0x1004e66
push 0x1001428
jmp 0x1004f5f
push 0x100143c
jmp 0x1004f5f
push 0x1001450
jmp 0x1004e66
push 0x1001460
jmp 0x1004e66
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 0x1004f9d
push 0x1001488
mov esi, ebx
or eax, 0xffffffff
call fcn.01005047
push 0xa
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, ebx
call fcn.01004feb
push 0x100149c
push 0x10014a8
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push 0x10
push 0x10014c0
push ebx
push 0
call eax
jmp 0x1004fd3
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