Function at 0x40ecb4
Capabilities:
Accept command line arguments
Check for time delay via gettickcount
Encode data using xor
Generate random numbers using the delphi lcg
Get file size
Read file via mapping
Terminate process

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x7e8]
sub rsp, 0x8e8
xor edi, edi
mov r14d, edi
mov qword [rsp + 0x68], rdi
mov r15d, edi
mov qword [rsp + 0x50], rdi
mov r12d, edi
mov qword [rsp + 0x48], rdi
mov r13d, edi
mov qword [rsp + 0x60], rdi
mov qword [rbp + 0x848], rdi
call fcn.0040e4f0
call qword [sym.imp.KERNEL32.dll_GetTickCount]
and eax, 0x11
cmp eax, 0x111
je 0x40ed84
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov ebx, dword [rbp + 0x830]
mov dword [rbp + 0x830], ebx
mov dword [0x00413080], eax
mov edi, dword [rbp + 0x830]
mov eax, dword [rbp + 0x830]
mov dword [rbp + 0x840], edi
xor edi, edi
mov dword [rbp + 0x838], eax
call fcn.0040fbcc
mov ecx, eax
mov eax, 0xaaaaaaab
sub ecx, dword [0x00413080]
mul ecx
shr edx, 1
lea eax, [rdx + rdx*2]
mov edx, ecx
sub edx, eax
test ecx, 0xffff8000
je 0x40eeaf
test edx, edx
je 0x40f5d3
cmp edx, 1
je 0x40ed40
mov esi, dword [rbp + 0x838]
mov ebx, dword [rbp + 0x830]
jmp 0x40eda8
mov ebx, dword [rbp + 0x830]
mov dword [rbp + 0x830], ebx
mov esi, dword [rbp + 0x830]
mov eax, dword [rbp + 0x830]
mov dword [rbp + 0x838], esi
mov dword [rbp + 0x840], eax
mov r9d, 4
mov r8d, 0x1000
mov rdx, rbx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov rdi, rax
call fcn.0040fbcc
mov ecx, eax
mov eax, 0xaaaaaaab
sub ecx, dword [0x00413080]
mul ecx
shr edx, 1
lea eax, [rdx + rdx*2]
mov edx, ecx
sub edx, eax
test ecx, 0xffff8000
je 0x40edfc
xor edi, edi
test edx, edx
je 0x40f35a
cmp edx, 1
je 0x40ed40
jmp 0x40eda8
mov rax, qword [rsp + 0x60]
lea rcx, [rbp - 0x80]
mov dword [rbp - 0x78], esi
mov qword [rbp - 0x80], rax
mov eax, dword [rbp + 0x830]
mov qword [rbp - 0x70], rdi
mov dword [rbp - 0x68], eax
call fcn.0040ff10
cmp eax, 1
jne 0x40f671
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_CloseHandle]
call fcn.0040fbcc
mov ecx, eax
mov eax, 0xaaaaaaab
sub ecx, dword [0x00413080]
mul ecx
shr edx, 1
lea eax, [rdx + rdx*2]
mov edx, ecx
sub edx, eax
test ecx, 0xffff8000
jne 0x40ede7
mov rcx, rdi
call fcn.0040ea10
mov edx, dword [rbp + 0x830]
mov r8d, 0x8000
mov rcx, rdi
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_VirtualFree]
test rbx, rbx
je 0x40f67d
mov rcx, rbx
call fcn.0040fb88
mov rcx, rbx
call fcn.0040e948
mov rdi, rax
test rax, rax
jne 0x40f5c6
lea rdx, [0x0040d6d0]
jmp 0x40f678
lea rdx, [0x0040d3d0]
mov dword [0x004134a4], edi
mov word [0x00413090], di
call fcn.0040e804
call fcn.0040fbcc
mov ecx, eax
mov eax, 0xaaaaaaab
sub ecx, dword [0x00413080]
mul ecx
shr edx, 1
lea eax, [rdx + rdx*2]
mov edx, ecx
sub edx, eax
test ecx, 0xffff8000
jne 0x40ed69
mov rax, qword gs:[0x30]
mov rbx, qword [rax + 0x60]
add rbx, 0xfe0
call qword [sym.imp.KERNEL32.dll_GetCommandLineW]
lea rdx, [0x0040d460]
mov rcx, rax
call qword [0x00413010]
test rax, rax
setne r12b
test r12b, r12b
je 0x40ef57
call qword [sym.imp.KERNEL32.dll_GetCommandLineW]
lea rdx, [0x0040d2d8]
mov rcx, rax
call qword [0x00413010]
test rax, rax
je 0x40ef57
mov rcx, rbx
mov r15b, 1
call fcn.0040f7f4
test al, al
je 0x40f67d
jmp 0x40ef80
movabs rax, 0x74636a6e696d7678
mov r15b, dil
cmp qword [rbx], rax
je 0x40ef80
mov rcx, rbx
call fcn.0040f6c4
test eax, eax
je 0x40f67d
cmp eax, 2
cmove rbx, rdi
test rbx, rbx
je 0x40f188
movsxd rcx, dword [rbx + 0x18]
xor r9d, r9d
xor r8d, r8d
lea edx, [r9 + 6]
mov qword [rsp + 0x20], rdi
call qword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov r14, rax
test rax, rax
je 0x40f517
movsxd rcx, dword [rax + 0x1c]
xor r9d, r9d
xor r8d, r8d
lea edx, [r9 + 6]
mov qword [rsp + 0x20], rdi
call qword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov rbx, rax
mov qword [rsp + 0x68], rax
test rax, rax
je 0x40f50b
cmp dword [rax + 0x48], 0x3fc
jae 0x40f4f7
mov r8d, dword [rax + 0x48]
mov edx, dword [rax + 0x4c]
lea rcx, [rbp - 0x18]
add r8, r8
add rdx, rax
call qword [0x00413040]
mov eax, dword [rbx + 0x48]
xor ecx, ecx
mov word [rbp + rax*2 - 0x18], di
mov eax, dword [r14 + 0x40]
mov esi, ecx
test eax, eax
je 0x40f046
cmp dword [r14 + 0x44], ecx
je 0x40f046
lea ebx, [rax + 1]
add rbx, rbx
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rbx
mov rcx, rax
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
xor ecx, ecx
mov rdi, rax
test rax, rax
jne 0x40f04f
lea rdx, [0x0040d4f8]
jmp 0x40f678
test r15b, r15b
jne 0x40f4eb
mov eax, dword [r14 + 0x50]
test eax, eax
je 0x40f08e
cmp dword [r14 + 0x54], ecx
je 0x40f08e
lea ebx, [rax + 1]
add rbx, rbx
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rbx
mov rcx, rax
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
xor r15d, r15d
mov rsi, rax
test rax, rax
jne 0x40f09a
lea rdx, [0x0040d528]
jmp 0x40f678
test r12b, r12b
jne 0x40f4df
xor r15d, r15d
mov rax, qword gs:[0x30]
mov rcx, qword [rax + 0x60]
mov rbx, qword [rcx + 0x20]
test rdi, rdi
je 0x40f0dd
mov r8d, dword [r14 + 0x40]
mov edx, dword [r14 + 0x44]
mov rcx, rdi
add r8, r8
add rdx, r14
call qword [0x00413040]
mov eax, dword [r14 + 0x40]
lea rcx, [rbx + 0x60]
mov rdx, rdi
mov word [rdi + rax*2], r15w
call qword [0x00413060]
xor edi, edi
test rsi, rsi
je 0x40f16d
mov r8d, dword [r14 + 0x50]
mov edx, dword [r14 + 0x54]
mov rcx, rsi
add r8, r8
add rdx, r14
call qword [0x00413040]
mov eax, dword [r14 + 0x50]
mov rdx, rsi
mov word [rsi + rax*2], di
lea rdi, [rbx + 0x70]
mov rcx, rdi
call qword [0x00413060]
call qword [sym.imp.KERNEL32.dll_GetCommandLineW]
mov rdx, rsi
mov rcx, rax
call qword [section..data]
call qword [sym.imp.KERNEL32.dll_GetCommandLineA]
mov rbx, rax
test rax, rax
je 0x40f16b
xor edx, edx
lea rcx, [rsp + 0x70]
lea r8d, [rdx + 0x10]
call qword [0x00413038]
lea rcx, [rsp + 0x70]
mov r8b, 1
mov rdx, rdi
call qword [0x00413058]
test eax, eax
js 0x40f181
mov rdx, qword [rsp + 0x78]
mov rcx, rbx
call qword [0x00413020]
xor edi, edi
cmp word [rbp - 0x18], 0x5c
jne 0x40f1b1
cmp word [rbp - 0x16], 0x5c
jne 0x40f1b1
lea rbx, [rbp - 0x18]
jmp 0x40f1cc
xor edi, edi
mov byte [rbx], dil
jmp 0x40f16d
lea rdx, [rbp - 0x18]
mov r8d, 0x3fc
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
je 0x40f1a5
cmp eax, 0x3fc
jne 0x40f16d
lea rdx, [0x0040d558]
jmp 0x40f609
lea rdx, [0x0040d7b0]
lea rcx, [rbp - 0x20]
mov r8d, 8
call qword [0x00413040]
lea rbx, [rbp - 0x20]
call fcn.0040fbcc
mov r8d, eax
mov eax, 0xaaaaaaab
sub r8d, dword [0x00413080]
mul r8d
mov eax, r8d
shr edx, 1
lea ecx, [rdx + rdx*2]
sub eax, ecx
test r8d, 0xffff8000
je 0x40f210
mov r15, qword [rsp + 0x50]
test eax, eax
je 0x40f5d3
mov r12, qword [rsp + 0x48]
cmp eax, 1
jmp 0x40ed74
mov rdx, rbx
call fcn.0040e804
lea rdx, [0x0040d3c4]
call fcn.0040e804
xor r9d, r9d
mov qword [rsp + 0x30], rdi
lea r8d, [r9 + 7]
mov edx, 0x80000000
mov rcx, rbx
mov dword [rsp + 0x28], edi
mov dword [rsp + 0x20], 3
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov r15, rax
mov qword [rsp + 0x50], rax
cmp rax, 0xffffffffffffffff
je 0x40f5bd
call fcn.0040fbf4
mov r12, qword [rsp + 0x48]
test eax, eax
jne 0x40ed40
xor r9d, r9d
xor edx, edx
mov rcx, r15
lea r8d, [r9 + 2]
mov qword [rsp + 0x28], rdi
mov dword [rsp + 0x20], edi
call qword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov r12, rax
mov qword [rsp + 0x48], rax
test rax, rax
je 0x40f5b4
xor r9d, r9d
mov r13d, 0x1000
xor r8d, r8d
lea esi, [r9 + 4]
mov rcx, rax
mov qword [rsp + 0x20], r13
mov edx, esi
call qword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov rdi, rax
test rax, rax
je 0x40f5ab
mov rcx, rax
call fcn.0040e8f0
mov rcx, rdi
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
lea rdx, [rsp + 0x58]
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
xor edi, edi
test eax, eax
je 0x40f5a2
lea rcx, [rbx + r13]
cmp qword [rsp + 0x58], rcx
jle 0x40f577
lea ecx, [rbx + 0x1000]
xor r9d, r9d
xor r8d, r8d
mov qword [rsp + 0x20], rcx
mov rcx, r12
mov edx, esi
call qword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov r13, rax
test rax, rax
je 0x40f56b
call fcn.0040fbcc
mov r8d, eax
mov eax, 0xaaaaaaab
sub r8d, dword [0x00413080]
mul r8d
shr edx, 1
lea ecx, [rdx + rdx*2]
mov edx, r8d
sub edx, ecx
test r8d, 0xffff8000
je 0x40f35f
test edx, edx
jne 0x40ed71
jmp 0x40f5da
mov rcx, r13
call fcn.0040e8f0
mov r8d, eax
add r8, r13
mov eax, dword [r8]
add r8, rsi
cmp eax, 0x6d7678
jne 0x40f55f
mov eax, dword [r8]
add r8, rsi
cmp eax, 3
jne 0x40f553
mov edx, dword [r8]
add r8, rsi
mov ecx, dword [r8]
mov ebx, edx
add r8, rsi
imul ebx, ebx, 0x8088405
inc ebx
mov eax, ebx
xor eax, edx
cmp eax, ecx
jne 0x40f547
mov ecx, ebx
imul ecx, ecx, 0x8088405
inc ecx
mov eax, ecx
xor eax, ebx
cmp eax, dword [r8]
jne 0x40f53b
mov edi, dword [r8 + 8]
imul ecx, ecx, 0x2b9ad7e7
add r8, 0x10
mov esi, 0x8088406
sub esi, ecx
mov ecx, dword [r8 - 4]
xor edi, esi
imul esi, esi, 0x8088405
inc esi
xor ecx, esi
imul esi, esi, 0x8088405
mov dword [rbp + 0x830], ecx
mov rcx, r13
inc esi
xor esi, dword [r8]
sub r8d, r13d
add r8d, 4
mov dword [rbp + 0x838], esi
add edi, r8d
lea eax, [rdi + rsi]
mov dword [rbp + 0x840], eax
call qword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor r13d, r13d
xor r9d, r9d
lea r8d, [r13 + 8]
xor edx, edx
mov rcx, r15
mov qword [rsp + 0x28], r13
mov dword [rsp + 0x20], r13d
call qword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov r12, rax
mov qword [rsp + 0x48], rax
test rax, rax
je 0x40f52f
mov eax, dword [rbp + 0x840]
lea edx, [r13 + 1]
xor r9d, r9d
xor r8d, r8d
mov rcx, r12
mov qword [rsp + 0x20], rax
call qword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov r13, rax
test rax, rax
je 0x40f523
add rdi, rax
mov qword [rsp + 0x60], rdi
mov rcx, rdi
xor edi, edi
test esi, esi
je 0x40f4af
mov edx, esi
imul ebx, ebx, 0x343fd
add ebx, 0x269ec3
mov eax, ebx
shr eax, 0x10
xor byte [rcx], al
inc rcx
dec rdx
jne 0x40f494
lea rcx, [rbp - 0x80]
mov qword [rbp - 0x50], rdi
mov qword [rbp - 0x48], rdi
mov qword [rbp - 0x40], rdi
mov dword [rbp - 0x78], edi
mov qword [rbp - 0x80], rdi
call fcn.0040fdf0
test eax, eax
je 0x40ed7c
lea rdx, [0x0040d6a8]
jmp 0x40f678
lea rdx, [0x0040d540]
jmp 0x40f678
lea rdx, [0x0040d510]
jmp 0x40f678
lea rdx, [0x0040d4e0]
call fcn.0040e804
mov edx, dword [rbx + 0x48]
jmp 0x40f616
lea rdx, [0x0040d4c8]
jmp 0x40f609
lea rdx, [0x0040d4b0]
jmp 0x40f609
lea rdx, [0x0040d690]
jmp 0x40f609
lea rdx, [0x0040d678]
jmp 0x40f609
lea rdx, [0x0040d668]
jmp 0x40f678
lea rdx, [0x0040d658]
jmp 0x40f678
lea rdx, [0x0040d648]
jmp 0x40f678
lea rdx, [0x0040d638]
jmp 0x40f678
lea rdx, [0x0040d620]
jmp 0x40f609
lea rdx, [0x0040d608]
call fcn.0040e804
mov edx, dword [rsp + 0x58]
mov r8d, 0xa
call fcn.0040e760
lea rdx, [0x0040d3c4]
call fcn.0040e804
mov edx, ebx
jmp 0x40f616
lea rdx, [0x0040d5f0]
jmp 0x40f609
lea rdx, [0x0040d5d8]
jmp 0x40f609
lea rdx, [0x0040d5c0]
jmp 0x40f609
lea rdx, [0x0040d570]
jmp 0x40f609
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov rsi, rax
jmp 0x40f5dd
mov rdi, qword [rbp + 0x848]
mov rsi, rdi
xor eax, eax
xor r9d, r9d
xor edx, edx
mov qword [rsp + 0x28], rax
lea r8d, [rax + 2]
mov rcx, r15
mov dword [rsp + 0x20], eax
call qword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov rbx, rax
test rax, rax
jne 0x40f623
lea rdx, [0x0040d6e0]
call fcn.0040e804
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
mov r8d, 0xa
call fcn.0040e760
jmp 0x40f67d
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov r9d, dword [rbp + 0x840]
mov rax, qword [rsp + 0x68]
mov r8, qword [rsp + 0x58]
add r9d, 0xffff
mov qword [rsp + 0x28], rax
and r9d, 0xffff0000
mov rdx, rbx
mov rcx, rsi
mov qword [rsp + 0x20], r14
call rdi
add rsp, 0x8e8
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret
lea rdx, [0x0040d6b8]
call fcn.0040e804
lea rcx, [0x0040d708]
call qword [sym.imp.KERNEL32.dll_LoadLibraryW]
lea rdx, [0x0040d6f8]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea r8, [0x0040d720]
lea rdx, [0x00413090]
mov r9d, 0x10
xor ecx, ecx
call rax
or ecx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_ExitProcess]