Function at 0x851190
Capabilities:
Encrypt data using rc4 prga
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff0
sub esp, 0xc0
mov edi, ecx
mov esi, dword [ebp + 8]
pxor xmm0, xmm0
movdqa xmmword [esp + 0x40], xmm0
cmp esi, 0x10
mov dword [esp + 0xc], ecx
jb 0x8515bc
mov ecx, dword [edi + 0x24]
mov eax, dword [edi + 0x28]
mov dword [esp + 0x1c], eax
movq xmm1, qword [edi + 0x2c]
mov eax, dword [edi + 0x34]
mov dword [esp + 0x10], esi
mov esi, dword [edx]
mov ebx, dword [edx + 4]
shld ebx, esi, 6
and esi, 0x3ffffff
add esi, ecx
and ebx, 0x3ffffff
add ebx, dword [esp + 0x1c]
movsd xmm3, qword [edx + 8]
pxor xmm0, xmm0
xorps xmm2, xmm2
movss xmm2, xmm3
punpckldq xmm0, xmm3
shufps xmm3, xmm3, 0x55
movd ecx, xmm3
shr ecx, 8
add eax, ecx
add eax, 0x1000000
mov ecx, ebx
movss xmm3, dword [edx + 4]
lea ebx, [edx + 0x10]
mov edx, esi
add dword [esp + 0x10], 0xfffffff0
mov dword [edi + 0x24], esi
mov dword [edi + 0x28], ecx
movlhps xmm3, xmm2
por xmm0, xmm3
movdqa xmm2, xmm0
psrlq xmm2, 0x14
psrlq xmm0, 0xe
movsd xmm0, xmm2
shufps xmm0, xmm0, 0xe8
andps xmm0, xmmword [0x9471b0]
paddd xmm0, xmm1
movq qword [edi + 0x2c], xmm0
mov dword [esp + 8], eax
mov dword [edi + 0x34], eax
mov dword [esp + 0x34], ebx
mov dword [esp + 0x14], ecx
mov eax, dword [edi]
mov dword [esp + 0x38], eax
mov dword [esp + 0x30], edx
mul edx
mov esi, eax
mov ebx, edx
mov eax, dword [edi + 0x20]
mov dword [esp + 0x24], eax
mul ecx
mov ecx, edx
mov edi, eax
add edi, esi
adc ecx, ebx
mov eax, dword [esp + 0xc]
mov edx, dword [eax + 0x1c]
mov dword [esp + 0x28], edx
movd eax, xmm0
mov dword [esp + 0x2c], eax
mul edx
mov esi, edx
mov ebx, eax
add ebx, edi
adc esi, ecx
pshufd xmm1, xmm0, 0x55
mov eax, dword [esp + 0xc]
mov ecx, dword [eax + 0x18]
mov dword [esp + 0x18], ecx
movd eax, xmm1
mov dword [esp + 0x20], eax
mul ecx
mov ecx, edx
mov edi, eax
add edi, ebx
adc ecx, esi
mov eax, dword [esp + 8]
mov edx, dword [esp + 0xc]
mul dword [edx + 0x14]
add eax, edi
mov dword [esp + 0x3c], eax
adc edx, ecx
mov dword [esp + 0x74], edx
mov eax, dword [esp + 0x14]
mov ebx, dword [esp + 0x38]
mul ebx
mov dword [esp + 0x8c], edx
mov dword [esp + 0x88], eax
mov esi, dword [esp + 0x2c]
mov eax, esi
mov ecx, dword [esp + 0x24]
mul ecx
mov dword [esp + 0x70], edx
mov dword [esp + 0x1c], eax
mov edi, dword [esp + 0x20]
mov eax, edi
mul dword [esp + 0x28]
mov dword [esp + 0x84], edx
mov dword [esp + 0x7c], eax
mov eax, dword [esp + 8]
mul dword [esp + 0x18]
mov dword [esp + 0x80], edx
mov dword [esp + 0x78], eax
mov eax, esi
mul ebx
mov dword [esp + 0xac], edx
mov dword [esp + 0xa4], eax
mov eax, edi
mul ecx
mov ebx, edx
mov dword [esp + 0x18], eax
mov edi, dword [esp + 8]
mov eax, edi
mul dword [esp + 0x28]
mov dword [esp + 0x94], eax
mov dword [esp + 0x9c], edx
mov eax, dword [esp + 0xc]
mov esi, dword [eax + 0xc]
mov eax, esi
mov ecx, dword [esp + 0x30]
mul ecx
mov dword [esp + 0xb4], edx
mov dword [esp + 0xb0], eax
mov eax, dword [esp + 0x20]
mul dword [esp + 0x38]
mov dword [esp + 0xa8], edx
mov dword [esp + 0xa0], eax
mov eax, edi
mul dword [esp + 0x24]
mov dword [esp + 0x98], edx
mov dword [esp + 0x90], eax
mov eax, ecx
mov edi, ecx
mov edx, dword [esp + 0xc]
mul dword [edx + 0x10]
mov dword [esp + 0x28], edx
mov dword [esp + 0x24], eax
mov eax, esi
mul dword [esp + 0x14]
mov dword [esp + 0xb8], eax
mov dword [esp + 0x20], edx
mov eax, dword [esp + 0xc]
movq xmm2, qword [eax + 4]
movdqa xmm1, xmm2
movd ecx, xmm2
mov eax, ecx
mul edi
mov dword [esp + 0x50], eax
mov dword [esp + 0x54], edx
shufps xmm2, xmm2, 0x55
movd esi, xmm2
mov eax, esi
mul edi
mov dword [esp + 0x68], edx
mov dword [esp + 0x64], eax
mov eax, ecx
mul dword [esp + 0x14]
mov dword [esp + 0x5c], edx
mov dword [esp + 0x58], eax
mov eax, esi
mul dword [esp + 0x14]
mov dword [esp + 0x6c], edx
mov dword [esp + 0x30], eax
mov eax, ecx
mul dword [esp + 0x2c]
mov dword [esp + 0x2c], edx
mov dword [esp + 0x60], eax
mov eax, dword [esp + 8]
mul dword [esp + 0x38]
mov dword [esp + 8], eax
mov dword [esp + 0x14], edx
mov eax, dword [esp + 0x74]
mov ecx, eax
shr ecx, 0x1a
mov esi, dword [esp + 0x3c]
shld eax, esi, 6
and esi, 0x3ffffff
mov dword [esp + 0x3c], esi
mov edx, dword [esp + 0x1c]
add edx, dword [esp + 0x88]
mov esi, dword [esp + 0x70]
adc esi, dword [esp + 0x8c]
add edx, dword [esp + 0x7c]
adc esi, dword [esp + 0x84]
add edx, dword [esp + 0x78]
adc esi, dword [esp + 0x80]
add edx, dword [esp + 0x50]
adc esi, dword [esp + 0x54]
add edx, eax
adc esi, ecx
shld esi, edx, 6
mov eax, esi
and edx, 0x3ffffff
mov dword [esp + 0x1c], edx
mov ecx, dword [esp + 0x18]
add ecx, dword [esp + 0xa4]
adc ebx, dword [esp + 0xac]
add ecx, dword [esp + 0x94]
adc ebx, dword [esp + 0x9c]
add ecx, dword [esp + 0x58]
adc ebx, dword [esp + 0x5c]
add ecx, dword [esp + 0x64]
mov esi, ecx
adc ebx, dword [esp + 0x68]
mov ecx, dword [esp + 0x90]
add ecx, dword [esp + 0xa0]
mov edx, dword [esp + 0x98]
adc edx, dword [esp + 0xa8]
add ecx, dword [esp + 0x60]
adc edx, dword [esp + 0x2c]
add ecx, dword [esp + 0x30]
adc edx, dword [esp + 0x6c]
add ecx, dword [esp + 0xb0]
adc edx, dword [esp + 0xb4]
add esi, eax
mov dword [esp + 0x18], esi
mov edi, dword [esp + 0xc]
adc ebx, 0
shld ebx, esi, 6
add ebx, ecx
pshufd xmm0, xmm0, 0xd4
shufps xmm1, xmm1, 0xc5
adc edx, 0
shld edx, ebx, 6
pmuludq xmm1, xmm0
pshufd xmm0, xmm1, 0xee
movd ecx, xmm0
add ecx, dword [esp + 8]
pshufd xmm0, xmm1, 0xff
movd esi, xmm0
adc esi, dword [esp + 0x14]
movd eax, xmm1
add eax, ecx
pshufd xmm0, xmm1, 0x55
movd ecx, xmm0
adc ecx, esi
movd xmm0, ebx
add eax, dword [esp + 0xb8]
adc ecx, dword [esp + 0x20]
add eax, dword [esp + 0x24]
adc ecx, dword [esp + 0x28]
add eax, edx
adc ecx, 0
shld ecx, eax, 6
movd xmm1, dword [esp + 0x18]
lea ecx, [ecx + ecx*4]
add ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x1c]
mov dword [edi + 0x28], edx
punpckldq xmm1, xmm0
pand xmm1, xmmword [0x9471b0]
movq qword [edi + 0x2c], xmm1
and eax, 0x3ffffff
mov dword [edi + 0x34], eax
mov dword [edi + 0x24], ecx
mov esi, dword [esp + 0x10]
cmp esi, 0xf
mov edx, dword [esp + 0x34]
ja 0x8511cd
test esi, esi
je 0x8516d3
mov eax, esi
and eax, 3
xor ecx, ecx
mov dword [esp + 0x10], esi
cmp esi, 4
jb 0x85160a
mov esi, dword [esp + 0x10]
and esi, 0xc
xor ecx, ecx
nop dword [eax]
movzx ebx, byte [edx + ecx]
mov byte [esp + ecx + 0x40], bl
movzx ebx, byte [edx + ecx + 1]
mov byte [esp + ecx + 0x41], bl
movzx ebx, byte [edx + ecx + 2]
mov byte [esp + ecx + 0x42], bl
movzx ebx, byte [edx + ecx + 3]
mov byte [esp + ecx + 0x43], bl
add ecx, 4
cmp esi, ecx
jne 0x8515e0
mov dword [esp + 0x34], edx
test eax, eax
je 0x85162c
lea edx, [esp + ecx]
add edx, 0x40
add ecx, dword [esp + 0x34]
xor esi, esi
nop
movzx ebx, byte [ecx + esi]
mov byte [edx + esi], bl
inc esi
cmp eax, esi
jne 0x851620
mov ecx, dword [esp + 0x10]
mov byte [esp + ecx + 0x40], 1
cmp ecx, 0xf
je 0x851650
lea eax, [esp + 0x40]
add eax, ecx
inc eax
xor ecx, 0xf
push ecx
push 0
push eax
call sub.api_ms_win_crt_string_l1_1_0.dll_memset
add esp, 0xc
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x44]
shld ecx, eax, 6
mov edx, eax
and edx, 0x3ffffff
add edx, dword [edi + 0x24]
and ecx, 0x3ffffff
add ecx, dword [edi + 0x28]
movsd xmm1, qword [esp + 0x48]
xorps xmm2, xmm2
xorps xmm3, xmm3
movss xmm3, xmm1
unpcklps xmm2, xmm1
movss xmm0, dword [esp + 0x44]
movlhps xmm0, xmm3
orps xmm0, xmm2
movaps xmm2, xmm0
psrlq xmm2, 0x14
psrlq xmm0, 0xe
movsd xmm0, xmm2
shufps xmm0, xmm0, 0xe8
andps xmm0, xmmword [0x9471b0]
movq xmm2, qword [edi + 0x2c]
paddd xmm0, xmm2
shufps xmm1, xmm1, 0x55
movd eax, xmm1
shr eax, 8
add eax, dword [edi + 0x34]
mov dword [esp + 8], eax
mov dword [esp + 0x10], 0
jmp 0x851261
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret