Function at 0x101679f0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
mov edx, dword [ebp + 0x10]
mov ecx, edx
push esi
mov esi, dword [ebp + 8]
push edi
sar ecx, 8
mov dword [ebp - 0x18], ecx
mov edi, dword [esi + 0x78]
mov eax, dword [esi + 0x54]
sar edi, 8
cmp edi, eax
jl 0x10167a26
cmp ecx, eax
jl 0x10167a26
mov eax, dword [ebp + 0xc]
pop edi
mov dword [esi + 0x74], eax
mov dword [esi + 0x78], edx
pop esi
mov esp, ebp
pop ebp
ret
mov eax, dword [esi + 0x50]
cmp edi, eax
jge 0x10167a31
cmp ecx, eax
jl 0x10167a17
mov eax, dword [esi + 0x74]
mov edx, eax
mov ecx, dword [ebp + 0xc]
push ebx
mov ebx, dword [ebp + 0xc]
sar ebx, 8
mov dword [ebp - 0x20], ebx
movzx ebx, al
mov dword [ebp - 0x10], ecx
sub dword [ebp - 0x10], eax
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp - 0x18]
mov dword [ebp - 0xc], eax
mov eax, dword [esi + 0x78]
sub dword [ebp - 0xc], eax
sar edx, 8
mov dword [ebp + 8], ebx
mov ebx, dword [esi + 0x78]
mov dword [ebp - 4], edx
movzx ebx, bl
cmp edx, dword [ebp - 0x20]
jne 0x10167a77
cmp edi, ecx
je 0x10167cb6
mov eax, dword [ebp - 0xc]
test eax, eax
jne 0x10167a9e
push ecx
push dword [ebp - 0x20]
push esi
call fcn.10167cf0
mov eax, dword [ebp + 0xc]
add esp, 0xc
mov dword [esi + 0x74], eax
mov eax, dword [ebp + 0x10]
mov dword [esi + 0x78], eax
pop ebx
pop edi
pop esi
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 0x10]
test ecx, ecx
jne 0x10167b13
test eax, eax
jle 0x10167ae5
nop dword [eax]
mov eax, 0x100
inc edi
sub eax, ebx
add dword [esi + 0x5c], eax
mov eax, 0x100
sub eax, ebx
xor ebx, ebx
imul eax, dword [ebp + 8]
push edi
push edx
push esi
add eax, eax
add dword [esi + 0x58], eax
call fcn.10167cf0
mov edx, dword [ebp - 4]
add esp, 0xc
cmp edi, dword [ebp - 0x18]
jne 0x10167ab0
jmp 0x10167cb6
mov eax, dword [ebp + 8]
dec edi
sub dword [esi + 0x5c], ebx
imul eax, ebx
mov ebx, 0x100
push edi
push edx
push esi
neg eax
add eax, eax
add dword [esi + 0x58], eax
call fcn.10167cf0
mov edx, dword [ebp - 4]
add esp, 0xc
cmp edi, dword [ebp - 0x18]
jne 0x10167ae5
jmp 0x10167cb6
imul eax, dword [ebp + 8]
imul ecx, ebx
sub ecx, eax
mov dword [ebp - 0x14], ecx
mov ecx, dword [ebp - 0x10]
cmp edx, dword [ebp - 0x20]
je 0x10167b34
mov eax, 0xffffff
cdq
idiv ecx
mov dword [ebp - 0x24], eax
jmp 0x10167b3b
mov dword [ebp - 0x24], 0
cmp edi, dword [ebp - 0x18]
je 0x10167b4e
mov eax, 0xffffff
cdq
idiv dword [ebp - 0xc]
mov dword [ebp - 0x28], eax
jmp 0x10167b55
mov dword [ebp - 0x28], 0
mov eax, ecx
shl eax, 8
mov dword [ebp - 0x1c], eax
mov ecx, eax
nop
mov edx, dword [ebp - 0x14]
mov dword [ebp - 8], ecx
test edx, edx
jg 0x10167bb1
mov ecx, eax
mov dword [ebp - 8], eax
mov eax, edx
sub eax, dword [ebp - 0x1c]
test eax, eax
jle 0x10167bb1
mov ecx, dword [ebp - 0x24]
mov eax, dword [ebp - 0xc]
neg eax
imul ecx, edx
shl eax, 8
add edx, eax
shr ecx, 0x18
mov eax, ecx
sub eax, ebx
add dword [esi + 0x5c], eax
mov eax, ecx
sub eax, ebx
mov ebx, ecx
imul eax, dword [ebp + 8]
mov dword [ebp + 8], 0x100
add dword [esi + 0x58], eax
dec dword [ebp - 4]
mov eax, dword [ebp - 0x1c]
jmp 0x10167c87
mov dword [ebp - 0x14], ecx
mov eax, edx
sub eax, ecx
mov ecx, dword [ebp - 0xc]
sub ecx, dword [ebp - 0x10]
shl ecx, 8
add ecx, edx
test eax, eax
jg 0x10167c0a
test ecx, ecx
jle 0x10167c02
mov edx, dword [ebp - 0x28]
mov ecx, eax
imul edx, ecx
mov eax, 0x100
sub eax, ebx
mov dword [ebp - 0x14], ecx
add dword [esi + 0x5c], eax
mov eax, 0x100
mov ecx, dword [ebp + 8]
sub eax, ebx
xor ebx, ebx
neg edx
shr edx, 0x18
add ecx, edx
mov dword [ebp + 8], edx
imul ecx, eax
add dword [esi + 0x58], ecx
inc edi
jmp 0x10167c8d
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 8], eax
jmp 0x10167c14
mov eax, dword [ebp - 0x14]
mov dword [ebp - 8], eax
test ecx, ecx
jg 0x10167c55
mov ecx, dword [ebp - 0xc]
shl ecx, 8
add ecx, edx
js 0x10167c5d
mov edx, dword [ebp - 0x24]
imul edx, ecx
mov dword [ebp - 0x14], ecx
shr edx, 0x18
mov eax, edx
mov ecx, edx
sub eax, ebx
sub ecx, ebx
add dword [esi + 0x5c], eax
mov ebx, edx
mov eax, dword [ebp + 8]
add eax, 0x100
mov dword [ebp + 8], 0
imul ecx, eax
mov eax, dword [ebp - 4]
add dword [esi + 0x58], ecx
inc eax
mov dword [ebp - 4], eax
jmp 0x10167c90
mov eax, dword [ebp - 0x14]
mov dword [ebp - 8], eax
jmp 0x10167c60
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 0x28]
sub dword [esi + 0x5c], ebx
imul ecx, edx
add edx, eax
mov eax, dword [ebp + 8]
neg ecx
shr ecx, 0x18
add eax, ecx
mov dword [ebp + 8], ecx
imul eax, ebx
mov ebx, 0x100
sub dword [esi + 0x58], eax
dec edi
mov eax, dword [ebp - 8]
mov dword [ebp - 8], eax
mov dword [ebp - 0x14], edx
mov eax, dword [ebp - 4]
push edi
push eax
push esi
call fcn.10167cf0
mov eax, dword [ebp - 0x20]
add esp, 0xc
cmp dword [ebp - 4], eax
mov ecx, dword [ebp - 8]
mov eax, dword [ebp - 0x1c]
jne 0x10167b60
cmp edi, dword [ebp - 0x18]
jne 0x10167b60
mov edx, dword [ebp + 0x10]
movzx ecx, dl
mov eax, ecx
mov dword [esi + 0x78], edx
sub eax, ebx
sub ecx, ebx
add dword [esi + 0x5c], eax
mov eax, dword [ebp + 0xc]
movzx eax, al
add eax, dword [ebp + 8]
imul eax, ecx
pop ebx
add dword [esi + 0x58], eax
mov eax, dword [ebp + 0xc]
mov dword [esi + 0x74], eax
pop edi
pop esi
mov esp, ebp
pop ebp
ret