Function at 0x56c900
Capabilities:
Encrypt data using rc4 prga

Disassembly:
sub esp, 0x18
mov eax, dword [esp + 0x40]
mov dword [esp + 8], ecx
mov ecx, dword [esp + 0x30]
push ebx
push ebp
push esi
mov eax, dword [eax + ecx*4]
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x48]
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 0x56c94d
sar eax, 0x10
mov ecx, eax
call fcn.00553040
jmp 0x56c957
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 + 0x50], ecx
test edi, edi
jg 0x56ca01
mov eax, dword [esp + 0x50]
mov ecx, edi
neg ecx
mov esi, closesocket
mov edx, closesocket
sar esi, cl
sar edx, cl
cmp esi, edx
jle 0x56c9e4
cmp eax, esi
jg 0x56c9f9
cmp eax, edx
mov esi, eax
cmovl esi, edx
neg edi
mov ecx, edi
shl esi, cl
jmp 0x56ca10
cmp eax, edx
jle 0x56c9f2
neg edi
mov esi, edx
mov ecx, edi
shl esi, cl
jmp 0x56ca10
cmp eax, esi
cmovl eax, esi
mov esi, eax
neg edi
mov ecx, edi
shl esi, cl
jmp 0x56ca10
cmp edi, 0x20
jge 0x56ca0e
mov esi, ecx
mov ecx, edi
sar esi, cl
jmp 0x56ca10
xor esi, esi
mov ebp, dword [esp + 0x10]
mov eax, dword [esp + 0x14]
mov dword [esp + 0x50], esi
mov ecx, dword [ebp + 0x1114]
cmp eax, ecx
je 0x56ca35
push ecx
mov edx, eax
call fcn.0056a140
add esp, 4
mov ebx, eax
jmp 0x56ca3a
mov ebx, 0x10000
mov ecx, dword [esp + 0x18]
mov eax, esi
sar eax, 7
inc eax
mov dword [esp + 0x4c], ebx
sar eax, 1
mov ecx, dword [ecx + 0x1204]
mov dword [esp + 0x20], ecx
test ecx, ecx
jle 0x56cab6
mov edi, dword [esp + 0x34]
mov ecx, eax
mov ebp, dword [esp + 0x20]
sar ecx, 0xf
inc ecx
movsx esi, ax
mov eax, dword [esp + 0x30]
sar ecx, 1
sub eax, edi
mov dword [esp + 0x24], ecx
mov ebx, ecx
mov dword [esp + 0x30], eax
jmp 0x56ca80
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, ebx
sar ecx, 0x10
add ecx, eax
mov eax, dword [esp + 0x30]
add ecx, edx
mov dword [edi - 4], ecx
sub ebp, 1
jne 0x56ca80
mov ebx, dword [esp + 0x4c]
mov esi, dword [esp + 0x50]
mov ebp, dword [esp + 0x10]
cmp dword [ebp + 0x1118], 0
mov eax, dword [esp + 0x14]
mov dword [ebp + 0x1114], eax
je 0x56cb3b
cmp dword [esp + 0x40], 0
jne 0x56cae9
movsx eax, word [esp + 0x48]
movzx ecx, si
sar esi, 0x10
imul ecx, eax
imul esi, eax
sar ecx, 0x10
add esi, ecx
shl esi, 2
mov eax, dword [ebp + 0x1108]
mov edi, eax
sub edi, dword [esp + 0x1c]
sub edi, 2
cmp edi, eax
jge 0x56cb3b
mov ebx, dword [esp + 0x3c]
movzx eax, si
mov dword [esp + 0x40], eax
sar esi, 0x10
lea ebx, [ebx]
mov ecx, dword [esp + 0x38]
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 + 0x40]
mov dword [ebx + edi*4], edx
inc edi
cmp edi, dword [ebp + 0x1108]
jl 0x56cb10
mov ebx, dword [esp + 0x4c]
cmp ebx, 0x10000
je 0x56cd70
mov eax, dword [ebp + 0x110c]
mov ecx, eax
mov edx, dword [esp + 0x18]
mov ebp, ebx
movzx edi, bx
sar ebp, 0x10
mov dword [esp + 0x50], edi
sub ecx, dword [edx + 0x1208]
mov dword [esp + 0x40], ecx
cmp ecx, eax
jge 0x56cbbb
mov esi, dword [esp + 0x10]
add esi, 0x500
lea esi, [esi + ecx*4]
lea ebx, [ebx]
mov ecx, dword [esi]
lea esi, [esi + 4]
movsx edx, word [esi - 4]
sar ecx, 0xf
mov eax, edx
inc ecx
imul eax, edi
sar ecx, 1
imul ecx, ebx
imul edx, ebp
sar eax, 0x10
add ecx, eax
mov eax, dword [esp + 0x10]
add ecx, edx
mov dword [esi - 4], ecx
mov ecx, dword [esp + 0x40]
inc ecx
mov dword [esp + 0x40], ecx
cmp ecx, dword [eax + 0x110c]
jl 0x56cb80
jmp 0x56cbbf
mov eax, dword [esp + 0x10]
cmp dword [esp + 0x54], 2
jne 0x56cc2d
cmp dword [eax + 0x1118], 0
jne 0x56cc2d
mov eax, dword [eax + 0x1108]
mov esi, eax
sub esi, dword [esp + 0x1c]
sub eax, dword [esp + 0x58]
sub esi, 2
cmp esi, eax
jge 0x56cc2d
jmp 0x56cbf0
mov eax, dword [esp + 0x3c]
mov ecx, dword [eax + esi*4]
movsx edx, word [eax + esi*4]
sar ecx, 0xf
mov eax, edx
inc ecx
imul eax, edi
sar ecx, 1
imul ecx, ebx
imul edx, ebp
sar eax, 0x10
add ecx, eax
mov eax, dword [esp + 0x3c]
add ecx, edx
mov dword [eax + esi*4], ecx
inc esi
mov eax, dword [esp + 0x10]
mov eax, dword [eax + 0x1108]
sub eax, dword [esp + 0x58]
cmp esi, eax
jl 0x56cbf0
cmp dword [esp + 0x44], 0
jle 0x56cd70
mov eax, dword [esp + 0x2c]
add eax, 0x480
mov dword [esp + 0x40], eax
mov edx, dword [eax]
movsx ecx, word [eax]
mov eax, edi
sar edx, 0xf
inc edx
imul eax, ecx
sar edx, 1
imul edx, ebx
sar eax, 0x10
add edx, eax
mov eax, ebp
imul eax, ecx
add edx, eax
mov eax, dword [esp + 0x40]
xor esi, esi
mov dword [eax], edx
lea esp, [esp]
mov edx, dword [eax + esi*4 - 0x480]
movsx ecx, word [eax + esi*4 - 0x480]
mov eax, edi
sar edx, 0xf
inc edx
imul eax, ecx
sar edx, 1
imul edx, ebx
sar eax, 0x10
add edx, eax
mov eax, ebp
imul eax, ecx
add edx, eax
mov eax, dword [esp + 0x40]
mov dword [eax + esi*4 - 0x480], edx
inc esi
cmp esi, 0x20
jl 0x56cc70
add eax, 0xffffff40
mov dword [esp + 0x24], eax
lea edi, [eax + 0x80]
mov eax, 0x10
mov edi, edi
mov edx, dword [edi]
lea edi, [edi + 4]
movsx esi, word [edi - 4]
sar edx, 0xf
mov ecx, esi
imul ecx, dword [esp + 0x50]
inc edx
sar edx, 1
imul edx, ebx
imul esi, ebp
sar ecx, 0x10
add edx, ecx
add edx, esi
mov dword [edi - 4], edx
sub eax, 1
jne 0x56ccc0
mov eax, dword [esp + 0x24]
mov edi, dword [esp + 0x50]
mov dword [esp + 0x4c], 0x20
jmp 0x56cd00
mov esi, dword [eax - 0x80]
lea eax, [eax + 4]
movsx edx, word [eax - 0x84]
mov ecx, edi
sar esi, 0xf
inc esi
imul ecx, edx
sar esi, 1
imul esi, ebx
sar ecx, 0x10
add esi, ecx
mov ecx, ebp
imul ecx, edx
movsx edx, word [eax - 4]
add esi, ecx
mov ecx, edi
mov dword [eax - 0x84], esi
mov esi, dword [eax - 4]
sar esi, 0xf
inc esi
imul ecx, edx
sar esi, 1
imul esi, ebx
sar ecx, 0x10
add esi, ecx
mov ecx, ebp
imul ecx, edx
add esi, ecx
sub dword [esp + 0x4c], 1
mov dword [eax - 4], esi
jne 0x56cd00
mov eax, dword [esp + 0x40]
add eax, 0x490
sub dword [esp + 0x44], 1
mov dword [esp + 0x40], eax
jne 0x56cc45
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret