Function at 0x405610
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, 0x5b0
mov eax, dword [0x416044]
xor eax, esp
mov dword [esp + 0x5ac], eax
mov eax, dword [ebp + 8]
push esi
xor esi, esi
push edi
mov dword [esp + 0xc], ecx
cmp dword [ebx + 0x14], esi
je 0x405655
mov eax, 0x40000
pop edi
pop esi
mov ecx, dword [esp + 0x5ac]
xor ecx, esp
call fcn.0040603f
mov esp, ebp
pop ebp
ret 4
cmp byte [ebx + 0x2c], 0
je 0x405676
mov eax, 0x50000
pop edi
pop esi
mov ecx, dword [esp + 0x5ac]
xor ecx, esp
call fcn.0040603f
mov esp, ebp
pop ebp
ret 4
mov dword [esp + 0x14], esi
cmp dword [ebx], esi
je 0x405686
mov dword [esp + 0x14], 0xc
lea edx, [esp + 0x3a8]
sub edx, eax
nop
movzx ecx, word [eax]
mov word [edx + eax], cx
add eax, 2
cmp cx, si
jne 0x405690
cmp word [esp + 0x3a8], si
jne 0x4056c4
mov eax, 0x10000
pop edi
pop esi
mov ecx, dword [esp + 0x5ac]
xor ecx, esp
call fcn.0040603f
mov esp, ebp
pop ebp
ret 4
lea eax, [esp + 0x3a8]
jmp 0x4056d0
cmp word [eax], 0x5c
jne 0x4056de
mov edx, 0x2f
mov word [eax], dx
add eax, 2
cmp word [eax], si
jne 0x4056d0
mov edi, 8
lea edx, [esp + 0x3a8]
mov dword [esp + 0x10], edi
call fcn.00404b60
test al, al
je 0x405705
mov dword [esp + 0x10], esi
mov edi, esi
mov eax, dword [esp + 0xc]
mov ecx, ebx
call fcn.004051d0
cmp eax, esi
jne 0x405e67
push esi
push esi
push 0x104
lea eax, [esp + 0x16c]
push eax
push 0xffffffffffffffff
lea ecx, [esp + 0x3bc]
push ecx
push esi
push 0xfde9
mov dword [esp + 0x394], esi
mov byte [esp + 0x70], 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
lea eax, [esp + 0x160]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x405753
sub eax, edx
mov dword [esp + 0x30], eax
xor edx, edx
mov eax, 0xb17
mov byte [esp + 0x264], cl
mov word [esp + 0x42], dx
mov edx, dword [ebx + 0x68]
mov word [esp + 0x18], ax
mov ecx, 0x14
mov eax, 8
mov dword [esp + 0x15c], esi
mov dword [esp + 0x3c], esi
mov dword [esp + 0x368], 1
mov dword [esp + 0x370], esi
mov word [esp + 0x1a], cx
mov dword [esp + 0x20], edx
mov dword [esp + 0x24], esi
mov word [esp + 0x1c], ax
cmp dword [ebx], esi
je 0x4057c2
mov eax, 9
mov word [esp + 0x1c], ax
mov word [esp + 0x44], ax
mov word [esp + 0x1e], di
cmp edi, esi
jne 0x4057e3
mov eax, dword [ebx + 0x70]
cmp eax, esi
jl 0x4057e3
mov ecx, dword [esp + 0x14]
add eax, ecx
mov dword [esp + 0x28], eax
jmp 0x4057e7
mov dword [esp + 0x28], esi
mov edx, dword [ebx + 0x70]
mov ecx, dword [ebx + 0x4c]
mov esi, dword [ebx + 0x58]
mov edi, dword [ebx + 0x5c]
mov dword [esp + 0x2c], edx
mov edx, dword [ebx + 0x18]
add edx, dword [ebx + 0x10]
xor eax, eax
mov word [esp + 0x40], ax
mov dword [esp + 0x48], ecx
mov dword [esp + 0x4c], edx
mov dl, byte [ebx + 0x58]
lea ecx, [esp + 0x39c]
lea eax, [esp + 0x388]
mov dword [esp + 0x154], eax
mov dword [esp + 0x158], ecx
mov byte [esp + 0x38d], dl
mov eax, esi
mov edx, edi
mov cl, 8
mov dword [esp + 0x34], 0x11
mov dword [esp + 0x38], 9
mov byte [esp + 0x388], 0x55
mov byte [esp + 0x389], 0x54
mov byte [esp + 0x38a], 0xd
mov byte [esp + 0x38b], 0
mov byte [esp + 0x38c], 7
call fcn.00410530
mov byte [esp + 0x38e], al
mov eax, esi
mov edx, edi
mov cl, 0x10
call fcn.00410530
mov byte [esp + 0x38f], al
mov eax, esi
mov edx, edi
mov cl, 0x18
call fcn.00410530
mov esi, dword [ebx + 0x50]
mov edi, dword [ebx + 0x54]
mov byte [esp + 0x390], al
mov al, byte [ebx + 0x50]
mov byte [esp + 0x391], al
mov eax, esi
mov edx, edi
mov cl, 8
call fcn.00410530
mov byte [esp + 0x392], al
mov eax, esi
mov edx, edi
mov cl, 0x10
call fcn.00410530
mov byte [esp + 0x393], al
mov eax, esi
mov edx, edi
mov cl, 0x18
call fcn.00410530
movzx ecx, byte [ebx + 0x60]
mov esi, dword [ebx + 0x60]
mov edi, dword [ebx + 0x64]
mov byte [esp + 0x394], al
mov byte [esp + 0x395], cl
mov eax, esi
mov edx, edi
mov cl, 8
call fcn.00410530
mov byte [esp + 0x396], al
mov eax, esi
mov edx, edi
mov cl, 0x10
call fcn.00410530
mov byte [esp + 0x397], al
mov eax, esi
mov edx, edi
mov cl, 0x18
call fcn.00410530
mov edx, dword [esp + 0x388]
mov byte [esp + 0x398], al
mov eax, dword [esp + 0x38c]
mov dword [esp + 0x39c], edx
mov dword [esp + 0x3a0], eax
movzx ecx, byte [esp + 0x390]
mov esi, ebx
lea edi, [esp + 0x18]
mov byte [esp + 0x3a4], cl
mov byte [esp + 0x39e], 5
call fcn.00403fa0
test eax, eax
je 0x40598f
call fcn.00405440
mov eax, 0x400
pop edi
pop esi
mov ecx, dword [esp + 0x5ac]
xor ecx, esp
call fcn.0040603f
mov esp, ebp
pop ebp
ret 4
mov edx, dword [esp + 0x34]
mov eax, dword [esp + 0x30]
lea ecx, [edx + eax + 0x1e]
add dword [ebx + 0x18], ecx
cmp dword [ebx + 0x14], 0
je 0x4059c2
call fcn.00405440
mov eax, dword [ebx + 0x14]
pop edi
pop esi
mov ecx, dword [esp + 0x5ac]
xor ecx, esp
call fcn.0040603f
mov esp, ebp
pop ebp
ret 4
mov edi, dword [ebx]
lea esi, [ebx + 0x30]
mov dword [esi], 0x12345678
mov dword [ebx + 0x34], 0x23456789
mov dword [ebx + 0x38], 0x34567890
test edi, edi
je 0x4059f1
mov cl, byte [edi]
test cl, cl
je 0x4059f1
mov edx, esi
call fcn.00404b10
add edi, 1
jne 0x4059df
cmp byte [0x417cd0], 0
jne 0x405a13
call dword [sym.imp.USER32.dll_GetDesktopWindow]
mov edi, eax
call dword [sym.imp.KERNEL32.dll_GetTickCount]
xor edi, eax
push edi
call fcn.004065e7
add esp, 4
xor edi, edi
call fcn.004065f9
sar eax, 7
mov byte [esp + edi + 0x37c], al
inc edi
cmp edi, 0xc
jl 0x405a15
mov edx, dword [esp + 0x20]
shr edx, 8
mov byte [esp + 0x387], dl
mov dword [esp + 0xc], 0
mov eax, dword [esp + 0xc]
mov cl, byte [esp + eax + 0x37c]
movsx ecx, cl
mov edi, dword [esi]
xor ecx, edi
and ecx, 0xff
mov ecx, dword [ecx*4 + 0x413f60]
mov dword [esp + 8], ecx
mov eax, dword [esi + 8]
shr edi, 8
xor dword [esp + 8], edi
mov ecx, dword [esp + 8]
mov dword [esi], ecx
movzx ecx, cl
add ecx, dword [esi + 4]
mov edx, eax
imul ecx, ecx, 0x8088405
inc ecx
mov dword [esi + 4], ecx
shr ecx, 0x18
xor ecx, eax
and ecx, 0xff
and edx, 0xfffd
or edx, 2
shr eax, 8
xor eax, dword [ecx*4 + 0x413f60]
mov edi, dword [esi]
mov ecx, edx
xor ecx, 1
imul ecx, edx
shr ecx, 8
mov dword [esi + 8], eax
mov eax, dword [esp + 0xc]
xor cl, byte [esp + eax + 0x37c]
mov byte [esp + eax + 0x37c], cl
mov cl, byte [esp + eax + 0x37d]
movsx ecx, cl
xor ecx, edi
and ecx, 0xff
mov ecx, dword [ecx*4 + 0x413f60]
mov dword [esp + 8], ecx
mov eax, dword [esi + 8]
shr edi, 8
xor dword [esp + 8], edi
mov ecx, dword [esp + 8]
mov dword [esi], ecx
movzx ecx, cl
add ecx, dword [esi + 4]
mov edx, eax
imul ecx, ecx, 0x8088405
inc ecx
mov dword [esi + 4], ecx
shr ecx, 0x18
xor ecx, eax
and ecx, 0xff
and edx, 0xfffd
mov edi, dword [esi]
or edx, 2
shr eax, 8
xor eax, dword [ecx*4 + 0x413f60]
mov ecx, edx
xor ecx, 1
imul ecx, edx
shr ecx, 8
mov dword [esi + 8], eax
mov eax, dword [esp + 0xc]
xor cl, byte [esp + eax + 0x37d]
mov byte [esp + eax + 0x37d], cl
mov cl, byte [esp + eax + 0x37e]
mov eax, dword [esi + 8]
movsx ecx, cl
xor ecx, edi
and ecx, 0xff
mov ecx, dword [ecx*4 + 0x413f60]
mov edx, eax
and edx, 0xfffd
mov dword [esp + 8], ecx
shr edi, 8
or edx, 2
xor dword [esp + 8], edi
mov ecx, dword [esp + 8]
mov dword [esi], ecx
movzx ecx, cl
add ecx, dword [esi + 4]
mov edi, dword [esi]
imul ecx, ecx, 0x8088405
inc ecx
mov dword [esi + 4], ecx
shr ecx, 0x18
xor ecx, eax
and ecx, 0xff
shr eax, 8
xor eax, dword [ecx*4 + 0x413f60]
mov ecx, edx
xor ecx, 1
imul ecx, edx
shr ecx, 8
mov dword [esi + 8], eax
mov eax, dword [esp + 0xc]
xor cl, byte [esp + eax + 0x37e]
mov byte [esp + eax + 0x37e], cl
mov cl, byte [esp + eax + 0x37f]
movsx ecx, cl
xor ecx, edi
and ecx, 0xff
mov ecx, dword [ecx*4 + 0x413f60]
mov dword [esp + 8], ecx
mov eax, dword [esi + 8]
shr edi, 8
xor dword [esp + 8], edi
mov ecx, dword [esp + 8]
mov dword [esi], ecx
movzx ecx, cl
add ecx, dword [esi + 4]
mov edx, eax
imul ecx, ecx, 0x8088405
inc ecx
mov dword [esi + 4], ecx
shr ecx, 0x18
xor ecx, eax
and ecx, 0xff
shr eax, 8
xor eax, dword [ecx*4 + 0x413f60]
and edx, 0xfffd
or edx, 2
mov ecx, edx
xor ecx, 1
imul ecx, edx
mov dword [esi + 8], eax
mov eax, dword [esp + 0xc]
shr ecx, 8
xor cl, byte [esp + eax + 0x37f]
add eax, 4
cmp eax, 0xc
mov byte [esp + eax + 0x37b], cl
mov dword [esp + 0xc], eax
jl 0x405a40
cmp dword [ebx], 0
je 0x405c6a
push 0xc
lea edx, [esp + 0x380]
push edx
mov ecx, ebx
call fcn.00404fd0
add dword [ebx + 0x18], 0xc
xor eax, eax
xor esi, esi
cmp dword [ebx], esi
setne al
mov byte [ebx + 0x2d], al
mov eax, dword [esp + 0x10]
cmp eax, 8
jne 0x405c8d
lea eax, [esp + 0x18]
push eax
mov edi, ebx
call fcn.004054a0
jmp 0x405c98
test eax, eax
jne 0x405c9a
mov eax, ebx
call fcn.004055b0
mov esi, eax
cmp byte [ebx + 0x80], 0
mov byte [ebx + 0x2d], 0
je 0x405cb5
mov eax, dword [ebx + 0x7c]
test eax, eax
je 0x405cb5
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 0x405e67
test esi, esi
jne 0x405974
mov edx, dword [esp + 0x14]
lea eax, [ecx + edx]
cmp dword [esp + 0x28], eax
mov edx, dword [ebx + 0x78]
sete cl
cmp byte [ebx + 0x1c], 0
mov dword [esp + 0x24], edx
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], edi
je 0x405d78
cmp dword [ebx], esi
jne 0x405d78
test byte [esp + 0x1c], 1
mov ax, word [esp + 0x10]
mov word [esp + 0x1e], ax
jne 0x405d20
mov ecx, 0xfff7
and word [esp + 0x1c], cx
mov dx, word [esp + 0x1c]
mov word [esp + 0x44], dx
mov edx, dword [esp + 0x4c]
sub edx, dword [ebx + 0x10]
mov eax, ebx
call fcn.00405120
test al, al
je 0x405d5d
mov esi, ebx
lea edi, [esp + 0x18]
call fcn.00403fa0
test eax, eax
jne 0x405974
mov edx, dword [ebx + 0x18]
mov eax, ebx
call fcn.00405120
test al, al
jne 0x405dc7
mov eax, 0x2000000
pop edi
pop esi
mov ecx, dword [esp + 0x5ac]
xor ecx, esp
call fcn.0040603f
mov esp, ebp
pop ebp
ret 4
mov eax, dword [esp + 0x10]
cmp word [esp + 0x1e], ax
je 0x405d9e
mov eax, 0x4000000
pop edi
pop esi
mov ecx, dword [esp + 0x5ac]
xor ecx, esp
call fcn.0040603f
mov esp, ebp
pop ebp
ret 4
test eax, eax
jne 0x405da6
test cl, cl
je 0x405d83
mov esi, ebx
lea edi, [esp + 0x18]
call fcn.00404270
test eax, eax
jne 0x405974
mov ax, word [esp + 0x44]
add dword [ebx + 0x18], 0x10
mov word [esp + 0x1c], ax
mov eax, dword [ebx + 0x14]
test eax, eax
jne 0x405e67
mov ecx, dword [esp + 0x38]
push ecx
call fcn.00406577
mov edx, dword [esp + 0x3c]
add esp, 4
mov esi, eax
mov eax, dword [esp + 0x158]
push edx
push eax
push esi
call fcn.0040cad0
add esp, 0xc
push 0x360
mov dword [esp + 0x15c], esi
call fcn.00406577
mov ecx, 0xd8
lea esi, [esp + 0x1c]
mov edi, eax
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [ebx + 0x44]
add esp, 4
test ecx, ecx
jne 0x405e3a
mov dword [ebx + 0x44], eax
xor eax, eax
pop edi
pop esi
mov ecx, dword [esp + 0x5ac]
xor ecx, esp
call fcn.0040603f
mov esp, ebp
pop ebp
ret 4
cmp dword [ecx + 0x35c], 0
je 0x405e5f
jmp 0x405e50
mov ecx, dword [ecx + 0x35c]
cmp dword [ecx + 0x35c], 0
jne 0x405e50
mov dword [ecx + 0x35c], eax
xor eax, eax
mov ecx, dword [esp + 0x5b4]
pop edi
pop esi
xor ecx, esp
call fcn.0040603f
mov esp, ebp
pop ebp
ret 4