Function at 0x40a7c0
Capabilities:
Encode data using xor
Generate random numbers using the delphi lcg
Hash data with crc32
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x5bc
mov eax, dword [0x5deba8]
xor eax, esp
mov dword [esp + 0x5b8], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov esi, dword [ebp + 0x10]
push edi
mov ebx, edx
xor edi, edi
mov dword [esp + 0x24], ebx
mov dword [esp + 0x14], ecx
cmp dword [ebx + 0x14], edi
je 0x40a810
mov eax, 0x40000
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x5b8]
xor ecx, esp
call fcn.0055338c
mov esp, ebp
pop ebp
ret 0xc
cmp byte [ebx + 0x2c], 0
je 0x40a832
mov eax, 0x50000
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x5b8]
xor ecx, esp
call fcn.0055338c
mov esp, ebp
pop ebp
ret 0xc
mov dword [esp + 0x20], edi
cmp dword [ebx], edi
je 0x40a847
cmp esi, 4
je 0x40a847
mov dword [esp + 0x20], 0xc
lea edx, [esp + 0x3b8]
sub edx, eax
movzx ecx, word [eax]
mov word [edx + eax], cx
add eax, 2
cmp cx, di
jne 0x40a850
cmp word [esp + 0x3b8], di
je 0x40b0ee
lea eax, [esp + 0x3b8]
cmp word [eax], 0x5c
jne 0x40a882
mov edx, 0x2f
mov word [eax], dx
add eax, 2
cmp word [eax], di
jne 0x40a874
cmp esi, 4
sete dl
mov byte [esp + 0x13], dl
test dl, dl
je 0x40a8c1
lea eax, [esp + 0x3b8]
lea esi, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x40a8a2
sub eax, esi
sar eax, 1
cmp word [esp + eax*2 + 0x3b6], 0x2f
mov byte [esp + 0xc], 1
jne 0x40a8c6
mov byte [esp + 0xc], 0
mov dword [esp + 0x1c], 8
test dl, dl
jne 0x40a8e2
lea edx, [esp + 0x3b8]
call fcn.00409890
test al, al
je 0x40a8e6
mov dword [esp + 0x1c], edi
mov eax, dword [ebp + 0x10]
cmp eax, 2
jne 0x40a8fb
mov eax, dword [esp + 0x14]
mov esi, ebx
call fcn.0040a0f0
jmp 0x40a937
cmp eax, 1
jne 0x40a911
mov eax, dword [ebp + 0xc]
mov ecx, dword [esp + 0x14]
push eax
call fcn.0040a170
xor edi, edi
jmp 0x40a937
cmp eax, 3
jne 0x40a927
mov ecx, dword [ebp + 0xc]
push ecx
mov ecx, dword [esp + 0x18]
mov esi, ebx
call fcn.0040a2d0
jmp 0x40a937
cmp eax, 4
jne 0x40b0ee
mov esi, ebx
call fcn.0040a400
cmp eax, edi
jne 0x40b0f3
mov dl, byte [0x5baafb]
push edi
push edi
push 0x104
lea eax, [esp + 0x17c]
push eax
push 0xffffffffffffffff
lea ecx, [esp + 0x3cc]
push ecx
push edi
push 0xfde9
mov dword [esp + 0x3a4], edi
mov byte [esp + 0x80], dl
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
lea eax, [esp + 0x170]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40a982
sub eax, edx
mov dword [esp + 0x40], eax
cmp byte [esp + 0xc], cl
je 0x40a9b8
lea edi, [esp + 0x170]
dec edi
lea ecx, [ecx]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x40a9a0
mov dx, word [0x5bb3c0]
mov word [edi], dx
inc dword [esp + 0x40]
xor edi, edi
mov al, byte [0x5baafb]
xor ecx, ecx
mov byte [esp + 0x274], al
mov word [esp + 0x52], cx
mov ecx, dword [ebx + 0x68]
mov eax, 8
mov dword [esp + 0x16c], edi
mov dword [esp + 0x4c], edi
mov dword [esp + 0x378], 1
mov dword [esp + 0x380], edi
mov dword [esp + 0x28], 0x140b17
mov dword [esp + 0x30], ecx
mov dword [esp + 0x34], edi
mov word [esp + 0x2c], ax
cmp dword [ebx], edi
je 0x40aa1a
cmp byte [esp + 0x13], 0
jne 0x40aa1a
mov eax, 9
mov word [esp + 0x2c], ax
mov word [esp + 0x54], ax
mov eax, dword [esp + 0x1c]
mov word [esp + 0x2e], ax
cmp eax, edi
jne 0x40aa3d
mov eax, dword [ebx + 0x70]
cmp eax, edi
jl 0x40aa3d
add eax, dword [esp + 0x20]
mov dword [esp + 0x38], eax
jmp 0x40aa41
mov dword [esp + 0x38], edi
mov eax, dword [ebx + 0x70]
mov edx, dword [ebx + 0x4c]
mov esi, dword [ebx + 0x58]
mov dword [esp + 0x3c], eax
mov eax, dword [ebx + 0x18]
add eax, dword [ebx + 0x10]
mov dword [esp + 0x58], edx
mov dword [esp + 0x5c], eax
movzx eax, byte [ebx + 0x58]
xor ecx, ecx
mov byte [esp + 0x391], al
mov eax, dword [ebx + 0x5c]
mov word [esp + 0x50], cx
lea ecx, [esp + 0x38c]
mov dword [esp + 0x164], ecx
lea edx, [esp + 0x3ac]
mov dword [esp + 0x168], edx
mov edx, eax
mov ecx, esi
shrd ecx, edx, 8
sar edx, 8
mov edx, eax
mov byte [esp + 0x392], cl
mov ecx, esi
shrd ecx, edx, 0x10
sar edx, 0x10
mov dl, byte [ebx + 0x50]
mov byte [esp + 0x395], dl
mov byte [esp + 0x393], cl
mov ecx, esi
mov esi, dword [ebx + 0x50]
shrd ecx, eax, 0x18
sar eax, 0x18
mov eax, dword [ebx + 0x54]
mov edi, eax
mov edx, esi
shrd edx, edi, 8
mov byte [esp + 0x396], dl
sar edi, 8
mov edi, eax
mov edx, esi
shrd edx, edi, 0x10
mov byte [esp + 0x397], dl
mov edx, esi
mov esi, dword [ebx + 0x60]
shrd edx, eax, 0x18
sar eax, 0x18
movzx eax, byte [ebx + 0x60]
mov byte [esp + 0x398], dl
sar edi, 0x10
mov byte [esp + 0x399], al
mov eax, dword [ebx + 0x64]
mov edi, eax
mov edx, esi
shrd edx, edi, 8
mov byte [esp + 0x39a], dl
sar edi, 8
mov edi, eax
mov edx, esi
shrd edx, edi, 0x10
mov byte [esp + 0x39b], dl
mov edx, esi
shrd edx, eax, 0x18
mov dword [esp + 0x38c], 0xd5455
sar eax, 0x18
mov eax, dword [esp + 0x38c]
mov byte [esp + 0x390], 7
mov byte [esp + 0x39c], dl
mov edx, dword [esp + 0x390]
sar edi, 0x10
mov dword [esp + 0x3ac], eax
mov esi, ebx
lea edi, [esp + 0x28]
mov dword [esp + 0x44], 0x11
mov dword [esp + 0x48], 9
mov byte [esp + 0x394], cl
mov dword [esp + 0x3b0], edx
mov byte [esp + 0x3b4], cl
mov byte [esp + 0x3ae], 5
call fcn.00408d20
test eax, eax
je 0x40abc8
call fcn.0040a5c0
mov eax, 0x400
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x5b8]
xor ecx, esp
call fcn.0055338c
mov esp, ebp
pop ebp
ret 0xc
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x44]
lea edx, [ecx + eax + 0x1e]
add dword [ebx + 0x18], edx
cmp dword [ebx + 0x14], 0
je 0x40abfc
call fcn.0040a5c0
mov eax, dword [ebx + 0x14]
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x5b8]
xor ecx, esp
call fcn.0055338c
mov esp, ebp
pop ebp
ret 0xc
lea esi, [ebx + 0x30]
mov dword [ebx + 0x34], 0x23456789
mov dword [ebx + 0x38], 0x34567890
mov ebx, dword [ebx]
mov dword [esi], 0x12345678
test ebx, ebx
je 0x40ac30
lea esp, [esp]
mov cl, byte [ebx]
test cl, cl
je 0x40ac30
mov edx, esi
call fcn.004097b0
inc ebx
jne 0x40ac20
cmp byte [0x5e8fe8], 0
jne 0x40ac52
call dword [sym.imp.USER32.dll_GetDesktopWindow]
mov edi, eax
call dword [sym.imp.KERNEL32.dll_GetTickCount]
xor edi, eax
push edi
call fcn.00580954
add esp, 4
xor edi, edi
call fcn.00580966
sar eax, 7
mov byte [esp + edi + 0x3a0], al
inc edi
cmp edi, 0xc
jl 0x40ac54
mov eax, dword [esp + 0x30]
mov edi, dword [esi + 4]
mov ecx, dword [esi]
shr eax, 8
xor edx, edx
mov byte [esp + 0x3ab], al
mov eax, dword [esi + 8]
mov dword [esp + 0x14], edx
mov dword [esp + 0x18], edi
mov dl, byte [esp + edx + 0x3a0]
movsx edx, dl
xor edx, ecx
and edx, 0xff
mov edi, ecx
mov ecx, dword [edx*4 + 0x5b8d70]
shr edi, 8
xor ecx, edi
movzx edi, cl
add edi, dword [esp + 0x18]
mov ebx, eax
imul edi, edi, 0x8088405
and ebx, 0xfffd
or ebx, 2
inc edi
mov edx, edi
shr edx, 0x18
xor edx, eax
shr eax, 8
mov dword [esi], ecx
mov dword [esi + 4], edi
and edx, 0xff
xor eax, dword [edx*4 + 0x5b8d70]
mov edx, ebx
xor edx, 1
imul edx, ebx
mov ebx, dword [esp + 0x14]
shr edx, 8
xor dl, byte [esp + ebx + 0x3a0]
mov dword [esi + 8], eax
mov byte [esp + ebx + 0x3a0], dl
mov edx, ebx
movzx ebx, byte [esp + edx + 0x3a1]
mov byte [esp + 0xc], bl
mov ebx, eax
and ebx, 0xfffd
or ebx, 2
mov dword [esp + 0x14], ebx
movsx ebx, byte [esp + 0xc]
xor ebx, ecx
and ebx, 0xff
mov ebx, dword [ebx*4 + 0x5b8d70]
shr ecx, 8
xor ebx, ecx
movzx ecx, bl
add ecx, edi
imul ecx, ecx, 0x8088405
inc ecx
mov dword [esi], ebx
mov edi, ecx
shr edi, 0x18
xor edi, eax
shr eax, 8
mov dword [esp + 0x18], ebx
and edi, 0xff
mov dword [esi + 4], ecx
xor eax, dword [edi*4 + 0x5b8d70]
mov edi, eax
mov eax, dword [esp + 0x14]
mov ebx, eax
xor ebx, 1
imul ebx, eax
shr ebx, 8
xor bl, byte [esp + 0xc]
mov eax, edi
mov byte [esp + edx + 0x3a1], bl
mov bl, byte [esp + edx + 0x3a2]
and eax, 0xfffd
or eax, 2
mov byte [esp + 0xc], bl
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x18]
movsx ebx, bl
xor ebx, eax
shr eax, 8
and ebx, 0xff
mov dword [esp + 0x18], eax
mov dword [esi + 8], edi
mov eax, dword [ebx*4 + 0x5b8d70]
xor eax, dword [esp + 0x18]
mov dword [esp + 0x18], eax
mov dword [esi], eax
movzx eax, al
add eax, ecx
imul eax, eax, 0x8088405
inc eax
mov ecx, eax
shr ecx, 0x18
xor ecx, edi
mov dword [esi + 4], eax
and ecx, 0xff
shr edi, 8
xor edi, dword [ecx*4 + 0x5b8d70]
mov ecx, dword [esp + 0x14]
mov ebx, ecx
xor ebx, 1
imul ebx, ecx
shr ebx, 8
xor bl, byte [esp + 0xc]
mov ecx, edi
mov byte [esp + edx + 0x3a2], bl
mov bl, byte [esp + edx + 0x3a3]
mov byte [esp + 0xc], bl
and ecx, 0xfffd
movsx ebx, bl
or ecx, 2
mov dword [esp + 0x14], ecx
mov ecx, dword [esp + 0x18]
xor ebx, ecx
and ebx, 0xff
shr ecx, 8
mov dword [esi + 8], edi
mov dword [esp + 0x18], ecx
mov ecx, dword [ebx*4 + 0x5b8d70]
xor ecx, dword [esp + 0x18]
add edx, 4
movzx ebx, cl
add eax, ebx
imul eax, eax, 0x8088405
inc eax
mov dword [esi + 4], eax
mov dword [esp + 0x18], eax
shr eax, 0x18
xor eax, edi
and eax, 0xff
shr edi, 8
mov dword [esi], ecx
xor edi, dword [eax*4 + 0x5b8d70]
mov eax, edi
mov edi, dword [esp + 0x14]
mov ebx, edi
xor ebx, 1
imul ebx, edi
shr ebx, 8
xor bl, byte [esp + 0xc]
mov dword [esi + 8], eax
mov byte [esp + edx + 0x39f], bl
mov dword [esp + 0x14], edx
cmp edx, 0xc
jl 0x40ac89
mov ebx, dword [esp + 0x24]
xor esi, esi
cmp dword [ebx], esi
je 0x40aecd
cmp byte [esp + 0x13], 0
jne 0x40aebb
push 0xc
lea edx, [esp + 0x3a4]
push edx
mov ecx, ebx
call fcn.00409e90
add dword [ebx + 0x18], 0xc
cmp dword [ebx], esi
je 0x40aecd
cmp byte [esp + 0x13], 0
jne 0x40aecd
mov eax, 1
jmp 0x40aecf
xor eax, eax
cmp byte [esp + 0x13], 0
mov byte [ebx + 0x2d], al
jne 0x40af01
mov eax, dword [esp + 0x1c]
cmp eax, 8
jne 0x40aef2
lea eax, [esp + 0x28]
push eax
mov edi, ebx
call fcn.0040a620
mov esi, eax
jmp 0x40af07
cmp eax, esi
jne 0x40af07
mov edi, ebx
call fcn.0040a750
mov esi, eax
jmp 0x40af07
mov dword [ebx + 0x90], esi
cmp byte [ebx + 0x80], 0
mov byte [ebx + 0x2d], 0
je 0x40af22
mov eax, dword [ebx + 0x7c]
test eax, eax
je 0x40af22
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebx + 0x90]
mov eax, dword [ebx + 0x14]
mov edi, dword [ebx + 0x74]
add dword [ebx + 0x18], ecx
mov dword [ebx + 0x7c], 0
mov dword [ebx + 0x70], edi
test eax, eax
jne 0x40b0f3
test esi, esi
jne 0x40abac
mov edx, dword [esp + 0x20]
lea eax, [ecx + edx]
cmp dword [esp + 0x38], eax
mov edx, dword [ebx + 0x78]
sete cl
cmp byte [ebx + 0x1c], 0
mov dword [esp + 0x34], edx
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], edi
je 0x40afed
cmp dword [ebx], esi
je 0x40af79
cmp byte [esp + 0x13], 0
je 0x40afed
test byte [esp + 0x2c], 1
mov ax, word [esp + 0x1c]
mov word [esp + 0x2e], ax
jne 0x40af94
mov ecx, 0xfff7
and word [esp + 0x2c], cx
mov dx, word [esp + 0x2c]
mov word [esp + 0x54], dx
mov edx, dword [esp + 0x5c]
sub edx, dword [ebx + 0x10]
mov eax, ebx
call fcn.00409ff0
test al, al
je 0x40afd1
mov esi, ebx
lea edi, [esp + 0x28]
call fcn.00408d20
test eax, eax
jne 0x40abac
mov edx, dword [ebx + 0x18]
mov eax, ebx
call fcn.00409ff0
test al, al
jne 0x40b03d
mov eax, 0x2000000
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x5b8]
xor ecx, esp
call fcn.0055338c
mov esp, ebp
pop ebp
ret 0xc
mov eax, dword [esp + 0x1c]
cmp word [esp + 0x2e], ax
je 0x40b014
mov eax, 0x4000000
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x5b8]
xor ecx, esp
call fcn.0055338c
mov esp, ebp
pop ebp
ret 0xc
test eax, eax
jne 0x40b01c
test cl, cl
je 0x40aff8
mov esi, ebx
lea edi, [esp + 0x28]
call fcn.00408fc0
test eax, eax
jne 0x40abac
mov ax, word [esp + 0x54]
add dword [ebx + 0x18], 0x10
mov word [esp + 0x2c], ax
mov eax, dword [ebx + 0x14]
test eax, eax
jne 0x40b0f3
mov ecx, dword [esp + 0x48]
push ecx
call fcn.00553a71
mov edx, dword [esp + 0x4c]
add esp, 4
mov esi, eax
mov eax, dword [esp + 0x168]
push edx
push eax
push esi
call fcn.005544b0
add esp, 0xc
push 0x360
mov dword [esp + 0x16c], esi
call fcn.00553a71
mov ecx, 0xd8
lea esi, [esp + 0x2c]
mov edi, eax
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [ebx + 0x44]
add esp, 4
test ecx, ecx
jne 0x40b0b1
mov dword [ebx + 0x44], eax
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x5b8]
xor ecx, esp
call fcn.0055338c
mov esp, ebp
pop ebp
ret 0xc
cmp dword [ecx + 0x35c], 0
je 0x40b0cf
lea ebx, [ebx]
mov ecx, dword [ecx + 0x35c]
cmp dword [ecx + 0x35c], 0
jne 0x40b0c0
mov dword [ecx + 0x35c], eax
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x5b8]
xor ecx, esp
call fcn.0055338c
mov esp, ebp
pop ebp
ret 0xc
mov eax, 0x10000
mov ecx, dword [esp + 0x5c4]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0055338c
mov esp, ebp
pop ebp
ret 0xc