Function at 0x40412a
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, 0x494
push ebx
push esi
push edi
call fcn.00403dd5
lea eax, [esp + 0x24]
push eax
xor ebx, ebx
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov ecx, eax
call fcn.00403e0e
pop ecx
lea eax, [esp + 0x2c]
push eax
push 0x18
lea eax, [esp + 0x70]
push eax
push ebx
mov dword [esp + 0x29c], ebx
mov word [esp + 0x90], bx
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [0x405010]
mov edi, 0x80000000
and eax, edi
cmp eax, edi
jne 0x4041a3
mov esi, 0x405020
push 0x401ae0
mov eax, esi
call fcn.004046b8
push 0x401b70
jmp 0x4045bd
mov esi, dword [esp + 0x7c]
lea eax, [esp + 0x290]
call fcn.004046d3
mov eax, esi
lea ecx, [esp + 0x290]
call fcn.0040461c
push 0x401b98
mov esi, ecx
call fcn.0040467f
mov eax, dword [esp + 0x24]
mov ecx, esi
call fcn.0040461c
mov eax, esi
push eax
mov esi, 0x1000
push esi
push ebx
push 2
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
cmp eax, ebx
mov dword [esp + 0x14], eax
je 0x40424f
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x40424f
push ebx
push ebx
push ebx
push 4
push dword [esp + 0x24]
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
cmp eax, ebx
mov dword [esp + 0x10], eax
jne 0x404233
mov esi, 0x405020
push 0x401ae0
mov eax, esi
call fcn.004046b8
push 0x401ba0
jmp 0x4045bd
add eax, 4
push eax
lea eax, [esp + 0x84]
call fcn.004046b8
push dword [esp + 0x10]
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
jmp 0x404276
push 0x104
lea eax, [esp + 0x84]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea ecx, [esp + 0x80]
call fcn.0040460b
mov dword [esp + 0x28c], eax
push dword [esp + 0x14]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
push ebx
push 3
push ebx
push 7
push edi
lea eax, [esp + 0x98]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [esp + 0x14], eax
jne 0x4042ba
mov esi, 0x405020
push 0x401ae0
mov eax, esi
call fcn.004046b8
push 0x401bb0
jmp 0x4045bd
push ebx
push ebx
push ebx
push 2
push section..data
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
cmp eax, ebx
mov dword [esp + 0x20], eax
jne 0x4042ee
mov esi, 0x405020
push 0x401ae0
mov eax, esi
call fcn.004046b8
push 0x401bc0
jmp 0x4045bd
push esi
mov esi, dword [sym.imp.KERNEL32.dll_MapViewOfFile]
push ebx
push ebx
push 4
push eax
call esi
mov edi, eax
cmp edi, ebx
mov dword [esp + 0x1c], edi
jne 0x404321
mov esi, 0x405020
push 0x401ae0
mov eax, esi
call fcn.004046b8
push 0x401bd0
jmp 0x4045bd
call fcn.00403e61
push dword [esp + 0x1c]
mov edi, eax
mov dword [esp + 0x14], edi
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
add edi, 0x1000
push edi
push ebx
push ebx
push 4
push dword [esp + 0x30]
call esi
cmp eax, ebx
mov dword [esp + 0x1c], eax
jne 0x40436a
mov esi, 0x405020
push 0x401ae0
mov eax, esi
call fcn.004046b8
push 0x401be0
jmp 0x4045bd
mov edi, eax
call fcn.00403e31
mov ecx, dword [eax]
mov esi, ecx
imul esi, esi, 0x8088405
add eax, 4
mov edx, dword [eax]
inc esi
mov edi, esi
xor edi, ecx
add eax, 4
cmp edi, edx
je 0x4043a7
mov esi, 0x405020
push 0x401ae0
mov eax, esi
call fcn.004046b8
push 0x401bf0
jmp 0x4045bd
mov edx, dword [eax]
mov ecx, esi
imul ecx, ecx, 0x8088405
inc ecx
mov edi, ecx
xor edi, esi
add eax, 4
cmp edi, edx
je 0x4043d8
mov esi, 0x405020
push 0x401ae0
mov eax, esi
call fcn.004046b8
push 0x401c00
jmp 0x4045bd
mov edi, dword [eax]
imul ecx, ecx, 0x8088405
push dword [esp + 0x1c]
inc ecx
xor edi, ecx
imul ecx, ecx, 0x8088405
inc ecx
xor ecx, dword [eax + 4]
mov dword [esp + 0x1c], ecx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push dword [esp + 0x20]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
push ebx
push ebx
push 8
push section..data
push dword [esp + 0x28]
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
cmp eax, ebx
mov dword [esp + 0x20], eax
jne 0x40443c
mov esi, 0x405020
push 0x401ae0
mov eax, esi
call fcn.004046b8
push 0x401c10
jmp 0x4045bd
mov edx, dword [esp + 0x10]
mov ecx, dword [esp + 0x18]
lea ecx, [ecx + edx + 0x14]
push ecx
push ebx
push ebx
push 1
push eax
mov dword [esp + 0x3c], ecx
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
cmp eax, ebx
mov dword [esp + 0x1c], eax
jne 0x40447b
mov esi, 0x405020
push 0x401ae0
mov eax, esi
call fcn.004046b8
push 0x401c20
jmp 0x4045bd
mov ecx, dword [esp + 0x10]
lea eax, [ecx + eax + 0x14]
mov ecx, dword [esp + 0x18]
cmp ecx, ebx
mov dword [esp + 0x10], eax
jbe 0x4044a6
imul esi, esi, 0x343fd
add esi, 0x269ec3
mov edx, esi
shr edx, 0x10
xor byte [eax], dl
inc eax
dec ecx
jne 0x40448f
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.00403d60
test eax, eax
je 0x4044e2
mov esi, 0x405020
push 0x401ae0
mov eax, esi
call fcn.004046b8
push 0x401c30
jmp 0x4045bd
push 4
push 0x1000
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov esi, eax
mov eax, dword [esp + 0x18]
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x10]
mov dword [esp + 0x30], eax
lea eax, [esp + 0x30]
push eax
mov dword [esp + 0x44], edi
mov dword [esp + 0x40], esi
call fcn.00402db0
cmp eax, 1
pop ecx
je 0x404536
mov esi, 0x405020
push 0x401ae0
mov eax, esi
call fcn.004046b8
push 0x401c40
jmp 0x4045bd
push dword [esp + 0x1c]
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push dword [esp + 0x20]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call edi
push esi
call fcn.00403f17
cmp eax, ebx
pop ecx
je 0x4045de
push eax
call fcn.00403e93
cmp eax, ebx
pop ecx
mov dword [esp + 0x18], eax
jne 0x404582
mov esi, 0x405020
push 0x401ae0
mov eax, esi
call fcn.004046b8
push 0x401c58
jmp 0x4045bd
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push ebx
push ebx
push ebx
push 2
push section..data
push dword [esp + 0x28]
mov dword [esp + 0x28], eax
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov esi, eax
cmp esi, ebx
jne 0x4045c4
mov esi, 0x405020
push 0x401ae0
mov eax, esi
call fcn.004046b8
push 0x401c68
call fcn.0040467f
jmp 0x4045de
push dword [esp + 0x14]
call edi
push dword [esp + 0x24]
push dword [esp + 0x2c]
push esi
push dword [esp + 0x1c]
call dword [esp + 0x28]
add esp, 0x10
push 0x401c78
push 0x401c84
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push 0x10
push 0x401ca0
push 0x405020
push ebx
call eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret