Function at 0x516fc0
Capabilities:
Encrypt data using rc4 ksa
Resolve function by parsing pe exports

Disassembly:
push 0xffffffffffffffff
push 0x54310c
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0xb0
mov eax, dword [0x57f188]
push ebx
push ebp
push esi
mov ecx, dword [eax]
push edi
push 0x10070002
push eax
call dword [ecx + 0xc]
mov edi, eax
xor ebp, ebp
cmp edi, ebp
mov dword [esp + 0x44], edi
mov dword [esp + 0xb8], edi
je 0x51700e
mov edx, dword [edi]
push 0x7fffffff
push 1
push edi
call dword [edx]
cmp edi, ebp
mov dword [esp + 0xc8], ebp
jne 0x517020
xor al, al
jmp 0x51757b
mov esi, dword [esp + 0xd0]
mov ebx, dword [edi]
push esi
mov eax, dword [esi]
call dword [eax + 0x18]
mov ecx, dword [esi]
push eax
push esi
call dword [ecx + 0x14]
push eax
push edi
call dword [ebx + 0x2c]
mov ebx, eax
cmp ebx, ebp
mov dword [esp + 0x38], ebx
mov dword [esp + 0xbc], ebx
je 0x517058
mov edx, dword [ebx]
push 0x7fffffff
push 1
push ebx
call dword [edx]
cmp ebx, ebp
mov byte [esp + 0xc8], 1
jne 0x517083
mov eax, dword [edi]
push 0x7fffffff
push 1
push edi
mov dword [esp + 0xd4], 0xffffffff
call dword [eax + 4]
xor al, al
jmp 0x51757b
mov ebx, dword [esp + 0xd4]
xor edi, edi
mov eax, dword [ebx + 8]
test eax, eax
jle 0x5170b7
mov edx, dword [ebx + 0xc]
xor ecx, ecx
test edx, edx
jle 0x5170af
mov eax, dword [ebx + 4]
mov edx, dword [eax]
add eax, 4
add edi, dword [edx + ebp*4]
mov edx, dword [ebx + 0xc]
inc ecx
cmp ecx, edx
jl 0x51709f
mov eax, dword [ebx + 8]
inc ebp
cmp ebp, eax
jl 0x517096
mov ebp, dword [esp + 0x38]
lea ecx, [esp + 0x98]
mov dword [esp + 0x88], esi
mov dword [esp + 0x8c], ebp
mov dword [esp + 0x90], ebx
mov dword [esp + 0x94], edi
call fcn.00518f60
lea ecx, [esp + 0xa8]
mov byte [esp + 0xc8], 2
call fcn.00518f60
mov ecx, dword [esp + 0x88]
mov byte [esp + 0xc8], 3
push ecx
lea ecx, [esp + 0x9c]
call fcn.0050b2d0
mov edx, dword [esp + 0x8c]
lea ecx, [esp + 0xa8]
push edx
call fcn.0050b2d0
lea ecx, [esp + 0x68]
mov byte [esp + 0xc8], 4
mov dword [esp + 0x58], esi
mov dword [esp + 0x5c], ebp
mov dword [esp + 0x60], ebx
mov dword [esp + 0x64], edi
call fcn.00518f60
lea ecx, [esp + 0x78]
mov byte [esp + 0xc8], 5
call fcn.00518f60
mov eax, dword [esp + 0x58]
lea ecx, [esp + 0x68]
push eax
mov byte [esp + 0xcc], 6
call fcn.0050b2d0
mov ecx, dword [esp + 0x5c]
push ecx
lea ecx, [esp + 0x7c]
call fcn.0050b2d0
mov edx, dword [esi]
mov edi, dword [ebx + 0xc]
push esi
mov byte [esp + 0xcc], 7
call dword [edx + 0x18]
mov ecx, eax
mov eax, edi
cdq
mov ebp, dword [ebx + 8]
sub eax, edx
sar eax, 1
sub ecx, eax
mov eax, dword [esi]
push esi
mov dword [esp + 0x30], ecx
call dword [eax + 0x14]
mov edi, eax
mov eax, ebp
cdq
sub eax, edx
sar eax, 1
sub edi, eax
mov eax, dword [ebx + 0xc]
cdq
sub eax, edx
mov dword [esp + 0x10], edi
mov ecx, eax
mov eax, dword [ebx + 8]
cdq
sub eax, edx
mov ebx, eax
sar ecx, 1
sar ebx, 1
mov dword [esp + 0x24], ecx
mov dword [esp + 0x18], ebx
mov dword [esp + 0x14], ebx
cmp ebx, edi
jge 0x51739d
jmp 0x5171e3
mov ecx, dword [esp + 0x24]
mov eax, dword [esp + 0x24]
mov edi, ecx
mov ecx, dword [esp + 0x2c]
mov dword [esp + 0x3c], edi
cmp eax, ecx
jge 0x517386
mov ecx, dword [esp + 0x60]
mov ebx, dword [ecx + 0xc]
mov esi, dword [ecx + 8]
mov eax, ebx
cdq
sub eax, edx
mov ebp, eax
mov eax, esi
cdq
sub eax, edx
mov ecx, eax
mov eax, dword [esp + 0x14]
sar ecx, 1
add ecx, eax
mov eax, ebx
cdq
sub eax, edx
mov ebx, edi
sar eax, 1
sub ebx, eax
mov eax, esi
cdq
sub eax, edx
mov dword [esp + 0x48], ecx
mov edx, eax
mov eax, dword [esp + 0x14]
sar edx, 1
sar ebp, 1
sub eax, edx
add ebp, edi
xor edx, edx
cmp eax, ecx
mov dword [esp + 0x50], ebp
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x1c], edx
mov dword [esp + 0x28], edx
mov dword [esp + 0x20], edx
mov dword [esp + 0x34], eax
jg 0x5172f8
mov dword [esp + 0x30], edx
cmp ebx, ebp
jg 0x5172dc
mov eax, dword [esp + 0x6c]
mov ecx, dword [esp + 0x60]
sub ebp, ebx
mov esi, dword [ecx + 4]
lea edi, [eax + ebx*4]
inc ebp
mov eax, dword [esi]
mov edx, dword [esp + 0x30]
mov ecx, dword [esp + 0x34]
mov ebx, dword [esp + 0x1c]
mov edx, dword [edx + eax]
mov eax, dword [edi]
add esi, 4
add edi, 4
mov ecx, dword [eax + ecx*4]
xor eax, eax
mov dword [esp + 0x40], ecx
mov al, byte [esp + 0x42]
imul eax, edx
add ebx, eax
xor eax, eax
mov al, ch
and ecx, 0xff
imul eax, edx
imul ecx, edx
mov dword [esp + 0x1c], ebx
mov ebx, dword [esp + 0x28]
add ebx, eax
mov dword [esp + 0x28], ebx
mov ebx, dword [esp + 0x20]
add ebx, ecx
dec ebp
mov dword [esp + 0x20], ebx
jne 0x517276
mov ebp, dword [esp + 0x50]
mov edi, dword [esp + 0x3c]
mov ecx, dword [esp + 0x48]
mov ebx, dword [esp + 0x4c]
mov eax, dword [esp + 0x30]
add eax, 4
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x34]
inc eax
cmp eax, ecx
mov dword [esp + 0x34], eax
jle 0x517261
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x64]
xor edx, edx
div ecx
xor edx, edx
mov esi, eax
mov eax, dword [esp + 0x28]
div ecx
xor edx, edx
mov ebx, eax
mov eax, dword [esp + 0x20]
div ecx
cmp esi, 0xff
jbe 0x517325
mov esi, 0xff
cmp ebx, 0xff
jbe 0x517332
mov ebx, 0xff
cmp eax, 0xff
jbe 0x51733e
mov eax, 0xff
mov ecx, dword [esp + 0x6c]
push eax
push ebx
push esi
mov ecx, dword [ecx + edi*4]
mov esi, dword [esp + 0x20]
mov edx, dword [ecx + esi*4]
lea ecx, [esp + 0x60]
shr edx, 0x18
push edx
call fcn.005175a0
mov eax, dword [esp + 0x7c]
mov ecx, dword [esp + 0x54]
mov eax, dword [eax + edi*4]
inc edi
mov dword [esp + 0x3c], edi
mov dword [eax + esi*4], ecx
mov eax, dword [esp + 0x2c]
cmp edi, eax
jl 0x5171f9
mov ebx, dword [esp + 0x18]
mov esi, dword [esp + 0xd0]
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
inc eax
cmp eax, ecx
mov dword [esp + 0x14], eax
jl 0x5171df
mov edi, ecx
mov edx, dword [esi]
push esi
xor ebp, ebp
call dword [edx + 0x18]
test eax, eax
jle 0x5173fa
xor edi, edi
test ebx, ebx
jle 0x5173c2
push ebp
push edi
lea ecx, [esp + 0x90]
call fcn.005175d0
inc edi
cmp edi, ebx
jl 0x5173af
mov eax, dword [esi]
mov edi, dword [esp + 0x10]
push esi
call dword [eax + 0x14]
mov ecx, edi
cmp ecx, eax
jge 0x5173eb
push ebp
push edi
lea ecx, [esp + 0x90]
call fcn.005175d0
mov ecx, dword [esi]
push esi
inc edi
call dword [ecx + 0x14]
cmp edi, eax
jl 0x5173d2
mov edx, dword [esi]
push esi
inc ebp
call dword [edx + 0x18]
cmp ebp, eax
jl 0x5173a9
mov edi, dword [esp + 0x10]
cmp ebx, edi
jge 0x51744b
mov ebp, dword [esp + 0x24]
xor edi, edi
test ebp, ebp
jle 0x51741b
push edi
push ebx
lea ecx, [esp + 0x90]
call fcn.005175d0
inc edi
cmp edi, ebp
jl 0x517408
mov eax, dword [esi]
mov edi, dword [esp + 0x2c]
push esi
call dword [eax + 0x18]
cmp edi, eax
jge 0x517442
push edi
push ebx
lea ecx, [esp + 0x90]
call fcn.005175d0
mov ecx, dword [esi]
push esi
inc edi
call dword [ecx + 0x18]
cmp edi, eax
jl 0x517429
mov eax, dword [esp + 0x10]
inc ebx
cmp ebx, eax
jl 0x5173fe
mov edi, dword [esp + 0x38]
mov edx, dword [esi]
push 0
push 0
push 0
push edi
push esi
call dword [edx + 0x44]
mov bl, al
lea eax, [esp + 0x78]
mov dword [esp + 0x18], eax
lea ecx, [esp + 0x7c]
mov byte [esp + 0xc8], 9
call fcn.00418e50
mov eax, dword [esp + 0x78]
mov byte [esp + 0xc8], 8
test eax, eax
je 0x517494
mov ecx, dword [eax]
push 0x7fffffff
push 1
push eax
call dword [ecx + 4]
lea edx, [esp + 0x68]
mov dword [esp + 0x18], edx
lea ecx, [esp + 0x6c]
mov byte [esp + 0xc8], 0xa
call fcn.00418e50
mov eax, dword [esp + 0x68]
mov byte [esp + 0xc8], 4
test eax, eax
je 0x5174ca
mov ecx, dword [eax]
push 0x7fffffff
push 1
push eax
call dword [ecx + 4]
lea edx, [esp + 0xa8]
mov dword [esp + 0x18], edx
lea ecx, [esp + 0xac]
mov byte [esp + 0xc8], 0xc
call fcn.00418e50
mov eax, dword [esp + 0xa8]
mov byte [esp + 0xc8], 0xb
test eax, eax
je 0x517509
mov ecx, dword [eax]
push 0x7fffffff
push 1
push eax
call dword [ecx + 4]
lea edx, [esp + 0x98]
mov dword [esp + 0x18], edx
lea ecx, [esp + 0x9c]
mov byte [esp + 0xc8], 0xd
call fcn.00418e50
mov eax, dword [esp + 0x98]
mov byte [esp + 0xc8], 1
test eax, eax
je 0x517548
mov ecx, dword [eax]
push 0x7fffffff
push 1
push eax
call dword [ecx + 4]
mov edx, dword [edi]
push 0x7fffffff
push 1
push edi
mov byte [esp + 0xd4], 0
call dword [edx + 4]
mov eax, dword [esp + 0x44]
push 0x7fffffff
push 1
push eax
mov ecx, dword [eax]
mov dword [esp + 0xd4], 0xffffffff
call dword [ecx + 4]
mov al, bl
mov ecx, dword [esp + 0xc0]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0xbc
ret