Function at 0x4ad04229
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.4ad03da5
call dword [sym.imp.KERNEL32.dll_GetTickCount]
and eax, 0x11
xor ebx, ebx
cmp eax, 0x111
je 0x4ad04598
lea eax, [esp + 0x28]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
call fcn.4ad03e46
pop ecx
call fcn.4ad03ec1
mov ecx, eax
sub ecx, dword [0x4ad0500c]
push 3
xor edx, edx
mov eax, ecx
pop esi
mov edi, 0xffff8000
div esi
test edi, ecx
jne 0x4ad0447b
mov dword [esp + 0x894], ebx
mov word [esp + 0x480], bx
mov dword [esp + 0x47c], ebx
mov word [esp + 0x68], bx
call fcn.4ad03ec1
mov ecx, eax
sub ecx, dword [0x4ad0500c]
xor edx, edx
mov eax, ecx
div esi
test edi, ecx
jne 0x4ad0447b
push 0x4ad01094
lea eax, [esp + 0x89c]
call fcn.4ad048e4
push 0x10
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
lea ecx, [esp + 0x89c]
call fcn.4ad0482c
push 0x4ad010ac
mov esi, ecx
call fcn.4ad04890
mov eax, dword [esp + 0x28]
push 0x10
mov ecx, esi
call fcn.4ad0482c
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 0x4ad04353
push ebx
push ebx
push ebx
push 4
push esi
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov edi, eax
cmp edi, ebx
je 0x4ad0467f
lea eax, [edi + 4]
push eax
lea eax, [esp + 0x484]
call fcn.4ad048c9
push edi
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, 0xffff8000
jmp 0x4ad04383
cmp eax, 2
jne 0x4ad047b6
push 0x104
lea eax, [esp + 0x484]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea ecx, [esp + 0x480]
call fcn.4ad0481b
mov dword [esp + 0x894], eax
call fcn.4ad03ec1
mov ecx, eax
sub ecx, dword [0x4ad0500c]
push 3
xor edx, edx
mov eax, ecx
pop esi
div esi
test edi, ecx
jne 0x4ad0447b
lea eax, [esp + 0x480]
push eax
lea esi, [esp + 0x6c]
call fcn.4ad04890
push 0x4ad0116c
call fcn.4ad04890
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 0x4ad0469c
call fcn.4ad03e10
test eax, eax
jne 0x4ad04253
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 0x4ad046a9
push 0x1000
push ebx
push ebx
push 4
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov esi, eax
cmp esi, ebx
je 0x4ad046b6
mov edi, esi
call fcn.4ad03dde
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 0x4ad046c3
call fcn.4ad03ec1
mov ecx, eax
sub ecx, dword [0x4ad0500c]
push 3
xor edx, edx
mov eax, ecx
pop edi
div edi
test ecx, 0xffff8000
je 0x4ad04491
cmp edx, ebx
je 0x4ad04767
cmp edx, 1
je 0x4ad04253
jmp 0x4ad04598
mov edi, dword [esp + 0x1c]
call fcn.4ad03e76
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 0x4ad046d0
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 0x4ad046eb
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 0x4ad04706
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 0x4ad04716
lea eax, [esi + eax + 0x14]
mov esi, dword [esp + 0x14]
cmp esi, ebx
mov dword [esp + 0x20], eax
jbe 0x4ad04573
imul edi, edi, 0x343fd
add edi, 0x269ec3
mov ecx, edi
shr ecx, 0x10
xor byte [eax], cl
inc eax
dec esi
jne 0x4ad0455c
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.4ad03d30
test eax, eax
jne 0x4ad04726
push 4
push 0x1000
push dword [esp + 0x14]
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov esi, eax
call fcn.4ad03ec1
mov ecx, eax
sub ecx, dword [0x4ad0500c]
push 3
xor edx, edx
mov eax, ecx
pop edi
div edi
test ecx, 0xffff8000
je 0x4ad045dc
cmp edx, ebx
je 0x4ad04767
cmp edx, 1
jne 0x4ad04598
jmp 0x4ad04253
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.4ad02d80
cmp eax, 1
pop ecx
jne 0x4ad04741
push dword [esp + 0x1c]
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push dword [esp + 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
call fcn.4ad03ec1
mov ecx, eax
sub ecx, dword [0x4ad0500c]
push 3
xor edx, edx
mov eax, ecx
pop edi
div edi
test ecx, 0xffff8000
jne 0x4ad0447b
push esi
call fcn.4ad03f7c
cmp eax, ebx
pop ecx
je 0x4ad047ee
push eax
call fcn.4ad03ee2
cmp eax, ebx
pop ecx
mov dword [esp + 0xc], eax
jne 0x4ad0475c
mov esi, 0x4ad05010
push 0x4ad010c8
mov eax, esi
call fcn.4ad048c9
push 0x4ad0126c
jmp 0x4ad047e9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x4ad010b4
lea esi, [esp + 0x6c]
mov edi, eax
call fcn.4ad04890
mov eax, edi
jmp 0x4ad047c8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x4ad01174
jmp 0x4ad0468a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x4ad011c0
jmp 0x4ad0468a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x4ad011d4
jmp 0x4ad0468a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x4ad011e8
jmp 0x4ad0468a
mov esi, 0x4ad05010
push 0x4ad010c8
mov eax, esi
call fcn.4ad048c9
push 0x4ad011fc
jmp 0x4ad047e9
mov esi, 0x4ad05010
push 0x4ad010c8
mov eax, esi
call fcn.4ad048c9
push 0x4ad0120c
jmp 0x4ad047e9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x4ad0121c
jmp 0x4ad0468a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x4ad01230
jmp 0x4ad0468a
mov esi, 0x4ad05010
push 0x4ad010c8
mov eax, esi
call fcn.4ad048c9
push 0x4ad01244
jmp 0x4ad047e9
mov esi, 0x4ad05010
push 0x4ad010c8
mov eax, esi
call fcn.4ad048c9
push 0x4ad01254
jmp 0x4ad047e9
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 0x4ad0478d
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x4ad0127c
jmp 0x4ad0468a
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 0x4ad047ee
push 0x4ad01158
lea esi, [esp + 0x6c]
call fcn.4ad04890
mov eax, dword [esp + 0x2c]
push 0xa
lea ecx, [esp + 0x6c]
call fcn.4ad0482c
mov esi, 0x4ad05010
push 0x4ad010c8
mov eax, esi
call fcn.4ad048c9
lea eax, [esp + 0x68]
push eax
call fcn.4ad04890
push 0x4ad01290
push 0x4ad0129c
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push 0x10
push 0x4ad012b8
push 0x4ad05010
push ebx
call eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret