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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x58
push ebx
mov ebx, dword [ebp + 8]
test ebx, ebx
je 0x401aee
mov ecx, dword [ebp + 0xc]
test ecx, ecx
je 0x401aee
push esi
mov esi, dword [ebp + 0x10]
push edi
mov eax, dword [esi + 0x2e0]
xor eax, dword [esi + 0x254]
lea edi, [esi + 0x254]
cmp ecx, eax
jl 0x401aec
call fcn.00401ec0
mov dword [esi + 0x48], eax
mov eax, dword [edi]
xor dword [esi + 0x284], eax
mov ecx, dword [esi + 0x284]
mov eax, dword [ebp + 0xc]
xor edx, edx
div ecx
mov dword [esi + 0x2e4], edi
xor edi, edi
mov dword [esi + 0x224], eax
imul eax, ecx
mov dword [esi + 0x260], eax
test eax, eax
je 0x40189b
mov eax, dword [esi + 0x2e4]
inc edi
mov al, byte [eax]
xor byte [edi + ebx - 1], al
movzx ecx, byte [edi + ebx - 1]
mov eax, dword [esi + 0x2e4]
mov dl, byte [eax + 1]
xor dl, cl
mov byte [edi + ebx - 1], dl
mov eax, dword [esi + 0x2e4]
mov cl, byte [eax + 2]
xor cl, dl
mov byte [edi + ebx - 1], cl
mov eax, dword [esi + 0x2e4]
mov al, byte [eax + 3]
xor al, cl
mov byte [edi + ebx - 1], al
cmp edi, dword [esi + 0x260]
jb 0x401854
mov eax, dword [esi + 0x284]
xor edi, edi
dec eax
je 0x4018e5
mov eax, dword [esi + 0x284]
dec eax
push eax
push 1
push esi
call fcn.00401d50
add esp, 0xc
xor ecx, ecx
jmp 0x4018c0
cmp al, byte [esi + ecx + 0xb0]
je 0x4018da
inc ecx
cmp ecx, edi
jbe 0x4018c0
test al, al
je 0x4018da
mov byte [esi + edi + 0xb0], al
inc edi
mov eax, dword [esi + 0x284]
dec eax
cmp edi, eax
jb 0x4018a6
xorps xmm0, xmm0
lea edi, [esi + 0x5c]
movq qword [ebp - 0x4c], xmm0
mov dword [ebp - 0x3c], 0x16d9dae7
mov dword [ebp - 0x38], 0xe559151a
movq xmm0, qword [ebp - 0x3c]
movq qword [edi], xmm0
mov dword [ebp - 0x34], 0xeb519a03
mov dword [ebp - 0x30], 0xe79af6d5
movq xmm0, qword [ebp - 0x34]
movq qword [edi + 8], xmm0
mov dword [ebp - 0x2c], 0x83b166cf
mov dword [ebp - 0x28], 0
movq xmm0, qword [ebp - 0x2c]
movq qword [edi + 0x10], xmm0
mov dword [ebp - 0x58], 0x2ff09749
mov dword [ebp - 0x54], 0x8c444cdc
mov dword [ebp - 0x50], 0xdf41f997
mov dword [ebp - 0x44], 0
mov word [ebp - 0x40], 0
mov byte [edi + 0x18], 0
xor eax, eax
nop
xor byte [ebp + eax - 0x58], 0x1c
inc eax
cmp eax, 0xc
jb 0x401960
xor eax, eax
mov dword [ebp - 4], eax
cmp dword [esi + 0x284], eax
jbe 0x401a60
lea esp, [esp]
movzx edi, byte [esi + eax + 0xb0]
imul edi, dword [esi + 0x224]
mov eax, dword [ebp - 0x50]
add edi, ebx
mov dword [esi + 0x2ec], edi
movq xmm0, qword [edi]
mov bl, byte [edi + 0x18]
movq qword [ebp - 0x10], xmm0
movq xmm0, qword [edi + 8]
movq qword [ebp - 0x18], xmm0
movq xmm0, qword [edi + 0x10]
movq qword [ebp - 0x20], xmm0
movq xmm0, qword [ebp - 0x58]
movq qword [edi], xmm0
mov dword [edi + 8], eax
mov eax, dword [esi + 0x2ec]
mov dword [ebp - 8], edi
call eax
movq xmm0, qword [ebp - 0x10]
movq qword [edi], xmm0
movq xmm0, qword [ebp - 0x18]
movq qword [edi + 8], xmm0
movq xmm0, qword [ebp - 0x20]
movq qword [edi + 0x10], xmm0
mov byte [edi + 0x18], bl
xor edi, edi
cmp dword [esi + 0x224], edi
jbe 0x401a47
mov ebx, dword [ebp - 8]
mov edi, edi
mov eax, dword [esi + 0x2e4]
inc edi
mov al, byte [eax + 3]
xor byte [edi + ebx - 1], al
movzx ecx, byte [edi + ebx - 1]
mov eax, dword [esi + 0x2e4]
mov dl, byte [eax + 2]
xor dl, cl
mov byte [edi + ebx - 1], dl
mov eax, dword [esi + 0x2e4]
mov cl, byte [eax + 1]
xor cl, dl
mov byte [edi + ebx - 1], cl
mov eax, dword [esi + 0x2e4]
mov al, byte [eax]
xor al, cl
mov byte [edi + ebx - 1], al
cmp edi, dword [esi + 0x224]
jb 0x401a00
mov eax, dword [ebp - 4]
mov ebx, dword [ebp + 8]
inc eax
mov dword [ebp - 4], eax
cmp eax, dword [esi + 0x284]
jb 0x401980
lea edi, [esi + 0x5c]
call fcn.00401ec0
mov edx, dword [esi + 0x48]
mov dword [esi + 0x3a0], eax
add eax, 0xfffffffe
mov dword [ebp + 8], eax
test edx, edx
je 0x401a9e
mov esi, eax
test esi, esi
je 0x401a9e
cmp edx, esi
jae 0x401a9e
mov ecx, 0
sub esi, edx
je 0x401a9e
jmp 0x401a90
mov al, byte [ecx + edx + 1]
add al, 0x24
xor byte [ecx + edx], al
inc ecx
cmp ecx, esi
jb 0x401a90
mov eax, dword [ebp + 0xc]
xor dword [edi], 0x1ed01d36
xor dword [edi + 4], 0x1ed01d36
xor dword [edi + 8], 0x1ed01d36
xor dword [edi + 0xc], 0x1ed01d36
xor dword [edi + 0x10], 0x1ed01d36
cdq
and edx, 0xff
lea esi, [edx + eax]
sar esi, 8
test esi, esi
je 0x401aec
push edi
push 0x100
push ebx
call fcn.00401c20
add esp, 0xc
add ebx, 0x100
dec esi
jne 0x401ad4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret