Function at 0x56ad90
Capabilities:
Encrypt data using rc4 prga

Disassembly:
sub esp, 0x18
mov eax, dword [esp + 0x38]
mov dword [esp + 8], ecx
mov ecx, dword [esp + 0x2c]
push ebx
push ebp
push esi
mov eax, dword [eax + ecx*4]
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x40]
push edi
mov edi, 1
mov dword [esp + 0x10], edx
mov eax, dword [eax + ecx*4]
cmp eax, edi
mov dword [esp + 0x14], eax
cmovg edi, eax
mov eax, edi
cdq
xor eax, edx
sub eax, edx
test eax, 0xffff0000
je 0x56addd
sar eax, 0x10
mov ecx, eax
call fcn.00553040
jmp 0x56ade7
mov ecx, eax
call fcn.00553040
add eax, 0x10
lea ebp, [eax - 1]
mov eax, 0x1fffffff
mov ecx, ebp
cdq
shl edi, cl
mov esi, edi
movzx edi, di
sar esi, 0x10
idiv esi
mov ebx, eax
movsx edx, bx
imul edi, edx
mov ecx, edx
imul ecx, esi
sar edi, 0x10
add edi, ecx
mov ecx, ebx
neg edi
sar ecx, 0xf
shl edi, 3
inc ecx
movzx eax, di
sar ecx, 1
imul ecx, edi
imul eax, edx
sar edi, 0x10
imul edi, edx
shl ebx, 0x10
sar eax, 0x10
add ecx, eax
add ecx, edi
mov edi, 0xe
add ecx, ebx
sub edi, ebp
mov dword [esp + 0x48], ecx
test edi, edi
jg 0x56ae91
mov eax, dword [esp + 0x48]
mov ecx, edi
neg ecx
mov esi, closesocket
mov edx, closesocket
sar esi, cl
sar edx, cl
cmp esi, edx
jle 0x56ae74
cmp eax, esi
jg 0x56ae89
cmp eax, edx
mov esi, eax
cmovl esi, edx
neg edi
mov ecx, edi
shl esi, cl
jmp 0x56aea0
cmp eax, edx
jle 0x56ae82
neg edi
mov esi, edx
mov ecx, edi
shl esi, cl
jmp 0x56aea0
cmp eax, esi
cmovl eax, esi
mov esi, eax
neg edi
mov ecx, edi
shl esi, cl
jmp 0x56aea0
cmp edi, 0x20
jge 0x56ae9e
mov esi, ecx
mov ecx, edi
sar esi, cl
jmp 0x56aea0
xor esi, esi
mov ebx, dword [esp + 0x10]
mov eax, dword [esp + 0x14]
mov dword [esp + 0x48], esi
mov ecx, dword [ebx + 0x1114]
cmp eax, ecx
je 0x56aec5
push ecx
mov edx, eax
call fcn.0056a140
add esp, 4
mov ebp, eax
jmp 0x56aeca
mov ebp, 0x10000
mov ecx, dword [esp + 0x18]
mov eax, esi
sar eax, 7
inc eax
mov dword [esp + 0x44], ebp
sar eax, 1
mov ecx, dword [ecx + 0x1204]
mov dword [esp + 0x20], ecx
test ecx, ecx
jle 0x56af46
mov edi, dword [esp + 0x30]
mov ecx, eax
mov ebx, dword [esp + 0x20]
sar ecx, 0xf
inc ecx
movsx esi, ax
mov eax, dword [esp + 0x2c]
sar ecx, 1
sub eax, edi
mov dword [esp + 0x24], ecx
mov ebp, ecx
mov dword [esp + 0x2c], eax
jmp 0x56af10
mov edx, dword [eax + edi]
lea edi, [edi + 4]
movzx ecx, dx
mov eax, edx
imul ecx, esi
sar eax, 0x10
imul eax, esi
imul edx, ebp
sar ecx, 0x10
add ecx, eax
mov eax, dword [esp + 0x2c]
add ecx, edx
mov dword [edi - 4], ecx
sub ebx, 1
jne 0x56af10
mov esi, dword [esp + 0x48]
mov ebx, dword [esp + 0x10]
mov ebp, dword [esp + 0x44]
cmp dword [ebx + 0x1118], 0
mov eax, dword [esp + 0x14]
mov dword [ebx + 0x1114], eax
je 0x56afcc
cmp dword [esp + 0x3c], 0
jne 0x56af79
movsx eax, word [esp + 0x40]
movzx ecx, si
sar esi, 0x10
imul ecx, eax
imul esi, eax
sar ecx, 0x10
add esi, ecx
shl esi, 2
mov eax, dword [ebx + 0x1108]
mov edi, eax
sub edi, dword [esp + 0x1c]
sub edi, 2
cmp edi, eax
jge 0x56afcc
mov ebp, dword [esp + 0x38]
movzx eax, si
mov dword [esp + 0x3c], eax
sar esi, 0x10
lea ebx, [ebx]
mov ecx, dword [esp + 0x34]
mov edx, eax
mov eax, esi
movsx ecx, word [ecx + edi*2]
imul edx, ecx
imul eax, ecx
sar edx, 0x10
add edx, eax
mov eax, dword [esp + 0x3c]
mov dword [ebp + edi*4], edx
inc edi
cmp edi, dword [ebx + 0x1108]
jl 0x56afa0
mov ebp, dword [esp + 0x44]
cmp ebp, 0x10000
je 0x56b13c
mov ecx, dword [esp + 0x18]
mov edi, ebp
mov eax, dword [ebx + 0x110c]
mov edx, eax
sar edi, 0x10
sub edx, dword [ecx + 0x1208]
movzx ecx, bp
mov dword [esp + 0x48], edx
mov dword [esp + 0x3c], ecx
cmp edx, eax
jge 0x56b03e
lea esi, [edx + 0x140]
lea esi, [ebx + esi*4]
mov ecx, dword [esi]
lea esi, [esi + 4]
movsx edx, word [esi - 4]
sar ecx, 0xf
mov eax, edx
imul eax, dword [esp + 0x3c]
inc ecx
sar ecx, 1
imul ecx, ebp
imul edx, edi
sar eax, 0x10
add ecx, eax
mov eax, dword [esp + 0x48]
add ecx, edx
inc eax
mov dword [esi - 4], ecx
mov dword [esp + 0x48], eax
cmp eax, dword [ebx + 0x110c]
jl 0x56b007
cmp dword [esp + 0x4c], 2
jne 0x56b096
cmp dword [ebx + 0x1118], 0
jne 0x56b096
mov eax, dword [ebx + 0x1108]
mov esi, eax
sub esi, dword [esp + 0x1c]
sub esi, 2
cmp esi, eax
jge 0x56b096
mov eax, dword [esp + 0x38]
mov ecx, dword [eax + esi*4]
movsx edx, word [eax + esi*4]
mov eax, dword [esp + 0x3c]
sar ecx, 0xf
inc ecx
imul eax, edx
sar ecx, 1
imul ecx, ebp
imul edx, edi
sar eax, 0x10
add ecx, eax
mov eax, dword [esp + 0x38]
add ecx, edx
mov dword [eax + esi*4], ecx
inc esi
cmp esi, dword [ebx + 0x1108]
jl 0x56b065
mov ecx, dword [ebx + 0x1100]
lea esi, [ebx + 0xf00]
movsx edx, word [ebx + 0x1100]
sar ecx, 0xf
mov eax, edx
imul eax, dword [esp + 0x3c]
inc ecx
sar ecx, 1
imul ecx, ebp
imul edx, edi
sar eax, 0x10
add ecx, eax
add ecx, edx
mov dword [ebx + 0x1100], ecx
mov ebx, 0x20
mov edi, edi
mov ecx, dword [esi]
lea esi, [esi + 4]
movsx edx, word [esi - 4]
sar ecx, 0xf
mov eax, edx
imul eax, dword [esp + 0x3c]
inc ecx
sar ecx, 1
imul ecx, ebp
imul edx, edi
sar eax, 0x10
add ecx, eax
add ecx, edx
mov dword [esi - 4], ecx
sub ebx, 1
jne 0x56b0d0
mov esi, dword [esp + 0x10]
mov ebx, dword [esp + 0x3c]
add esi, 0x10c0
mov dword [esp + 0x48], 0x10
mov ecx, dword [esi]
lea esi, [esi + 4]
movsx edx, word [esi - 4]
sar ecx, 0xf
mov eax, edx
inc ecx
imul eax, ebx
sar ecx, 1
imul ecx, ebp
imul edx, edi
sar eax, 0x10
add ecx, eax
add ecx, edx
sub dword [esp + 0x48], 1
mov dword [esi - 4], ecx
jne 0x56b111
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret