Function at 0x401000
Capabilities:
Encode data using xor
Encrypt data using rc4 prga

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x28
mov esi, ecx
mov ecx, dword [esp + 0x40]
mov eax, 1
shl eax, cl
mov dword [esp + 0xc], eax
mov dword [esp + 4], edx
mov edx, 1
xor edi, edi
shld edi, edx, cl
shl edx, cl
xor ebx, ebx
test cl, 0x20
cmovne edi, edx
cmovne edx, ebx
mov ecx, dword [esp + 0x3c]
lea eax, [ecx*2 + 2]
add edx, eax
adc edi, 0
add edx, 8
adc edi, 0
mov eax, 0xffffffd2
cmp ecx, 0xff
ja 0x40139a
cmp dword [esp + 0x48], edx
sbb ebx, edi
mov edx, dword [esp + 0xc]
jb 0x40139a
mov eax, 0xffffffd4
cmp dword [esp + 0x40], 0xc
ja 0x40139a
mov dword [esp + 8], esi
mov esi, dword [esp + 0x44]
mov edi, 0x8000
mov ecx, dword [esp + 0x40]
shl edi, cl
lea eax, [edx - 1]
sar edi, 0x10
mov dword [esp], edi
mov ecx, dword [esp + 0x3c]
lea edx, [ecx + 1]
test ecx, ecx
mov dword [esp + 0x10], edx
je 0x40112c
and edx, 0xfffffffe
mov dword [esp + 0x14], edx
mov bp, 1
mov ecx, eax
xor ebx, ebx
jmp 0x4010e3
mov edx, ebx
inc dl
mov esi, dword [esp + 8]
mov byte [esi + ecx*4 + 6], dl
mov esi, dword [esp + 0x44]
dec ecx
mov dx, 1
mov word [esi + ebx*2 + 2], dx
add ebx, 2
cmp dword [esp + 0x14], ebx
je 0x401134
mov edx, dword [esp + 4]
movsx edx, word [edx + ebx*2]
cmp edx, 0xffffffff
je 0x401100
cmp dword [esp], edx
mov edi, 0
cmovle ebp, edi
jmp 0x40110d
mov edx, dword [esp + 8]
mov byte [edx + ecx*4 + 6], bl
dec ecx
mov dx, 1
mov word [esi + ebx*2], dx
mov edx, dword [esp + 4]
movsx edx, word [edx + ebx*2 + 2]
cmp edx, 0xffffffff
je 0x4010c0
cmp dword [esp], edx
mov edi, 0
cmovle ebp, edi
jmp 0x4010d5
xor ebx, ebx
mov bp, 1
mov ecx, eax
test byte [esp + 0x10], 1
je 0x401167
mov edx, dword [esp + 4]
movsx edx, word [edx + ebx*2]
cmp edx, 0xffffffff
je 0x401156
xor esi, esi
cmp dword [esp], edx
cmovle ebp, esi
mov esi, dword [esp + 0x44]
jmp 0x401163
mov edx, dword [esp + 8]
mov byte [edx + ecx*4 + 6], bl
dec ecx
mov dx, 1
mov word [esi + ebx*2], dx
mov ebx, dword [esp + 8]
mov edx, dword [esp + 0x40]
mov word [ebx], dx
mov word [ebx + 2], bp
cmp ecx, eax
jne 0x401283
mov edi, dword [esp + 0x3c]
lea ebp, [esi + edi*2]
add ebp, 2
mov edx, dword [esp + 0xc]
mov ecx, edx
shr ecx, 1
shr edx, 3
add ecx, edx
add ecx, 3
mov dword [esp + 0x10], ecx
lea ecx, [esi + edi*2]
add ecx, 0x1a
mov dword [esp + 0x18], ecx
xor esi, esi
xor ebx, ebx
xor ecx, ecx
xor edi, edi
mov dword [esp + 0x1c], ebp
jmp 0x4011e4
mov esi, dword [esp]
add esi, edi
mov edi, dword [esp + 0x14]
lea edx, [edi + 1]
add ebx, 0x1010101
adc ecx, 0x1010101
cmp edi, dword [esp + 0x3c]
mov edi, edx
je 0x4012e7
mov edx, dword [esp + 4]
mov dword [esp + 0x14], edi
movsx edi, word [edx + edi*2]
mov dword [ebp + esi + 4], ecx
mov dword [esp], esi
mov dword [ebp + esi], ebx
cmp edi, 9
jl 0x4011c0
lea esi, [edi - 9]
mov edx, 8
cmp esi, 0x18
jb 0x401265
shr esi, 3
inc esi
mov dword [esp + 0x20], esi
and esi, 0xfffffffc
lea edx, [esi*8 + 8]
mov dword [esp + 0x24], ebx
movd xmm0, ebx
movd xmm1, ecx
punpckldq xmm0, xmm1
pshufd xmm0, xmm0, 0x44
mov ebx, dword [esp + 0x18]
mov ebp, dword [esp]
add ebp, ebx
xor ebx, ebx
nop
movdqu xmmword [ebp + ebx*8 - 0x10], xmm0
movdqu xmmword [ebp + ebx*8], xmm0
add ebx, 4
cmp esi, ebx
jne 0x401240
cmp dword [esp + 0x20], esi
mov ebp, dword [esp + 0x1c]
mov ebx, dword [esp + 0x24]
je 0x4011c0
mov esi, dword [esp]
add esi, ebp
nop word [eax + eax]
mov dword [esi + edx], ebx
mov dword [esi + edx + 4], ecx
add edx, 8
cmp edx, edi
jl 0x401270
jmp 0x4011c0
mov esi, dword [esp + 0xc]
mov edx, esi
shr edx, 3
shr esi, 1
lea ebx, [edx + esi]
add ebx, 3
xor edi, edi
xor edx, edx
jmp 0x4012af
lea esi, [edx + 1]
cmp edx, dword [esp + 0x3c]
mov edx, esi
je 0x401340
mov esi, dword [esp + 4]
cmp word [esi + edx*2], 0
jle 0x4012a0
xor ebp, ebp
nop dword [eax]
mov esi, dword [esp + 8]
mov byte [esi + edi*4 + 6], dl
nop dword [eax + eax]
add edi, ebx
and edi, eax
cmp edi, ecx
ja 0x4012d0
inc ebp
mov esi, dword [esp + 4]
movsx esi, word [esi + edx*2]
cmp ebp, esi
jl 0x4012c0
jmp 0x4012a0
mov ecx, dword [esp + 0x10]
add ecx, ecx
mov dword [esp + 4], ecx
mov ecx, dword [esp + 0x44]
mov edx, dword [esp + 0x3c]
lea ecx, [ecx + edx*2]
add ecx, 3
mov dword [esp], ecx
xor esi, esi
xor edi, edi
mov edx, dword [esp]
mov ebp, dword [esp + 8]
nop dword [eax]
mov ebx, edi
and ebx, eax
movzx ecx, byte [edx + esi - 1]
mov byte [ebp + ebx*4 + 6], cl
mov ecx, dword [esp + 0x10]
add ecx, edi
and ecx, eax
movzx ebx, byte [edx + esi]
mov byte [ebp + ecx*4 + 6], bl
mov ecx, dword [esp + 0xc]
add edi, dword [esp + 4]
and edi, eax
add esi, 2
cmp esi, ecx
jb 0x401310
jmp 0x40134d
mov eax, 0xffffffff
test edi, edi
mov ecx, dword [esp + 0xc]
jne 0x40139a
xor edx, edx
mov ebp, dword [esp + 8]
mov ebx, dword [esp + 0x44]
nop word [eax + eax]
mov eax, ecx
movzx ecx, byte [ebp + edx*4 + 6]
movzx esi, word [ebx + ecx*2]
lea edi, [esi + 1]
mov word [ebx + ecx*2], di
bsr ecx, esi
xor ecx, 0x1f
add ecx, 0xffffffe1
test esi, esi
cmove ecx, esi
add ecx, dword [esp + 0x40]
mov byte [ebp + edx*4 + 7], cl
shl esi, cl
mov ecx, eax
sub esi, eax
mov word [ebp + edx*4 + 4], si
inc edx
cmp eax, edx
jne 0x401360
xor eax, eax
add esp, 0x28
pop esi
pop edi
pop ebx
pop ebp
ret