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

Disassembly:
mov eax, dword [esp + 4]
sub esp, 0x10
test eax, eax
push ebx
mov ebx, ecx
jne 0x417704
lea eax, [esp + 0x18]
lea ecx, [esp + 8]
push eax
mov dword [esp + 0x1c], str.Empty_key
call dword [sym.imp.MSVCRT.dll_public:_void___thiscall_exception::constructor_char_const__const_const__]
lea ecx, [esp + 8]
push 0x431328
push ecx
call sub.MSVCRT.dll__CxxThrowException
mov eax, dword [esp + 0x20]
cmp eax, 0x10
je 0x41773d
cmp eax, 0x18
je 0x41773d
cmp eax, 0x20
je 0x41773d
lea edx, [esp + 0x18]
lea ecx, [esp + 8]
push edx
mov dword [esp + 0x1c], str.Incorrect_key_length
call dword [sym.imp.MSVCRT.dll_public:_void___thiscall_exception::constructor_char_const__const_const__]
lea eax, [esp + 8]
push 0x431328
push eax
call sub.MSVCRT.dll__CxxThrowException
mov ecx, dword [esp + 0x24]
cmp ecx, 0x10
je 0x417776
cmp ecx, 0x18
je 0x417776
cmp ecx, 0x20
je 0x417776
lea ecx, [esp + 0x18]
mov dword [esp + 0x18], str.Incorrect_block_length
push ecx
lea ecx, [esp + 0xc]
call dword [sym.imp.MSVCRT.dll_public:_void___thiscall_exception::constructor_char_const__const_const__]
lea edx, [esp + 8]
push 0x431328
push edx
call sub.MSVCRT.dll__CxxThrowException
push ebp
mov dword [ebx + 0x3e48], eax
mov eax, dword [esp + 0x20]
mov dword [ebx + 0x3e4c], ecx
push esi
mov edx, ecx
push edi
mov esi, eax
lea edi, [ebx + 0x3e54]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebx + 0x3e4c]
mov esi, eax
mov eax, ecx
lea edi, [ebx + 0x3e74]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebx + 0x3e48]
cmp eax, 0x10
je 0x4177f2
cmp eax, 0x18
je 0x4177d7
mov dword [ebx + 0x3e50], 0xe
jmp 0x417817
mov ecx, dword [ebx + 0x3e4c]
sub ecx, 0x20
neg ecx
sbb ecx, ecx
and ecx, 0xfffffffe
add ecx, 0xe
mov dword [ebx + 0x3e50], ecx
jmp 0x417817
mov eax, dword [ebx + 0x3e4c]
cmp eax, 0x10
jne 0x417804
mov eax, 0xa
jmp 0x417811
sub eax, 0x18
neg eax
sbb eax, eax
and eax, 2
add eax, 0xc
mov dword [ebx + 0x3e50], eax
mov eax, dword [ebx + 0x3e4c]
cdq
and edx, 3
add eax, edx
xor edx, edx
mov ebp, eax
mov eax, dword [ebx + 0x3e50]
sar ebp, 2
test eax, eax
mov dword [esp + 0x2c], ebp
jl 0x417858
lea esi, [ebx + 0x3a88]
test ebp, ebp
jle 0x41784a
mov ecx, ebp
xor eax, eax
mov edi, esi
rep stosd dword es:[edi], eax
mov eax, dword [ebx + 0x3e50]
inc edx
add esi, 0x20
cmp edx, eax
jle 0x41783e
mov eax, dword [ebx + 0x3e50]
xor edx, edx
test eax, eax
jl 0x417884
lea esi, [ebx + 0x3c68]
test ebp, ebp
jle 0x417876
mov ecx, ebp
xor eax, eax
mov edi, esi
rep stosd dword es:[edi], eax
mov eax, dword [ebx + 0x3e50]
inc edx
add esi, 0x20
cmp edx, eax
jle 0x41786a
mov ecx, dword [ebx + 0x3e50]
mov eax, dword [ebx + 0x3e48]
inc ecx
lea esi, [ebx + 0x3e94]
cdq
imul ecx, ebp
and edx, 3
mov dword [esp + 0x30], ecx
add eax, edx
mov edi, eax
mov eax, dword [esp + 0x24]
sar edi, 2
test edi, edi
mov dword [esp + 0x10], edi
jle 0x4178ed
mov dword [esp + 0x24], edi
xor edx, edx
add esi, 4
mov dl, byte [eax]
shl edx, 0x18
mov dword [esi - 4], edx
inc eax
xor edx, edx
mov dl, byte [eax]
shl edx, 0x10
or dword [esi - 4], edx
inc eax
xor edx, edx
mov dh, byte [eax]
or dword [esi - 4], edx
inc eax
xor edx, edx
mov dl, byte [eax]
or dword [esi - 4], edx
mov edx, dword [esp + 0x24]
inc eax
dec edx
mov dword [esp + 0x24], edx
jne 0x4178b9
xor esi, esi
test edi, edi
jle 0x417951
lea eax, [ebx + 0x3e94]
mov dword [esp + 0x24], eax
cmp esi, ecx
jge 0x417b04
mov eax, esi
cdq
idiv ebp
mov ecx, eax
mov eax, esi
cdq
idiv ebp
mov dword [esp + 0x28], edx
lea eax, [edx + ecx*8]
mov edx, dword [esp + 0x24]
mov edx, dword [edx]
mov dword [ebx + eax*4 + 0x3a88], edx
mov eax, dword [ebx + 0x3e50]
sub eax, ecx
mov ecx, dword [esp + 0x28]
inc esi
lea edx, [ecx + eax*8]
mov eax, dword [esp + 0x24]
mov ecx, dword [eax]
add eax, 4
mov dword [ebx + edx*4 + 0x3c68], ecx
mov ecx, dword [esp + 0x30]
cmp esi, edi
mov dword [esp + 0x24], eax
jl 0x4178fd
cmp esi, ecx
jge 0x417b04
lea edx, [ebx + 0x3a04]
mov dword [esp + 0x28], edx
mov eax, dword [ebx + edi*4 + 0x3e90]
xor ecx, ecx
mov dword [esp + 0x24], eax
mov cl, byte [esp + 0x26]
xor edx, edx
movsx ebp, byte [ecx + ebx + 0x804]
mov ecx, dword [esp + 0x28]
movsx ecx, byte [ecx]
xor ebp, ecx
xor ecx, ecx
mov cl, ah
and eax, 0xff
shl ebp, 8
mov dl, byte [ecx + ebx + 0x804]
xor ecx, ecx
xor ebp, edx
xor edx, edx
mov dl, byte [eax + ebx + 0x804]
xor eax, eax
mov al, byte [esp + 0x27]
shl ebp, 8
mov cl, byte [eax + ebx + 0x804]
xor ebp, edx
mov edx, dword [ebx + 0x3e94]
shl ebp, 8
xor ebp, ecx
mov ecx, dword [esp + 0x28]
xor edx, ebp
inc ecx
cmp edi, 8
mov dword [ebx + 0x3e94], edx
mov dword [esp + 0x28], ecx
je 0x417a00
cmp edi, 1
jle 0x417a93
lea eax, [ebx + 0x3e98]
lea ecx, [edi - 1]
mov edx, dword [eax - 4]
mov ebp, dword [eax]
xor ebp, edx
mov dword [eax], ebp
add eax, 4
dec ecx
jne 0x4179ec
jmp 0x417a93
lea eax, [ebx + 0x3e98]
mov ecx, 3
mov edx, dword [eax - 4]
mov ebp, dword [eax]
xor ebp, edx
mov dword [eax], ebp
add eax, 4
dec ecx
jne 0x417a0b
mov eax, dword [ebx + 0x3ea0]
xor ecx, ecx
mov dword [esp + 0x24], eax
mov cl, byte [esp + 0x27]
xor edx, edx
movsx ebp, byte [ecx + ebx + 0x804]
xor ecx, ecx
mov cl, byte [esp + 0x26]
shl ebp, 8
mov dl, byte [ecx + ebx + 0x804]
xor ecx, ecx
xor ebp, edx
xor edx, edx
mov dl, ah
and eax, 0xff
shl ebp, 8
mov cl, byte [edx + ebx + 0x804]
xor edx, edx
mov dl, byte [eax + ebx + 0x804]
mov eax, dword [ebx + 0x3ea4]
xor ebp, ecx
mov ecx, 3
shl ebp, 8
xor ebp, edx
xor eax, ebp
mov dword [ebx + 0x3ea4], eax
lea eax, [ebx + 0x3ea8]
mov edx, dword [eax - 4]
mov ebp, dword [eax]
xor ebp, edx
mov dword [eax], ebp
add eax, 4
dec ecx
jne 0x417a84
test edi, edi
mov dword [esp + 0x24], 0
jle 0x417af4
lea ecx, [ebx + 0x3e94]
mov eax, dword [esp + 0x30]
mov ebp, dword [esp + 0x2c]
cmp esi, eax
jge 0x417b04
mov eax, esi
add ecx, 4
cdq
idiv ebp
mov edi, eax
mov eax, esi
cdq
idiv ebp
mov ebp, dword [ecx - 4]
lea eax, [edx + edi*8]
mov dword [ebx + eax*4 + 0x3a88], ebp
mov eax, dword [ebx + 0x3e50]
sub eax, edi
mov edi, dword [esp + 0x10]
lea edx, [edx + eax*8]
mov eax, dword [ecx - 4]
mov dword [ebx + edx*4 + 0x3c68], eax
mov eax, dword [esp + 0x24]
inc eax
inc esi
cmp eax, edi
mov dword [esp + 0x24], eax
jl 0x417aa5
mov eax, dword [esp + 0x30]
mov ebp, dword [esp + 0x2c]
cmp esi, eax
jl 0x417963
mov ecx, dword [ebx + 0x3e50]
mov eax, 1
cmp ecx, eax
mov dword [esp + 0x2c], eax
jle 0x417b87
lea esi, [ebx + 0x3c88]
mov dword [esp + 0x30], esi
test ebp, ebp
jle 0x417b69
mov edi, ebp
mov eax, dword [esi]
xor ecx, ecx
mov cl, ah
xor edx, edx
mov dword [esp + 0x24], eax
mov dl, byte [esp + 0x26]
mov ecx, dword [ebx + ecx*4 + 0x3204]
and eax, 0xff
xor ecx, dword [ebx + edx*4 + 0x2e04]
xor edx, edx
mov dl, byte [esp + 0x27]
add esi, 4
xor ecx, dword [ebx + edx*4 + 0x2a04]
mov edx, dword [ebx + eax*4 + 0x3604]
xor ecx, edx
dec edi
mov dword [esi - 4], ecx
jne 0x417b27
mov eax, dword [esp + 0x2c]
mov esi, dword [esp + 0x30]
mov ecx, dword [ebx + 0x3e50]
inc eax
add esi, 0x20
cmp eax, ecx
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], esi
jl 0x417b21
pop edi
pop esi
mov byte [ebx + 0x3a84], 1
pop ebp
pop ebx
add esp, 0x10
ret 0x10