Function at 0x404229
Capabilities:
Encode data using xor
Generate random numbers using the delphi lcg
Read file via mapping

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xca4
push ebx
push esi
push edi
call fcn.00403da5
call dword [sym.imp.KERNEL32.dll_GetTickCount]
and eax, 0x11
xor ebx, ebx
cmp eax, 0x111
je 0x404598
lea eax, [esp + 0x28]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
call fcn.00403e46
pop ecx
call fcn.00403ec1
mov ecx, eax
sub ecx, dword [0x40500c]
push 3
xor edx, edx
mov eax, ecx
pop esi
mov edi, 0xffff8000
div esi
test edi, ecx
jne 0x40447b
mov dword [esp + 0x894], ebx
mov word [esp + 0x480], bx
mov dword [esp + 0x47c], ebx
mov word [esp + 0x68], bx
call fcn.00403ec1
mov ecx, eax
sub ecx, dword [0x40500c]
xor edx, edx
mov eax, ecx
div esi
test edi, ecx
jne 0x40447b
push 0x401094
lea eax, [esp + 0x89c]
call fcn.004048e4
push 0x10
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
lea ecx, [esp + 0x89c]
call fcn.0040482c
push 0x4010ac
mov esi, ecx
call fcn.00404890
mov eax, dword [esp + 0x28]
push 0x10
mov ecx, esi
call fcn.0040482c
mov eax, esi
push eax
push ebx
push 4
call dword [sym.imp.KERNEL32.dll_OpenFileMappingW]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp esi, ebx
mov dword [esp + 0x2c], eax
je 0x404353
push ebx
push ebx
push ebx
push 4
push esi
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov edi, eax
cmp edi, ebx
je 0x40467f
lea eax, [edi + 4]
push eax
lea eax, [esp + 0x484]
call fcn.004048c9
push edi
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, 0xffff8000
jmp 0x404383
cmp eax, 2
jne 0x4047b6
push 0x104
lea eax, [esp + 0x484]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea ecx, [esp + 0x480]
call fcn.0040481b
mov dword [esp + 0x894], eax
call fcn.00403ec1
mov ecx, eax
sub ecx, dword [0x40500c]
push 3
xor edx, edx
mov eax, ecx
pop esi
div esi
test edi, ecx
jne 0x40447b
lea eax, [esp + 0x480]
push eax
lea esi, [esp + 0x6c]
call fcn.00404890
push 0x40116c
call fcn.00404890
push ebx
push ebx
push 3
push ebx
push 7
push 0x80000000
lea eax, [esp + 0x498]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [esp + 0x10], eax
je 0x40469c
call fcn.00403e10
test eax, eax
jne 0x404253
push ebx
push ebx
push ebx
push 2
push ebx
push dword [esp + 0x24]
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
cmp eax, ebx
mov dword [esp + 0x18], eax
je 0x4046a9
push 0x1000
push ebx
push ebx
push 4
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov esi, eax
cmp esi, ebx
je 0x4046b6
mov edi, esi
call fcn.00403dde
mov edi, eax
push esi
mov esi, dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov dword [esp + 0x28], edi
call esi
add edi, 0x1000
push edi
push ebx
push ebx
push 4
push dword [esp + 0x28]
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
cmp eax, ebx
mov dword [esp + 0x1c], eax
je 0x4046c3
call fcn.00403ec1
mov ecx, eax
sub ecx, dword [0x40500c]
push 3
xor edx, edx
mov eax, ecx
pop edi
div edi
test ecx, 0xffff8000
je 0x404491
cmp edx, ebx
je 0x404767
cmp edx, 1
je 0x404253
jmp 0x404598
mov edi, dword [esp + 0x1c]
call fcn.00403e76
mov ecx, dword [eax]
mov edi, ecx
imul edi, edi, 0x8088405
add eax, 4
mov edx, dword [eax]
inc edi
mov dword [esp + 0xc], edx
mov edx, edi
xor edx, ecx
add eax, 4
cmp edx, dword [esp + 0xc]
jne 0x4046d0
mov edx, dword [eax]
mov ecx, edi
imul ecx, ecx, 0x8088405
inc ecx
mov dword [esp + 0xc], edx
mov edx, ecx
xor edx, edi
add eax, 4
cmp edx, dword [esp + 0xc]
jne 0x4046eb
mov edx, dword [eax]
imul ecx, ecx, 0x8088405
push dword [esp + 0x1c]
inc ecx
xor edx, ecx
imul ecx, ecx, 0x8088405
inc ecx
xor ecx, dword [eax + 4]
mov dword [esp + 0x10], edx
mov dword [esp + 0x18], ecx
call esi
push dword [esp + 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
push ebx
push ebx
push 8
push ebx
push dword [esp + 0x24]
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
cmp eax, ebx
mov dword [esp + 0x18], eax
je 0x404706
mov esi, dword [esp + 0x24]
mov ecx, dword [esp + 0x14]
lea ecx, [ecx + esi + 0x14]
push ecx
push ebx
push ebx
push 1
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
cmp eax, ebx
mov dword [esp + 0x1c], eax
je 0x404716
lea eax, [esi + eax + 0x14]
mov esi, dword [esp + 0x14]
cmp esi, ebx
mov dword [esp + 0x20], eax
jbe 0x404573
imul edi, edi, 0x343fd
add edi, 0x269ec3
mov ecx, edi
shr ecx, 0x10
xor byte [eax], cl
inc eax
dec esi
jne 0x40455c
lea esi, [esp + 0x30]
mov dword [esp + 0x50], ebx
mov dword [esp + 0x54], ebx
mov dword [esp + 0x58], ebx
mov dword [esp + 0x34], ebx
mov dword [esp + 0x30], ebx
call fcn.00403d30
test eax, eax
jne 0x404726
push 4
push 0x1000
push dword [esp + 0x14]
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov esi, eax
call fcn.00403ec1
mov ecx, eax
sub ecx, dword [0x40500c]
push 3
xor edx, edx
mov eax, ecx
pop edi
div edi
test ecx, 0xffff8000
je 0x4045dc
cmp edx, ebx
je 0x404767
cmp edx, 1
jne 0x404598
jmp 0x404253
mov eax, dword [esp + 0x14]
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x20]
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0xc]
mov dword [esp + 0x40], eax
lea eax, [esp + 0x30]
push eax
mov dword [esp + 0x40], esi
call fcn.00402d80
cmp eax, 1
pop ecx
jne 0x404741
push dword [esp + 0x1c]
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push dword [esp + 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
call fcn.00403ec1
mov ecx, eax
sub ecx, dword [0x40500c]
push 3
xor edx, edx
mov eax, ecx
pop edi
div edi
test ecx, 0xffff8000
jne 0x40447b
push esi
call fcn.00403f7c
cmp eax, ebx
pop ecx
je 0x4047ee
push eax
call fcn.00403ee2
cmp eax, ebx
pop ecx
mov dword [esp + 0xc], eax
jne 0x40475c
mov esi, 0x405010
push 0x4010c8
mov eax, esi
call fcn.004048c9
push 0x40126c
jmp 0x4047e9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x4010b4
lea esi, [esp + 0x6c]
mov edi, eax
call fcn.00404890
mov eax, edi
jmp 0x4047c8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x401174
jmp 0x40468a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x4011c0
jmp 0x40468a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x4011d4
jmp 0x40468a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x4011e8
jmp 0x40468a
mov esi, 0x405010
push 0x4010c8
mov eax, esi
call fcn.004048c9
push 0x4011fc
jmp 0x4047e9
mov esi, 0x405010
push 0x4010c8
mov eax, esi
call fcn.004048c9
push 0x40120c
jmp 0x4047e9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x40121c
jmp 0x40468a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x401230
jmp 0x40468a
mov esi, 0x405010
push 0x4010c8
mov eax, esi
call fcn.004048c9
push 0x401244
jmp 0x4047e9
mov esi, 0x405010
push 0x4010c8
mov eax, esi
call fcn.004048c9
push 0x401254
jmp 0x4047e9
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov dword [esp + 0x20], eax
push ebx
push ebx
push ebx
push 2
push ebx
push dword [esp + 0x24]
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov esi, eax
cmp esi, ebx
jne 0x40478d
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x40127c
jmp 0x40468a
push dword [esp + 0x10]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [esp + 0x28]
mov ecx, dword [esp + 0x18]
mov eax, dword [esp + 0x28]
lea eax, [ecx + eax + 0x14]
push eax
push esi
push dword [esp + 0x2c]
call dword [esp + 0x1c]
add esp, 0x10
jmp 0x4047ee
push 0x401158
lea esi, [esp + 0x6c]
call fcn.00404890
mov eax, dword [esp + 0x2c]
push 0xa
lea ecx, [esp + 0x6c]
call fcn.0040482c
mov esi, 0x405010
push 0x4010c8
mov eax, esi
call fcn.004048c9
lea eax, [esp + 0x68]
push eax
call fcn.00404890
push 0x401290
push 0x40129c
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push 0x10
push 0x4012b8
push 0x405010
push ebx
call eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret