Function at 0x5178d0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push 0xffffffffffffffff
push 0x5431a8
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x44
mov eax, dword [0x57f188]
push esi
push edi
push 0x10070002
mov ecx, dword [eax]
push eax
call dword [ecx + 0xc]
mov esi, eax
xor edi, edi
cmp esi, edi
mov dword [esp + 0x24], esi
mov dword [esp + 0x28], esi
je 0x517916
mov edx, dword [esi]
push 0x7fffffff
push 1
push esi
call dword [edx]
cmp esi, edi
mov dword [esp + 0x54], edi
jne 0x517931
pop edi
xor al, al
pop esi
mov ecx, dword [esp + 0x44]
mov dword fs:[0], ecx
add esp, 0x50
ret
push ebx
push ebp
mov dword [esp + 0x34], edi
lea eax, [esp + 0x12]
lea ecx, [esp + 0x38]
push eax
mov byte [esp + 0x60], 2
call fcn.0050e020
mov ebp, dword [esp + 0x64]
lea ecx, [esp + 0x34]
push ebp
mov byte [esp + 0x60], 4
call fcn.0050b2d0
mov dword [esp + 0x44], edi
lea ecx, [esp + 0x13]
mov byte [esp + 0x5c], 7
push ecx
lea ecx, [esp + 0x4c]
call fcn.0050e020
mov esi, dword [esp + 0x68]
lea ecx, [esp + 0x44]
push esi
mov byte [esp + 0x60], 9
call fcn.0050b2d0
mov edx, dword [esi]
push esi
mov byte [esp + 0x60], 0xa
xor ebx, ebx
mov dword [esp + 0x6c], edi
mov dword [esp + 0x18], edi
call dword [edx + 0x14]
test eax, eax
jle 0x5179f8
mov eax, dword [esi]
push esi
xor ebp, ebp
call dword [eax + 0x18]
test eax, eax
jle 0x5179e9
mov ecx, dword [esp + 0x48]
xor edx, edx
push esi
mov eax, dword [ecx + ebp*4]
xor ecx, ecx
mov dl, byte [eax + edi*4 + 2]
mov cl, byte [eax + edi*4 + 1]
add ebx, edx
mov edx, dword [esp + 0x6c]
add edx, ecx
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x6c], edx
mov edx, dword [eax + edi*4]
mov eax, dword [esi]
and edx, 0xff
add ecx, edx
inc ebp
mov dword [esp + 0x18], ecx
call dword [eax + 0x18]
cmp ebp, eax
jl 0x5179ac
mov ecx, dword [esi]
push esi
inc edi
call dword [ecx + 0x14]
cmp edi, eax
jl 0x5179a0
mov ebp, dword [esp + 0x64]
mov edx, dword [esi]
push esi
call dword [edx + 0x18]
mov edi, eax
mov eax, dword [esi]
push esi
call dword [eax + 0x14]
imul edi, eax
mov eax, ebx
xor edx, edx
div edi
mov ecx, dword [esi]
push esi
mov dword [esp + 0x28], eax
call dword [ecx + 0x18]
mov edx, dword [esi]
push esi
mov edi, eax
call dword [edx + 0x14]
imul edi, eax
mov eax, dword [esp + 0x68]
xor edx, edx
div edi
push esi
mov dword [esp + 0x6c], eax
mov eax, dword [esi]
call dword [eax + 0x18]
mov ecx, dword [esi]
push esi
mov edi, eax
call dword [ecx + 0x14]
imul edi, eax
mov eax, dword [esp + 0x14]
xor edx, edx
div edi
mov edx, dword [ebp]
xor edi, edi
push ebp
mov dword [esp + 0x1c], edi
mov dword [esp + 0x18], eax
call dword [edx + 0x14]
test eax, eax
jle 0x517c62
mov ebx, dword [esp + 0x64]
xor ebp, ebp
push ebx
mov eax, dword [ebx]
call dword [eax + 0x18]
test eax, eax
jle 0x517c48
mov ecx, dword [esp + 0x38]
mov eax, dword [ecx + ebp*4]
mov ecx, dword [esp + 0x6c]
mov edx, dword [eax + edi]
shr edx, 0x18
cmp edx, ecx
jb 0x517c39
xor ebx, ebx
xor ecx, ecx
mov bl, byte [eax + edi + 2]
mov cl, byte [eax + edi + 1]
mov eax, dword [eax + edi]
mov dword [esp + 0x1c], ecx
and eax, 0xff
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x24]
test eax, eax
jbe 0x517b09
mov eax, dword [esi]
push esi
call dword [eax + 0x18]
mov ecx, eax
mov eax, ebp
cdq
idiv ecx
mov eax, dword [esp + 0x48]
mov ecx, dword [esp + 0x38]
push esi
mov ebx, dword [eax + edx*4]
mov edx, dword [ecx + ebp*4]
mov eax, dword [esi]
mov dword [esp + 0x2c], edx
call dword [eax + 0x14]
mov ecx, eax
mov eax, dword [esp + 0x18]
cdq
idiv ecx
mov ecx, dword [esp + 0x28]
xor eax, eax
mov al, byte [ebx + edx*4 + 2]
xor edx, edx
mov dl, byte [edi + ecx + 2]
imul eax, edx
xor edx, edx
div dword [esp + 0x24]
mov ebx, eax
cmp ebx, 0xff
jbe 0x517b09
mov ebx, 0xff
mov eax, dword [esp + 0x68]
test eax, eax
jbe 0x517b73
mov edx, dword [esi]
push esi
call dword [edx + 0x18]
mov ecx, eax
mov eax, ebp
cdq
idiv ecx
mov eax, dword [esp + 0x48]
push esi
mov ecx, dword [eax + edx*4]
mov edx, dword [esp + 0x3c]
mov dword [esp + 0x2c], ecx
mov ecx, dword [esi]
mov eax, dword [edx + ebp*4]
mov dword [esp + 0x20], eax
call dword [ecx + 0x14]
mov ecx, eax
mov eax, dword [esp + 0x18]
cdq
idiv ecx
mov ecx, dword [esp + 0x28]
xor eax, eax
mov al, byte [ecx + edx*4 + 1]
mov ecx, dword [esp + 0x1c]
xor edx, edx
mov dl, byte [ecx + edi + 1]
imul eax, edx
xor edx, edx
div dword [esp + 0x68]
cmp eax, 0xff
mov dword [esp + 0x1c], eax
jbe 0x517b73
mov dword [esp + 0x1c], 0xff
mov eax, dword [esp + 0x14]
test eax, eax
jbe 0x517be2
mov edx, dword [esi]
push esi
call dword [edx + 0x18]
mov ecx, eax
mov eax, ebp
cdq
idiv ecx
mov eax, dword [esp + 0x48]
push esi
mov ecx, dword [eax + edx*4]
mov edx, dword [esp + 0x3c]
mov dword [esp + 0x2c], ecx
mov ecx, dword [esi]
mov eax, dword [edx + ebp*4]
mov dword [esp + 0x24], eax
call dword [ecx + 0x14]
mov ecx, eax
mov eax, dword [esp + 0x18]
cdq
idiv ecx
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x20]
mov eax, dword [eax + edx*4]
mov edx, dword [ecx + edi]
and eax, 0xff
and edx, 0xff
imul eax, edx
xor edx, edx
div dword [esp + 0x14]
cmp eax, 0xff
mov dword [esp + 0x20], eax
jbe 0x517be2
mov dword [esp + 0x20], 0xff
mov eax, dword [esp + 0x38]
and ebx, 0xff
shl ebx, 0x10
mov eax, dword [eax + ebp*4]
mov ecx, dword [eax + edi]
and ecx, 0xff00ffff
or ebx, ecx
xor ecx, ecx
mov dword [eax + edi], ebx
mov edx, dword [esp + 0x38]
mov ch, byte [esp + 0x1c]
mov ebx, dword [esp + 0x20]
mov eax, dword [edx + ebp*4]
mov edx, dword [eax + edi]
and dh, 0
or ecx, edx
mov dword [eax + edi], ecx
mov eax, dword [esp + 0x38]
mov eax, dword [eax + ebp*4]
mov ecx, dword [eax + edi]
mov edx, ecx
xor edx, ebx
mov ebx, dword [esp + 0x64]
and edx, 0xff
xor edx, ecx
mov dword [eax + edi], edx
mov eax, dword [ebx]
push ebx
inc ebp
call dword [eax + 0x18]
cmp ebp, eax
jl 0x517a76
mov ebp, dword [esp + 0x18]
mov ecx, dword [ebx]
inc ebp
push ebx
mov dword [esp + 0x1c], ebp
add edi, 4
call dword [ecx + 0x14]
cmp ebp, eax
jl 0x517a62
mov eax, dword [esp + 0x48]
pop ebp
test eax, eax
mov byte [esp + 0x58], 5
pop ebx
je 0x517c7a
push eax
call fcn.005265a0
add esp, 4
mov eax, dword [esp + 0x3c]
test eax, eax
je 0x517c8f
mov edx, dword [eax]
push 0x7fffffff
push 1
push eax
call dword [edx + 4]
mov eax, dword [esp + 0x30]
mov byte [esp + 0x54], 0
test eax, eax
je 0x517ca5
push eax
call fcn.005265a0
add esp, 4
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x517cba
mov ecx, dword [eax]
push 0x7fffffff
push 1
push eax
call dword [ecx + 4]
mov eax, dword [esp + 0x24]
push 0x7fffffff
push 1
push eax
mov edx, dword [eax]
mov dword [esp + 0x60], 0xffffffff
call dword [edx + 4]
mov ecx, dword [esp + 0x4c]
pop edi
mov al, 1
pop esi
mov dword fs:[0], ecx
add esp, 0x50
ret