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

Disassembly:
push ebp
mov ebp, esp
lea esp, [esp - 0x34]
push ebx
push esi
push edi
mov edi, dword [ebp + 0x24]
mov ebx, dword [ebp + 0x20]
mov dword [ebp - 0x30], ebx
mov esi, dword [ebp + 0x1c]
mov ebx, dword [ebp + 0x18]
mov dword [ebp - 0x28], ebx
mov ebx, dword [ebp + 0x14]
mov dword [ebp - 0x18], ebx
mov ebx, dword [ebp + 0x10]
mov dword [ebp - 0x14], ebx
mov ebx, dword [ebp + 0xc]
mov dword [ebp - 0x10], ebx
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x24], ebx
mov dword [ebp - 8], 0xffffffff
mov ebx, dword [ebp - 0x24]
mov byte [ebx], 0
cmp dword [ebp - 0x28], 2
jl 0x40a975
nop
mov dword [ebp - 0x2c], esi
mov dword [ebp - 0xc], 0
mov bl, byte [esi]
mov byte [ebp - 0x34], bl
add esi, 1
add dword [ebp - 0xc], 1
mov bl, byte [ebp - 0x34]
and bl, 0x80
cmp bl, 0x80
sete byte [eax]
mov ax, word [ebp - 0x34]
and ax, 0x40
cmp ax, 0x40
sete byte [edx]
mov ax, word [ebp - 0x34]
and ax, 0x20
cmp ax, 0x20
sete byte [ecx]
mov ax, word [ebp - 0x34]
and ax, 0x10
cmp ax, 0x10
sete byte [edi]
mov dx, word [ebp - 0x34]
and dx, 0xf
mov eax, dword [ebp - 0x30]
mov byte [eax], dl
xor al, al
mov edi, esi
mov dl, byte [edi]
add edi, 1
add dword [ebp - 0xc], 1
mov al, dl
and al, 0x80
cmp al, 0x80
sete al
mov cx, dx
and cx, 0x7f
movsx ecx, cx
mov edx, ecx
sar edx, 0x1f
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x20], edx
movzx edx, al
lea edx, [edx*4 + 2]
cmp edx, dword [ebp - 0x28]
jg 0x40a975
cmp dword [ebp - 0x20], 0
jne 0x40a849
cmp dword [ebp - 0x1c], 0x7e
jne 0x40a849
movzx edx, al
lea edx, [edx*4 + 4]
cmp edx, dword [ebp - 0x28]
jg 0x40a975
nop
mov ecx, dword [ebp - 0x2c]
movzx edx, byte [ecx + 2]
shl edx, 8
movzx ecx, byte [ecx + 3]
add edx, ecx
xor ecx, ecx
mov dword [ebp - 0x1c], edx
mov dword [ebp - 0x20], ecx
add edi, 2
add dword [ebp - 0xc], 2
jmp 0x40a89c
cmp dword [ebp - 0x20], 0
jne 0x40a89c
cmp dword [ebp - 0x1c], 0x7f
jne 0x40a89c
movzx edx, al
lea edx, [edx*4 + 0xa]
cmp edx, dword [ebp - 0x28]
jg 0x40a975
mov ecx, dword [ebp - 0x2c]
movzx edx, byte [ecx + 2]
mov ebx, edx
shl ebx, 0x18
movzx edx, byte [ecx + 3]
shl edx, 0x10
add ebx, edx
movzx edx, byte [ecx + 4]
shl edx, 8
add ebx, edx
movzx edx, byte [ecx + 5]
add edx, ebx
xor ecx, ecx
mov dword [ebp - 0x1c], edx
mov dword [ebp - 0x20], ecx
add edi, 4
add dword [ebp - 0xc], 4
nop
movzx edx, al
mov ecx, edx
shl ecx, 2
mov edx, ecx
sar edx, 0x1f
add ecx, dword [ebp - 0x1c]
adc edx, dword [ebp - 0x20]
mov edx, ecx
add dword [ebp - 0xc], edx
mov edx, dword [ebp - 0x28]
sub edx, dword [ebp - 0xc]
test edx, edx
jl 0x40a975
mov esi, esi
mov edx, dword [ebp - 0x14]
mov ecx, edx
sar ecx, 0x1f
cmp ecx, dword [ebp - 0x20]
jg 0x40a8d8
jl 0x40a8e4
cmp edx, dword [ebp - 0x1c]
jbe 0x40a8e4
mov edx, dword [ebp - 0x24]
mov byte [edx], 1
jmp 0x40a975
test al, al
je 0x40a930
mov eax, edi
lea edx, [ebp - 4]
mov ecx, 4
call fcn.004477c0
add edi, 4
mov ebx, edi
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x20]
sub edx, 1
sbb eax, 0
mov esi, edx
test esi, esi
jl 0x40a930
mov ecx, 0xffffffff
lea esi, [esi]
nop
add ecx, 1
mov eax, ecx
and eax, 3
mov al, byte [ebp + eax - 4]
xor byte [ebx], al
add ebx, 1
cmp esi, ecx
jg 0x40a918
lea esi, [esi]
mov edx, dword [ebp - 0x18]
mov esi, edi
mov eax, esi
mov ebx, dword [ebp - 0x14]
mov ecx, ebx
call fcn.004477c0
add esi, ebx
mov eax, ebx
mov edx, eax
sar edx, 0x1f
sub dword [ebp - 0x1c], eax
sbb dword [ebp - 0x20], edx
mov ebx, dword [ebp - 0x10]
mov eax, ebx
call fcn.00447c70
push 0
mov eax, ebx
mov ecx, dword [ebp - 0x1c]
mov ebx, esi
mov edx, ebx
call fcn.0044de20
mov eax, dword [ebp - 0x1c]
add ebx, eax
mov eax, dword [ebp - 0xc]
mov dword [ebp - 8], eax
mov eax, dword [ebp - 8]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x20