Function at 0x402dfc
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
Set environment variable
Terminate process

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x808]
sub rsp, 0x908
xor edi, edi
xor ecx, ecx
mov r15d, ecx
mov qword [rsp + 0x68], rcx
mov qword [rsp + 0x60], rcx
mov r14d, edi
mov qword [rsp + 0x50], rdi
mov r13d, edi
mov r12d, edi
mov qword [rbp + 0x868], rdi
mov qword [rsp + 0x40], rdi
call fcn.00402494
mov rax, qword gs:[0x30]
mov rcx, qword [rax + 0x60]
mov rcx, qword [rcx + 0x110]
call qword [0x00407058]
call qword [sym.imp.KERNEL32.dll_GetTickCount]
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov ebx, dword [rbp + 0x850]
mov dword [0x00407080], eax
call qword [sym.imp.KERNEL32.dll_GetTickCount]
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, eax
sub ecx, dword [0x00407080]
cmp ecx, 0x8000
jb 0x402eb2
mov eax, 0xaaaaaaab
mul ecx
shr edx, 1
lea eax, [rdx + rdx*2]
sub ecx, eax
je 0x403802
cmp ecx, 1
jmp 0x4033cb
lea rcx, [0x00407090]
call fcn.004029a4
call fcn.00402940
lea rcx, [rsp + 0x70]
call fcn.004029a4
call qword [sym.imp.KERNEL32.dll_GetTickCount]
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, eax
sub ecx, dword [0x00407080]
cmp ecx, 0x8000
jae 0x402e96
mov rax, qword gs:[0x30]
mov rbx, qword [rax + 0x60]
add rbx, 0xfe0
call qword [sym.imp.KERNEL32.dll_GetCommandLineW]
mov rcx, rax
lea rdx, [0x00401320]
call qword [0x00407010]
test rax, rax
setne r12b
test rax, rax
je 0x402f4f
call qword [sym.imp.KERNEL32.dll_GetCommandLineW]
mov rcx, rax
lea rdx, [0x00401190]
call qword [0x00407010]
test rax, rax
je 0x402f4f
mov rcx, rbx
mov r14b, 1
call fcn.00403aec
test al, al
je 0x40394f
jmp 0x402f7a
movabs rax, 0x74636a6e696d7678
mov r14b, dil
cmp qword [rbx], rax
je 0x402f7a
mov rcx, rbx
call fcn.004039a8
test eax, eax
je 0x40394f
cmp eax, 2
je 0x4031b6
test rbx, rbx
je 0x4031b6
movsxd rcx, dword [rbx + 0x18]
xor r9d, r9d
xor r8d, r8d
mov qword [rsp + 0x20], rdi
lea edx, [r9 + 6]
call qword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov r15, rax
test rax, rax
je 0x403696
movsxd rcx, dword [rax + 0x1c]
xor r9d, r9d
xor r8d, r8d
mov qword [rsp + 0x20], rdi
lea edx, [r9 + 6]
call qword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov qword [rsp + 0x68], rax
mov rbx, rax
test rax, rax
je 0x40368a
cmp dword [rax + 0x48], 0x3fc
jae 0x40366b
mov r8d, dword [rax + 0x48]
lea rcx, [rbp + 8]
mov edx, dword [rax + 0x4c]
add r8, r8
add rdx, rax
call qword [0x00407038]
mov eax, dword [rbx + 0x48]
lea r8, [r15 + 0x43c8]
mov ecx, 0x10
mov word [rbp + rax*2 + 8], di
lea rax, [0x004016b0]
cmp dword [r15], ecx
cmovb ecx, dword [r15]
mov eax, dword [rax + rcx*4]
add rax, r15
cmp r8, rax
ja 0x40303a
mov edx, dword [r15 + 0x43cc]
lea rcx, [rsp + 0x70]
mov r8d, dword [r8]
add rdx, r15
call fcn.004028ac
mov eax, dword [r15 + 0x40]
xor ecx, ecx
mov esi, ecx
test eax, eax
je 0x40308c
cmp dword [r15 + 0x44], ecx
je 0x40308c
lea ebx, [rax + 1]
add rbx, rbx
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rbx
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
xor ecx, ecx
mov rdi, rax
test rax, rax
jne 0x403095
lea rdx, [0x004013b8]
or r8d, 0xffffffff
lea rcx, [0x00407090]
call fcn.004028ac
jmp 0x40394f
test r14b, r14b
jne 0x40365f
mov eax, dword [r15 + 0x50]
test eax, eax
je 0x4030d1
cmp dword [r15 + 0x54], ecx
je 0x4030d1
lea ebx, [rax + 1]
add rbx, rbx
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rbx
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
xor r14d, r14d
mov rsi, rax
test rax, rax
jne 0x4030dd
lea rdx, [0x004013e8]
jmp 0x403077
test r12b, r12b
jne 0x403653
xor r14d, r14d
mov rax, qword gs:[0x30]
mov rcx, qword [rax + 0x60]
mov rbx, qword [rcx + 0x20]
test rdi, rdi
je 0x403120
mov r8d, dword [r15 + 0x40]
mov rcx, rdi
mov edx, dword [r15 + 0x44]
add r8, r8
add rdx, r15
call qword [0x00407038]
mov eax, dword [r15 + 0x40]
lea rcx, [rbx + 0x60]
mov rdx, rdi
mov word [rdi + rax*2], r14w
call qword [0x00407068]
xor edi, edi
test rsi, rsi
je 0x4031db
mov r8d, dword [r15 + 0x50]
mov rcx, rsi
mov edx, dword [r15 + 0x54]
add r8, r8
add rdx, r15
call qword [0x00407038]
mov eax, dword [r15 + 0x50]
mov rdx, rsi
mov word [rsi + rax*2], di
lea rdi, [rbx + 0x70]
mov rcx, rdi
call qword [0x00407068]
call qword [sym.imp.KERNEL32.dll_GetCommandLineW]
mov rcx, rax
mov rdx, rsi
call qword [section..data]
call qword [sym.imp.KERNEL32.dll_GetCommandLineA]
mov rbx, rax
test rax, rax
je 0x4031ab
xor edx, edx
lea rcx, [rbp - 0x80]
lea r8d, [rdx + 0x10]
call qword [0x00407030]
mov r8b, 1
lea rcx, [rbp - 0x80]
mov rdx, rdi
call qword [0x00407060]
test eax, eax
js 0x4031af
mov rdx, qword [rbp - 0x78]
mov rcx, rbx
call qword [0x00407018]
xor edi, edi
jmp 0x4031db
xor edi, edi
mov byte [rbx], dil
jmp 0x4031db
mov r8d, 0x3fc
lea rdx, [rbp + 8]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
je 0x403925
cmp eax, 0x3fc
je 0x403925
cmp word [rbp + 8], 0x5c
jne 0x4031ef
cmp word [rbp + 0xa], 0x5c
jne 0x4031ef
lea rbx, [rbp + 8]
jmp 0x40320a
mov r8d, 8
lea rdx, [0x004016a0]
lea rcx, [rbp]
call qword [0x00407038]
lea rbx, [rbp]
call qword [sym.imp.KERNEL32.dll_GetTickCount]
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov r8d, eax
sub r8d, dword [0x00407080]
cmp r8d, 0x8000
jb 0x403249
mov eax, 0xaaaaaaab
mul r8d
shr edx, 1
lea ecx, [rdx + rdx*2]
sub r8d, ecx
je 0x403802
mov r14, qword [rsp + 0x50]
jmp 0x4033ba
or esi, 0xffffffff
lea rcx, [0x00407090]
mov r8d, esi
mov rdx, rbx
call fcn.004028ac
mov r8d, esi
lea rdx, [0x0040127c]
lea rcx, [0x00407090]
call fcn.004028ac
xor r9d, r9d
mov qword [rsp + 0x30], rdi
mov dword [rsp + 0x28], edi
mov edx, 0x80000000
mov rcx, rbx
mov dword [rsp + 0x20], 3
lea r8d, [r9 + 7]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov qword [rsp + 0x60], rax
mov rsi, rax
cmp rax, 0xffffffffffffffff
je 0x40391c
call fcn.00403ebc
mov r14, qword [rsp + 0x50]
mov r12, qword [rbp + 0x868]
mov ebx, dword [rbp + 0x850]
test eax, eax
jne 0x402e7a
xor r9d, r9d
mov qword [rsp + 0x28], rdi
xor edx, edx
mov dword [rsp + 0x20], edi
mov rcx, rsi
lea r8d, [r9 + 2]
call qword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov qword [rsp + 0x50], rax
mov r14, rax
test rax, rax
je 0x403913
xor r9d, r9d
mov r13d, 0x1000
xor r8d, r8d
mov qword [rsp + 0x20], r13
mov rcx, rax
lea r12d, [r9 + 4]
mov edx, r12d
call qword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov r11, rax
test rax, rax
je 0x40390a
mov rcx, rax
call fcn.00402a1c
mov rcx, r11
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
lea rdx, [rsp + 0x58]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
je 0x403901
lea rcx, [rbx + r13]
cmp qword [rsp + 0x58], rcx
jle 0x4038cf
lea ecx, [rbx + 0x1000]
xor r9d, r9d
mov qword [rsp + 0x20], rcx
xor r8d, r8d
mov rcx, r14
mov edx, r12d
call qword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov r13, rax
test rax, rax
je 0x4038c6
call qword [sym.imp.KERNEL32.dll_GetTickCount]
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov r8d, eax
sub r8d, dword [0x00407080]
cmp r8d, 0x8000
jb 0x4033d6
mov eax, 0xaaaaaaab
mul r8d
shr edx, 1
lea ecx, [rdx + rdx*2]
sub r8d, ecx
je 0x403802
mov r12, qword [rbp + 0x868]
cmp r8d, 1
mov ebx, dword [rbp + 0x850]
je 0x402e7a
jmp 0x403567
mov rcx, r13
call fcn.00402a1c
mov r11d, eax
add r11, r13
mov eax, dword [r11]
add r11, r12
cmp eax, 0x6d7678
jne 0x4038ba
mov eax, dword [r11]
add r11, r12
cmp eax, 3
jne 0x4038ae
mov edx, dword [r11]
add r11, r12
imul ebx, edx, 0x8088405
mov ecx, dword [r11]
add r11, r12
inc ebx
mov eax, ebx
xor eax, edx
cmp eax, ecx
jne 0x4038a2
imul ecx, ebx, 0x8088405
inc ecx
mov eax, ecx
xor eax, ebx
cmp eax, dword [r11]
jne 0x403896
imul eax, ecx, 0x2b9ad7e7
add r11, 8
mov ecx, 0x8088406
sub ecx, eax
imul eax, ecx, 0x8088405
mov edi, ecx
xor edi, dword [r11]
add r11, r12
inc eax
mov ecx, eax
imul eax, eax, 0x8088405
xor ecx, dword [r11]
add r11, r12
mov dword [rbp + 0x850], ecx
mov rcx, r13
inc eax
xor eax, dword [r11]
sub r11d, r13d
add r11d, r12d
mov dword [rbp + 0x858], eax
add edi, r11d
lea r12d, [rdi + rax]
mov dword [rbp + 0x860], r12d
call qword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor r14d, r14d
cmp dword [rsp + 0x78], r14d
jne 0x403750
mov qword [rsp + 0x28], r14
lea r8d, [r14 + 8]
xor r9d, r9d
mov dword [rsp + 0x20], r14d
xor edx, edx
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov qword [rsp + 0x50], rax
mov r14, rax
test rax, rax
je 0x403744
xor r9d, r9d
mov eax, r12d
xor r8d, r8d
mov qword [rsp + 0x20], rax
mov rcx, r14
lea edx, [r9 + 1]
call qword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov r13, rax
test rax, rax
je 0x403738
mov r12d, edi
xor edi, edi
add r12, rax
mov eax, dword [rbp + 0x858]
mov qword [rbp + 0x868], r12
mov rcx, r12
test eax, eax
je 0x40353b
mov edx, eax
imul ebx, ebx, 0x343fd
add ebx, 0x269ec3
mov eax, ebx
shr eax, 0x10
xor byte [rcx], al
inc rcx
sub rdx, 1
jne 0x40351f
lea rcx, [rbp - 0x60]
mov qword [rbp - 0x30], rdi
mov qword [rbp - 0x28], rdi
mov qword [rbp - 0x20], rdi
mov dword [rbp - 0x58], edi
mov qword [rbp - 0x60], rdi
call fcn.00404270
mov ebx, eax
test eax, eax
jne 0x40372f
mov ebx, dword [rbp + 0x850]
mov esi, ebx
mov r9d, 4
mov r8d, 0x1000
mov rdx, rsi
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov rdi, rax
call qword [sym.imp.KERNEL32.dll_GetTickCount]
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov r8d, eax
sub r8d, dword [0x00407080]
cmp r8d, 0x8000
jb 0x4035c9
mov eax, 0xaaaaaaab
mul r8d
shr edx, 1
lea ecx, [rdx + rdx*2]
sub r8d, ecx
je 0x403802
mov edi, 0
cmp r8d, 1
je 0x402e7a
jmp 0x403569
mov eax, dword [rbp + 0x858]
lea rcx, [rbp - 0x60]
mov edx, 4
mov dword [rbp - 0x58], eax
mov qword [rbp - 0x60], r12
mov dword [rbp - 0x48], ebx
mov qword [rbp - 0x50], rdi
call fcn.00404390
mov ebx, eax
cmp eax, 1
jne 0x403711
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_CloseHandle]
call qword [sym.imp.KERNEL32.dll_GetTickCount]
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov r8d, eax
sub r8d, dword [0x00407080]
cmp r8d, 0x8000
jb 0x4036a2
mov eax, 0xaaaaaaab
mul r8d
shr edx, 1
lea ecx, [rdx + rdx*2]
sub r8d, ecx
je 0x403802
cmp r8d, ebx
mov ebx, dword [rbp + 0x850]
jne 0x403569
xor edi, edi
jmp 0x402e7a
lea rdx, [0x00401400]
jmp 0x403077
lea rdx, [0x004013d0]
jmp 0x403077
or r8d, 0xffffffff
lea rdx, [0x004013a0]
lea rcx, [0x00407090]
call fcn.004028ac
mov edx, dword [rbx + 0x48]
jmp 0x403944
lea rdx, [0x00401388]
jmp 0x40392c
lea rdx, [0x00401370]
jmp 0x40392c
mov rcx, rdi
call fcn.00402b34
mov rbx, rax
test rax, rax
je 0x40394f
mov edx, dword [rbp + 0x850]
mov r8d, 0x8000
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_VirtualFree]
lea rcx, [rbp - 0x70]
call fcn.004029a4
mov rdx, rbx
lea rcx, [rbp - 0x70]
call fcn.00402738
mov rdx, qword [rbp - 0x70]
lea rcx, [0x004015a8]
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
mov rcx, rbx
call fcn.00402a68
mov rsi, rax
test rax, rax
jne 0x4037f5
lea rdx, [0x004015c0]
jmp 0x403077
lea rdx, [0x00401578]
or r8d, 0xffffffff
lea rcx, [0x00407090]
call fcn.004028ac
mov edx, ebx
jmp 0x403944
lea rdx, [0x00401568]
jmp 0x403718
lea rdx, [0x00401550]
jmp 0x40392c
lea rdx, [0x00401538]
jmp 0x40392c
mov rax, qword gs:[0x30]
mov rcx, qword [rax + 0x60]
mov rcx, qword [rcx + 0x110]
call qword [0x00407050]
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rcx, qword gs:[0x30]
mov edi, eax
mov rcx, qword [rcx + 0x60]
mov rcx, qword [rcx + 0x110]
call qword [0x00407058]
test rbx, rbx
jne 0x4036cb
or r8d, 0xffffffff
lea rdx, [0x00401588]
lea rcx, [0x00407090]
call fcn.004028ac
lea rcx, [rsp + 0x70]
call fcn.00402440
mov rdx, rax
lea rcx, [0x00407090]
or r8d, 0xffffffff
call fcn.004028ac
or r8d, 0xffffffff
lea rdx, [0x004015a0]
lea rcx, [0x00407090]
call fcn.004028ac
mov edx, edi
jmp 0x403944
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov r14, rax
jmp 0x40380a
mov rsi, qword [rsp + 0x40]
mov r14, rsi
mov rdi, qword [rsp + 0x60]
xor r12d, r12d
mov qword [rsp + 0x28], r12
xor r9d, r9d
xor edx, edx
mov dword [rsp + 0x20], r12d
mov rcx, rdi
lea r8d, [r12 + 2]
call qword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov rbx, rax
test rax, rax
jne 0x403843
lea rdx, [0x004015d0]
jmp 0x40392c
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
call fcn.00402970
mov r9d, dword [rbp + 0x860]
mov rdx, rbx
mov rax, qword [rsp + 0x68]
add r9d, 0xffff
mov r8, qword [rsp + 0x58]
and r9d, 0xffff0000
mov qword [rsp + 0x28], rax
mov rcx, r14
mov qword [rsp + 0x20], r15
call rsi
add rsp, 0x908
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret
lea rdx, [0x00401528]
jmp 0x403077
lea rdx, [0x00401518]
jmp 0x403077
lea rdx, [0x00401508]
jmp 0x403077
lea rdx, [0x004014f8]
jmp 0x403077
lea rdx, [0x004014e0]
jmp 0x40392c
or r8d, 0xffffffff
lea rdx, [0x004014c8]
lea rcx, [0x00407090]
call fcn.004028ac
mov edx, dword [rsp + 0x58]
mov r8d, 0xa
call fcn.004027dc
lea rdx, [0x0040127c]
jmp 0x403718
lea rdx, [0x004014b0]
jmp 0x40392c
lea rdx, [0x00401498]
jmp 0x40392c
lea rdx, [0x00401480]
jmp 0x40392c
lea rdx, [0x00401430]
jmp 0x40392c
lea rdx, [0x00401418]
or r8d, 0xffffffff
lea rcx, [0x00407090]
call fcn.004028ac
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
mov r8d, 0xa
call fcn.004027dc
lea rcx, [0x004015f8]
call qword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov rcx, rax
lea rdx, [0x004015e8]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rcx, [0x00407090]
mov r10, rax
call fcn.00402440
mov rdx, rax
lea r8, [0x00401610]
mov r9d, 0x10
xor ecx, ecx
call r10
call fcn.00402970
or ecx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_ExitProcess]