Function at 0x165ec
Capabilities:
Encode data using xor
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x164
push ebx
push esi
push edi
push 6
mov dword [ebp - 0x40], 0xa5a5
mov word [ebp - 0x24], 0xa
xor esi, esi
pop ebx
mov eax, esi
xor ecx, ecx
sub eax, ecx
je 0x16650
dec eax
je 0x16645
dec eax
je 0x16638
dec eax
je 0x16630
dec eax
je 0x1662a
dec eax
jne 0x16663
inc word [ebp - 0x30]
jmp 0x16628
jmp 0x16663
mov word [ebp - 0x20], cx
jmp 0x16663
or word [ebp - 0x26], 0xffff
jmp 0x16663
mov word [ebp - 0x36], cx
push ecx
xor ecx, ecx
jecxz 0x16642
sub dword [ecx - 0x15], ebx
push ds
pop ecx
jmp 0x16663
mov word [ebp - 0x1e], cx
jo 0x1664e
jno 0x1664e
xor ebx, ebp
adc ebp, dword [edx + 3]
jmp 0x16663
push 3
lea ecx, [ebp - 0x3c]
pop edx
xor eax, eax
mov edi, ecx
stosd dword es:[edi], eax
add ecx, 8
dec edx
stosw word es:[edi], ax
jne 0x16656
inc esi
dec ebx
jne 0x1660a
mov esi, dword [ebp + 0xc]
xor edi, edi
cmp di, 3
jae case.0x16a67.0
movzx ecx, di
mov eax, ecx
imul eax, ecx
imul eax, ecx
imul eax, ecx
add eax, 7
sub eax, 7
je 0x166d9
dec eax
je 0x16696
sub eax, 0xf
je 0x166e5
jmp 0x166e2
movzx ecx, word [ebp - 0x1e]
mov eax, ecx
push 5
cdq
pop ebx
idiv ebx
xor ebx, ebx
mov eax, ecx
push 3
pop ecx
cmp edx, 2
cdq
setne bl
idiv ecx
dec edx
neg edx
sbb edx, edx
neg edx
or ebx, edx
je 0x166d2
mov ax, word [ebp - 0x20]
mov word [ebp - 0x22], 1
mov word [ebp - 0x26], ax
jp 0x166d0
jnp 0x166d0
push es
jmp 0x166e2
and word [ebp - 0x22], 0
jmp 0x166e2
inc word [ebp - 0x1e]
jbe 0x166e2
ja 0x166e2
add al, 0x47
inc edi
jmp 0x1666c
jns 0x166ea
js 0x166ea
add eax, 0x33b85d8b
leave
mov ebx, dword [ebp - 0x48]
xor ecx, ecx
cmp cx, 8
jae 0x16c4e
movzx eax, cx
lea edx, [eax + 1]
imul edx, eax
lea eax, [edx + 1]
cmp eax, 0x15
jg 0x167b1
je 0x16796
dec eax
je 0x1677b
dec eax
dec eax
je 0x16763
sub eax, 4
je 0x16749
sub eax, 6
jne 0x167fe
cmp dword [ebp - 0x44], 0
je 0x167fe
mov eax, dword [ebp - 0x50]
imul eax, dword [ebp - 0x44]
and eax, 0xffff
add ebx, eax
mov dword [ebp - 0x48], ebx
jmp 0x167fe
mov ebx, dword [ebp - 0x4c]
imul ebx, dword [ebp - 0x54]
and ebx, 0xffff
mov dword [ebp - 0x48], ebx
jb 0x1675e
jae 0x1675e
adc ch, cl
wait
add byte [eax], al
add bh, al
inc ebp
lodsb al, byte [esi]
pop edx
add dword [eax], eax
add byte [esi + 3], dh
jmp 0x167fe
mov dword [ebp - 0x54], 0x15a
jbe 0x1676f
ja 0x1676f
adc al, 0xc7
inc ebp
mov al, 0x35
dec esi
add byte [eax], al
mov dword [ebp - 0x50], 0x4e35
jmp 0x167fe
mov eax, dword [ebp - 0x40]
shr eax, 0x10
mov dword [ebp - 0x44], eax
jne 0x16789
je 0x16789
adc ecx, dword [ebx - 0xda3fbb]
inc dword [eax]
add byte [ecx + 0x68ebb445], cl
mov eax, dword [ebp - 0x40]
and eax, 0xffff
mov dword [ebp - 0x4c], eax
jmp 0x167fe
mov eax, dword [ebp - 0x50]
mov edx, ebx
imul eax, dword [ebp - 0x4c]
and edx, 0xffff
shl edx, 0x10
lea eax, [eax + edx + 1]
mov dword [ebp + 0xc], eax
jmp 0x167fe
cmp eax, 0x1f
je 0x167ec
cmp eax, 0x2b
je 0x167d8
cmp eax, 0x39
jne 0x167fe
movzx eax, word [ebp - 0x22]
push 2
cdq
pop edi
idiv edi
sub edx, 0
je 0x16804
dec edx
je 0x16b04
jmp 0x167fe
and dword [ebp + 0xc], 0x7fff
jns 0x167e4
js 0x167e4
adc eax, 0x890c458b
inc ebp
in al, dx
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x14], eax
jmp 0x167fe
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x40], eax
jmp 0x167f5
shr dword [ebp + 0xc], 0x10
jo 0x167fe
jno 0x167fe
adc dword [ecx - 0x17], eax
inc ecx
jmp 0x166ef
jmp 0x16800
movzx ecx, word [ebp - 0x14]
mov eax, ecx
push 0xb
cdq
pop edi
idiv edi
mov eax, ecx
push 7
pop ecx
mov edi, edx
sub edi, 5
neg edi
cdq
sbb edi, edi
idiv ecx
inc edi
dec edx
dec edx
neg edx
sbb edx, edx
inc edx
or edi, edx
je 0x16840
mov ax, word [ebp - 0x20]
mov word [ebp - 0x22], 1
mov word [ebp - 0x26], ax
jmp 0x166ed
movzx eax, word [ebp - 0x36]
cmp eax, 9
ja case.default.0x1684d
jmp dword [eax*4 + 0x16c58]
mov al, byte [esi + 0x11d]
xor byte [esi + 7], al
jmp 0x16860
mov eax, dword [esi + 0x11d]
xor dword [esi + 8], eax
jo 0x1686e
jno 0x1686e
inc ecx
mov ax, word [esi + 0x11d]
xor word [esi + 0x10], ax
jb 0x1687e
jae 0x1687e
inc edx
mov ax, word [esi + 0x11d]
xor word [esi + 0x12], ax
jne 0x1688e
je 0x1688e
inc ebx
jmp 0x169ac
mov al, byte [esi + 0x14]
xor byte [esi], al
jns 0x1689d
js 0x1689d
inc ebp
mov al, byte [esi + 0x15]
xor byte [esi + 1], al
jp 0x168a8
jnp 0x168a8
inc esi
mov al, byte [esi + 0x14]
xor byte [esi + 2], al
jl 0x168b3
jge 0x168b3
inc edi
mov al, byte [esi + 0x14]
xor byte [esi + 7], al
jle 0x168be
jg 0x168be
dec eax
mov eax, dword [esi + 0x14]
xor dword [esi + 8], eax
push ecx
xor ecx, ecx
jecxz 0x168ca
dec ecx
pop ecx
mov ax, word [esi + 0x14]
xor word [esi + 0x10], ax
jmp 0x168d6
mov ax, word [esi + 0x14]
xor word [esi + 0x12], ax
jo 0x168e3
jno 0x168e3
push ecx
jmp 0x169ac
jns 0x168ed
js 0x168ed
xor eax, 0x300c468a
inc esi
add dh, byte [edx + 3]
mov al, byte [esi + 0xc]
xor byte [esi + 2], al
jb 0x168f8
jae 0x168f8
push edx
mov al, byte [esi + 0xc]
xor byte [esi + 7], al
jne 0x16903
je 0x16903
push ebx
mov eax, dword [esi + 0xc]
xor dword [esi + 8], eax
jbe 0x1690e
ja 0x1690e
push esp
jmp 0x169ac
mov ecx, dword [esi + 0x11d]
lea eax, [esi + 0x11d]
xor dword [esi + 3], ecx
jmp 0x16925
mov ecx, dword [eax]
xor dword [esi + 0xc], ecx
jo 0x1692f
jno 0x1692f
add dword [ebx + 0x14463100], ecx
mov eax, dword [eax]
xor dword [esi + 0x14], eax
jb 0x16939
jae 0x16939
add ch, bl
jno 0x169b5
invalid
jmp 0x169ac
jns 0x16940
add edi, dword [eax + 1]
js 0x16940
and eax, 0x17b037a
jp 0x16945
jnp 0x16945
xor eax, eax
xor eax, eax
lea edi, [ebp - 0x10]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
jl 0x16953
jge 0x16953
daa
lea eax, [ebp - 0x10]
push eax
call fcn.000152b8
jle 0x16961
jg 0x16961
sub bl, ch
dec ecx
jmp 0x169ac
mov al, byte [esi + 3]
xor byte [esi], al
jns 0x1696d
js 0x1696d
push ebp
mov al, byte [esi + 4]
xor byte [esi + 1], al
jp 0x16978
jnp 0x16978
push esi
jmp 0x169ac
jp case.default.0x1684d
jnp case.default.0x1684d
mov cl, byte ss:[esi + 0x11d]
mov cl, byte [esi + 0x11d]
lea eax, [esi + 0x11d]
xor byte [esi], cl
jl 0x16992
jge 0x16992
aaa
mov cl, byte [esi + 0x11e]
xor byte [esi + 1], cl
jle 0x169a0
jg 0x169a0
cmp byte [edx + 0x2463000], cl
mov al, byte [eax]
xor byte [esi + 2], al
push ecx
xor ecx, ecx
jecxz 0x169ab
cmp dword [ecx + 0x33], ebx
dec dword [edi]
mov bh, 0xcf
pop ecx
xor edi, edi
movzx ecx, di
lea eax, [ecx + 3]
imul eax, ecx
inc eax
dec eax
je 0x16a6e
scasd eax, dword es:[edi]
rol dword [eax + 0x48], 0xf
test byte [edi - 0x7d000000], ch
call 0x868578c9
add byte [eax], al
add byte [ebx + 0x727406e8], al
sub eax, 4
je 0x16a4e
sub eax, 6
je 0x16a3f
sub eax, 8
je 0x166ed
jmp case.default.0x16a67
lea eax, [ebp - 0x164]
lea ecx, [ebp - 0x10]
push eax
xor eax, eax
push eax
push eax
push ecx
push 1
push eax
call fcn.000103c8
jb 0x169f7
jae 0x169f7
xor dh, byte [ebp + 3]
jne 0x169fc
je 0x169fc
xor ecx, dword [ebp - 0x1637b]
call dword [eax + 0x56]
lea eax, [ebp - 0x164]
push eax
push esi
push 0x980
push dword [ebp + 8]
call fcn.00010790
jbe 0x16a16
ja 0x16a16
xor al, 0xeb
xchg esp, eax
jmp 0x169ac
mov eax, dword [esi + 0xc]
xor dword [esi + 3], eax
jl 0x16a23
jge 0x16a23
pop es
mov al, byte [esi + 0xc]
xor byte [esi], al
jle 0x16a2d
jg 0x16a2d
or byte [edx + 0x46300d46], cl
add dword [ecx + 0x31], edx
leave
mov al, byte [esi + 0xd]
xor byte [esi + 1], al
push ecx
xor ecx, ecx
jecxz 0x16a39
or dword [ecx - 0x17], ebx
insd dword es:[edi], dx
invalid
pop ecx
jmp 0x169ac
mov word [ebp - 0x22], 1
push ecx
xor ecx, ecx
jecxz 0x16a4b
pop ecx
pop ecx
jmp case.default.0x16a67
mov ax, word [ebp - 0x36]
cmp ax, word [ebp - 0x24]
jne case.default.0x16a67
movzx eax, word [ebp - 0x1e]
push 9
cdq
pop ecx
idiv ecx
cmp edx, 8
ja case.default.0x16a67
jmp dword [edx*4 + 0x16c80]
inc word [ebp - 0x36]
jl case.default.0x16a67
jge case.default.0x16a67
push edi
inc edi
cmp di, 4
jb 0x169ae
xor ecx, ecx
mov eax, ecx
push 4
cdq
pop edi
idiv edi
mov al, byte [edx + esi + 0x11d]
xor byte [esi + ecx + 0x18], al
inc ecx
cmp ecx, 0xff
jl 0x16a84
mov ecx, dword [esi + 0x11d]
lea eax, [esi + 0x11d]
xor dword [esi + 0x118], ecx
jmp 0x16ab5
mov al, byte [eax]
xor byte [esi + 0x11c], al
jo 0x16ac2
jno 0x16ac2
add dword [ebx + 0x46311446], ecx
add esi, dword [edx + 3]
mov eax, dword [esi + 0x14]
xor dword [esi + 3], eax
jb 0x16acd
jae 0x16acd
add cl, byte [ebx + 0x46311446]
or al, 0x75
add esi, dword [ecx + eax + 3]
mov eax, dword [esi + 0x14]
xor dword [esi + 0xc], eax
jne 0x16ad8
je 0x16ad8
add ebp, ecx
iretd
jmp 0x169ac
jne 0x16ae2
je 0x16ae2
add ebp, ebx
add eax, 0x17f037e
jle case.0x16a67.0
jg case.0x16a67.0
jmp case.0x16a67.0
jle case.0x16a67.0
jg case.0x16a67.0
pop eax
mov al, byte [esi + 3]
pop edi
xor byte [esi + 2], al
pop esi
pop ebx
leave
ret 8
jns 0x16afb
js 0x16afb
add eax, 0x376eceb
jmp case.0x16a67.0
jbe 0x16b02
ja 0x16b02
inc esp
jmp case.0x16a67.0
xor edi, edi
movzx ecx, di
mov eax, ecx
imul eax, ecx
imul eax, ecx
inc eax
dec eax
je 0x16c0e
dec eax
je 0x16bfa
sub eax, 7
je case.default.0x16b50
sub eax, 0x13
je 0x16b99
sub eax, 0x25
je 0x16b73
sub eax, 0x3d
je 0x16b57
sub eax, 0x5b
jne 0x16c2a
movzx eax, word [ebp - 0x14]
push 9
cdq
pop ecx
idiv ecx
cmp edx, 8
ja case.default.0x16b50
jmp dword [edx*4 + 0x16ca4]
mov ecx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x18]
lea ecx, [ecx + eax*2]
add eax, ecx
mov dword [ebp - 0x14], eax
jbe 0x16b6a
ja 0x16b6a
and al, 0x66
mov dword [ebp - 0x20], eax
mov word [ebp - 0x20], ax
jmp 0x16c2a
movzx eax, word [ebp - 0x18]
movzx ecx, word [ebp - 0x1c]
lea eax, [ecx + eax*4]
inc word [ebp + eax*2 - 0x3c]
lea eax, [ebp + eax*2 - 0x3c]
jl 0x16b8c
jge 0x16b8c
pop ss
mov ax, word [ebp - 0x20]
mov word [ebp - 0x26], ax
jmp 0x16c2a
movzx eax, word [ebp - 0x18]
xor edx, edx
shl eax, 2
lea ecx, [ebp + eax*2 - 0x3c]
push ecx
xor ecx, ecx
jecxz 0x16bac
sbb dword [ecx + 0xf], ebx
mov bh, 0x5d
in al, 3
fsub dword [esi - 0x75]
pop esp
pop ebp
les esp, [esi + 0x3b]
sbb dword [esi + 3], esi
pop ecx
movzx ebx, word [ebp - 0x1c]
add ebx, eax
mov bx, word [ebp + ebx*2 - 0x3c]
cmp bx, word [ecx]
jbe 0x16bc0
mov dword [ebp - 0x1c], edx
inc edx
inc ecx
inc ecx
cmp dx, 3
jb 0x16ba6
jmp 0x16c2a
movzx eax, word [ebp - 0x1c]
xor edx, edx
lea ecx, [ebp + eax*2 - 0x3c]
jne 0x16bda
je 0x16bda
and ecx, dword [edi]
mov bh, 0x5d
call 0x6699886f
mov ebx, dword [ebp + ebx*2 - 0x3c]
movzx ebx, word [ebp - 0x18]
lea ebx, [eax + ebx*4]
mov bx, word [ebp + ebx*2 - 0x3c]
cmp bx, word [ecx]
jbe 0x16bee
mov dword [ebp - 0x18], edx
inc edx
add ecx, 8
cmp dx, 3
jb 0x16bd5
jmp 0x16c2a
movzx eax, word [ebp - 0x14]
push 3
cdq
pop ecx
idiv ecx
mov dword [ebp - 0x1c], edx
jle 0x16c0c
jg 0x16c0c
sbb bl, ch
sbb al, 0xf
mov bh, 0x45
in al, dx
jmp 0x16c2a
movzx eax, word [ebp - 0x14]
push 9
cdq
pop ecx
idiv ecx
push 3
pop ecx
movzx eax, dx
mov dword [ebp - 0x14], edx
cdq
idiv ecx
mov dword [ebp - 0x18], eax
jmp 0x16c2a
inc edi
cmp di, 7
jb 0x16b06
jmp case.0x16b50.1
jo 0x16c3f
jno 0x16c3f
and ecx, ebp
cli
invalid
jmp case.0x16b50.1
jb 0x16c49
jae 0x16c49
and dh, byte [esi + 3]
jbe 0x16c4e
ja 0x16c4e
add al, 0x7a
add edi, dword [ebx + 1]
jp 0x16c53
jnp 0x16c53
push ss
jmp case.0x16b50.1