Function at 0x10034ba0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
sub esp, 0x14
push ebx
mov ebx, dword [esp + 0x20]
mov ax, dx
mov word [esp + 4], ax
mov dword [esp + 0x10], ecx
movzx edx, ax
push ebp
push esi
push edi
mov edi, 0x10
test ebx, ebx
je 0x10034bfb
mov ebp, dword [ebx]
mov eax, edi
mov esi, ebp
and esi, 0xf
sub eax, esi
mov ecx, esi
mov dword [esp + 0x2c], eax
mov eax, edi
sub eax, esi
neg ecx
sbb ecx, ecx
and ecx, eax
cmp word [ecx + ebp + 0x146], di
jae 0x10034bfb
xor eax, eax
test esi, esi
cmovne eax, dword [esp + 0x2c]
add ebp, 0x160
add ebp, eax
jmp 0x10034bfd
xor ebp, ebp
movzx eax, word [esp + 0x10]
sub eax, 0
je 0x10034da6
sub eax, 1
je 0x10034da6
sub eax, 2
jne 0x10034e54
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x1c]
push eax
lea eax, [esp + 0x1c]
push eax
push 0x140
push dword [esp + 0x2c]
call fcn.10183e90
mov cl, byte [esp + 0x3c]
add esp, 0x14
mov ebx, dword [esp + 0x20]
mov edx, ebx
mov eax, dword [esp + 0x14]
mov edi, eax
mov esi, dword [esp + 0x18]
mov dword [esp + 0x2c], 1
shl dword [esp + 0x2c], cl
mov ecx, dword [esp + 0x2c]
test ecx, ecx
jle 0x10034ca0
mov dword [esp + 0x10], 0x100
nop dword [eax]
mov ax, word [edi]
lea edi, [edi + 2]
dec ecx
cmp ax, word [esp + 0x10]
jae 0x10034cf2
mov ax, word [esi]
add esi, 2
cmp ax, word [esp + 0x10]
jae 0x10034cf2
mov ax, word [edx]
add edx, 2
cmp ax, word [esp + 0x10]
jae 0x10034cf2
test ecx, ecx
jg 0x10034c70
mov eax, dword [esp + 0x14]
mov esi, dword [esp + 0x2c]
sub esi, 1
js 0x10034e54
mov edi, dword [esp + 0x18]
lea edx, [esi*4 + 1]
sub eax, edi
add edx, ebp
mov dword [esp + 0x2c], eax
sub ebx, edi
lea ecx, [edi + esi*2]
sub esi, 1
movzx eax, byte [ecx + eax]
mov byte [edx + 1], al
lea ecx, [ecx - 2]
movzx eax, byte [ecx + 2]
lea edx, [edx - 4]
mov byte [edx + 4], al
movzx eax, byte [ecx + ebx + 2]
mov byte [edx + 3], al
mov eax, dword [esp + 0x2c]
jns 0x10034cc5
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
mov edi, dword [esp + 0x2c]
sub edi, 1
js 0x10034e54
mov eax, dword [esp + 0x18]
mov esi, dword [esp + 0x14]
sub esi, eax
lea ecx, [eax + edi*2]
mov dword [esp + 0x1c], ecx
lea ecx, [edi*4 + 1]
add ecx, ebp
mov ebp, dword [esp + 0x1c]
mov dword [esp + 0x2c], ecx
sub ebx, eax
movzx eax, word [esi + ebp]
lea ebp, [ebp - 2]
imul ecx, eax, 0xff
mov eax, 0x80008001
imul ecx
add edx, ecx
mov ecx, dword [esp + 0x2c]
sar edx, 0xf
mov eax, edx
shr eax, 0x1f
add eax, edx
mov byte [ecx + 1], al
movzx eax, word [ebp + 2]
imul ecx, eax, 0xff
mov eax, 0x80008001
imul ecx
add edx, ecx
mov ecx, dword [esp + 0x2c]
sar edx, 0xf
mov eax, edx
shr eax, 0x1f
add eax, edx
mov byte [ecx], al
movzx eax, word [ebx + ebp + 2]
imul ecx, eax, 0xff
mov eax, 0x80008001
imul ecx
add edx, ecx
mov ecx, dword [esp + 0x2c]
sar edx, 0xf
mov eax, edx
shr eax, 0x1f
add eax, edx
mov byte [ecx - 1], al
sub ecx, 4
sub edi, 1
mov dword [esp + 0x2c], ecx
jns 0x10034d23
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
mov eax, dword [esp + 0x28]
cmp ax, 1
jne 0x10034dd7
test dx, dx
pop edi
setne al
dec al
neg dx
mov byte [ebp], al
mov byte [ebp + 1], al
sbb dl, dl
mov byte [ebp + 2], al
mov byte [ebp + 4], dl
mov byte [ebp + 5], dl
pop esi
mov byte [ebp + 6], dl
pop ebp
pop ebx
add esp, 0x14
ret
cmp ax, 4
je 0x10034de3
cmp ax, 8
jne 0x10034e54
test ebx, ebx
je 0x10034e54
mov ecx, dword [ebx]
mov eax, ecx
and eax, 0xf
sub edi, eax
neg eax
sbb eax, eax
and eax, edi
mov esi, dword [eax + ecx + 0x158]
test esi, esi
jle 0x10034e54
lea ecx, [esi - 1]
cmp edx, 1
jne 0x10034e31
mov eax, 0xff
xor ebx, ebx
cdq
idiv ecx
lea ecx, [ebp + 2]
mov byte [ecx - 2], bl
lea ecx, [ecx + 4]
mov byte [ecx - 5], bl
mov byte [ecx - 4], bl
add ebx, eax
sub esi, 1
jne 0x10034e16
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
mov eax, 0xffffff01
cdq
idiv ecx
lea ecx, [ebp + 2]
mov edx, 0xff
mov byte [ecx - 2], dl
lea ecx, [ecx + 4]
mov byte [ecx - 5], dl
mov byte [ecx - 4], dl
add edx, eax
sub esi, 1
jne 0x10034e41
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret