Function at 0x422170
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebx
push esi
push edi
push ebp
add esp, 0xfffffef8
mov esi, edx
mov dword [esp], eax
xor ebx, ebx
mov eax, dword [esi]
call fcn.004059bc
mov edi, eax
xor ecx, ecx
lea eax, [esp + 5]
mov edx, dword [esp]
mov dl, byte [edx + ecx + 4]
mov byte [eax], dl
inc ecx
inc eax
cmp ecx, 0x100
jne 0x422190
mov eax, edi
and eax, 3
mov byte [esp + 4], al
cmp byte [esp + 4], 0
jbe 0x4221db
mov al, 4
sub al, byte [esp + 4]
mov byte [esp + 4], al
xor eax, eax
mov al, byte [esp + 4]
add edi, eax
push edi
mov eax, esi
mov ecx, 1
mov edx, dword [0x421fec]
call fcn.00405b78
add esp, 4
mov eax, ebx
and eax, 0xff
mov al, byte [esp + eax + 5]
mov edx, dword [esi]
xor byte [edx + ebx], al
lea ebp, [ebx + 1]
mov eax, ebp
xor edx, edx
div edi
mov ecx, edx
mov eax, dword [esi]
movzx eax, byte [eax + ecx]
mov edx, dword [esi]
movzx edx, byte [edx + ebx]
add eax, edx
and ebp, 0xff
xor edx, edx
mov dl, byte [esp + ebp + 5]
add eax, edx
and eax, 0xff
push eax
mov eax, dword [esi]
pop edx
mov byte [eax + ecx], dl
lea eax, [ebx + 1]
xor edx, edx
div edi
mov eax, dword [esi]
movzx eax, byte [eax + edx]
lea edx, [ebx + 2]
and edx, 0xff
movzx edx, byte [esp + edx + 5]
sub eax, edx
and eax, 0x800000ff
jns 0x422249
dec eax
or eax, 0xffffff00
inc eax
push eax
lea eax, [ebx + 2]
xor edx, edx
div edi
mov eax, dword [esi]
lea edx, [eax + edx]
pop eax
add byte [edx], al
lea eax, [ebx + 2]
xor edx, edx
div edi
mov eax, dword [esi]
mov al, byte [eax + edx]
lea edx, [ebx + 3]
and edx, 0xff
xor al, byte [esp + edx + 5]
mov ebp, eax
and ebp, 0xff
lea eax, [ebx + 3]
xor edx, edx
div edi
mov eax, dword [esi]
movzx eax, byte [eax + edx]
add ebp, eax
mov eax, ebp
and eax, 0xff
push eax
lea eax, [ebx + 3]
xor edx, edx
div edi
mov eax, dword [esi]
lea edx, [eax + edx]
pop eax
mov byte [edx], al
mov eax, dword [esp]
cmp byte [eax + 0x105], 1
jne 0x42238a
test ebx, ebx
jbe 0x422364
mov eax, ebx
sub eax, 4
xor edx, edx
div edi
mov eax, dword [esi]
mov al, byte [eax + edx]
mov edx, dword [esi]
xor al, byte [edx + ebx]
and eax, 0xff
and eax, 0xff
mov edx, dword [esi]
mov byte [edx + ebx], al
mov eax, dword [esi]
mov al, byte [eax + ecx]
push eax
mov eax, ebx
sub eax, 3
xor edx, edx
div edi
mov eax, dword [esi]
lea edx, [eax + edx]
pop eax
xor al, byte [edx]
and eax, 0xff
and eax, 0xff
push eax
mov eax, dword [esi]
pop edx
mov byte [eax + ecx], dl
lea eax, [ebx + 2]
xor edx, edx
div edi
mov eax, dword [esi]
mov cl, byte [eax + edx]
mov eax, ebx
sub eax, 2
xor edx, edx
div edi
mov eax, dword [esi]
xor cl, byte [eax + edx]
and ecx, 0xff
and ecx, 0xff
lea eax, [ebx + 2]
xor edx, edx
div edi
mov eax, dword [esi]
mov byte [eax + edx], cl
lea eax, [ebx + 3]
xor edx, edx
div edi
mov eax, dword [esi]
mov cl, byte [eax + edx]
mov eax, ebx
dec eax
xor edx, edx
div edi
mov eax, dword [esi]
xor cl, byte [eax + edx]
and ecx, 0xff
and ecx, 0xff
lea eax, [ebx + 3]
xor edx, edx
div edi
mov eax, dword [esi]
mov byte [eax + edx], cl
xor ecx, ecx
lea ebp, [ecx + ebx]
mov eax, ebp
xor edx, edx
div edi
mov eax, dword [esi]
movzx eax, byte [eax + edx]
and eax, 0xff
and ebp, 0xff
add byte [esp + ebp + 5], al
inc ecx
cmp ecx, 4
jne 0x422366
add ebx, 4
cmp edi, ebx
ja 0x4221db
cmp byte [esp + 4], 0
jbe 0x4223ba
xor eax, eax
mov al, byte [esp + 4]
sub edi, eax
push edi
mov eax, esi
mov ecx, 1
mov edx, dword [0x421fec]
call fcn.00405b78
add esp, 4
add esp, 0x108
pop ebp
pop edi
pop esi
pop ebx
ret