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

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [esi + 0xb4]
push ebx
push edi
mov edi, dword [esi + 0x7c]
sub edi, dword [ebp + 0xc]
mov ecx, eax
imul ecx, dword [ebp + 8]
dec edi
imul edi, dword [esi + 0xac]
add edi, ecx
add edi, dword [esi + 0xa8]
xor edx, edx
cmp dword [esi + 0xc0], edx
jne 0x40fca1
cmp dword [esi + 0xc4], edx
jne 0x40fca1
mov ecx, dword [esi + 0xb8]
test cl, 2
je 0x40f8c8
cmp dword [ebp + 0x10], edx
je 0x40fcc3
mov al, byte [esi + 0xcc]
xor byte [edi + 2], al
mov al, byte [esi + 0xd0]
xor byte [edi + 1], al
mov al, byte [esi + 0xd4]
xor byte [edi], al
add edi, dword [esi + 0xb4]
dec dword [ebp + 0x10]
jne 0x40f89e
jmp 0x40fcc3
test ecx, 0x100
je 0x40f909
cmp dword [ebp + 0x10], edx
je 0x40fcc3
mov al, byte [esi + 0xcc]
mov byte [edi + 2], al
mov al, byte [esi + 0xd0]
mov byte [edi + 1], al
mov al, byte [esi + 0xd4]
mov byte [edi], al
mov al, byte [esi + 0xd8]
mov byte [edi + 3], al
add edi, 4
dec dword [ebp + 0x10]
jne 0x40f8d9
jmp 0x40fcc3
test cl, 8
je 0x40f938
cmp eax, 4
jne 0x40fcc3
cmp dword [ebp + 0x10], edx
je 0x40fcc3
add edi, 3
mov al, byte [esi + 0xd8]
mov byte [edi], al
add edi, 4
dec dword [ebp + 0x10]
jne 0x40f923
jmp 0x40fcc3
test cl, 0x10
je 0x40faed
cmp eax, 4
jne 0x40fa8d
cmp dword [ebp + 0x10], edx
je 0x40fcc3
mov ebx, dword [esi + 0xd8]
movzx edx, byte [edi + 3]
test ebx, ebx
jne 0x40f967
movzx eax, byte [edi + 2]
jmp 0x40f9a6
test edx, edx
jne 0x40f976
mov eax, dword [esi + 0xcc]
cdq
idiv ebx
jmp 0x40f9a6
movzx eax, byte [edi + 2]
imul ebx, ebx, 0xff
mov ecx, dword [esi + 0xdc]
imul eax, ecx
imul eax, edx
mov edx, dword [esi + 0xcc]
imul edx, edx, 0xff
add eax, edx
movzx edx, byte [edi + 3]
imul ecx, edx
cdq
add ecx, ebx
idiv ecx
mov byte [edi + 2], al
mov ebx, dword [esi + 0xd8]
test ebx, ebx
jne 0x40f9b9
movzx eax, byte [edi + 1]
jmp 0x40f9fc
movzx edx, byte [edi + 3]
test edx, edx
jne 0x40f9cc
mov eax, dword [esi + 0xd0]
cdq
idiv ebx
jmp 0x40f9fc
movzx eax, byte [edi + 1]
imul ebx, ebx, 0xff
mov ecx, dword [esi + 0xdc]
imul eax, ecx
imul eax, edx
mov edx, dword [esi + 0xd0]
imul edx, edx, 0xff
add eax, edx
movzx edx, byte [edi + 3]
imul ecx, edx
cdq
add ecx, ebx
idiv ecx
mov byte [edi + 1], al
mov ebx, dword [esi + 0xd8]
test ebx, ebx
jne 0x40fa0e
movzx eax, byte [edi]
jmp 0x40fa54
movzx eax, byte [edi + 3]
test eax, eax
jne 0x40fa21
mov eax, dword [esi + 0xd4]
cdq
idiv ebx
jmp 0x40fa54
movzx eax, byte [edi]
imul ebx, ebx, 0xff
mov ecx, dword [esi + 0xdc]
movzx edx, byte [edi + 3]
imul eax, ecx
imul eax, edx
mov edx, dword [esi + 0xd4]
imul edx, edx, 0xff
add eax, edx
movzx edx, byte [edi + 3]
imul ecx, edx
cdq
add ecx, ebx
idiv ecx
movzx ecx, byte [edi + 3]
mov byte [edi], al
mov eax, dword [esi + 0xdc]
imul eax, ecx
mov ecx, dword [esi + 0xd8]
imul ecx, ecx, 0xff
add eax, ecx
cdq
mov ecx, 0xff
idiv ecx
add edi, 4
dec dword [ebp + 0x10]
mov byte [edi - 1], al
jne 0x40f953
jmp 0x40fcc3
cmp dword [ebp + 0x10], edx
je 0x40fcc3
movzx eax, byte [edi + 2]
imul eax, dword [esi + 0xdc]
add eax, dword [esi + 0xcc]
mov ecx, 0xff
cdq
mov ebx, ecx
idiv ebx
mov byte [edi + 2], al
movzx eax, byte [edi + 1]
imul eax, dword [esi + 0xdc]
add eax, dword [esi + 0xd0]
cdq
idiv ebx
mov byte [edi + 1], al
movzx eax, byte [edi]
imul eax, dword [esi + 0xdc]
add eax, dword [esi + 0xd4]
cdq
idiv ecx
mov byte [edi], al
add edi, 3
dec dword [ebp + 0x10]
jne 0x40fa96
jmp 0x40fcc3
test cl, 0x20
je 0x40fc75
cmp eax, 4
jne 0x40fc18
cmp dword [ebp + 0x10], edx
je 0x40fcc3
mov ebx, dword [esi + 0xd8]
movzx edx, byte [edi + 3]
test ebx, ebx
jne 0x40fb1c
movzx eax, byte [edi + 2]
jmp 0x40fb5b
test edx, edx
jne 0x40fb2b
mov eax, dword [esi + 0xcc]
cdq
idiv ebx
jmp 0x40fb5b
movzx eax, byte [edi + 2]
imul ebx, ebx, 0xff
mov ecx, dword [esi + 0xdc]
imul eax, ecx
imul eax, edx
mov edx, dword [esi + 0xcc]
imul edx, edx, 0xff
add eax, edx
movzx edx, byte [edi + 3]
imul ecx, edx
cdq
add ecx, ebx
idiv ecx
mov byte [edi + 2], al
mov ebx, dword [esi + 0xd8]
test ebx, ebx
jne 0x40fb6e
movzx eax, byte [edi + 1]
jmp 0x40fbb1
movzx edx, byte [edi + 3]
test edx, edx
jne 0x40fb81
mov eax, dword [esi + 0xd0]
cdq
idiv ebx
jmp 0x40fbb1
movzx eax, byte [edi + 1]
imul ebx, ebx, 0xff
mov ecx, dword [esi + 0xdc]
imul eax, ecx
imul eax, edx
mov edx, dword [esi + 0xd0]
imul edx, edx, 0xff
add eax, edx
movzx edx, byte [edi + 3]
imul ecx, edx
cdq
add ecx, ebx
idiv ecx
mov byte [edi + 1], al
mov ebx, dword [esi + 0xd8]
test ebx, ebx
jne 0x40fbc3
movzx eax, byte [edi]
jmp 0x40fc05
movzx edx, byte [edi + 3]
test edx, edx
jne 0x40fbd6
mov eax, dword [esi + 0xd4]
cdq
idiv ebx
jmp 0x40fc05
movzx eax, byte [edi]
imul ebx, ebx, 0xff
mov ecx, dword [esi + 0xdc]
imul eax, ecx
imul eax, edx
mov edx, dword [esi + 0xd4]
imul edx, edx, 0xff
add eax, edx
movzx edx, byte [edi + 3]
imul ecx, edx
cdq
add ecx, ebx
idiv ecx
mov byte [edi], al
add edi, 4
dec dword [ebp + 0x10]
jne 0x40fb08
jmp 0x40fcc3
cmp dword [ebp + 0x10], edx
je 0x40fcc3
movzx eax, byte [edi + 2]
imul eax, dword [esi + 0xdc]
add eax, dword [esi + 0xcc]
mov ecx, 0xff
cdq
mov ebx, ecx
idiv ebx
mov byte [edi + 2], al
movzx eax, byte [edi + 1]
imul eax, dword [esi + 0xdc]
add eax, dword [esi + 0xd0]
cdq
idiv ebx
mov byte [edi + 1], al
movzx eax, byte [edi]
imul eax, dword [esi + 0xdc]
add eax, dword [esi + 0xd4]
cdq
idiv ecx
mov byte [edi], al
add edi, 3
dec dword [ebp + 0x10]
jne 0x40fc21
jmp 0x40fcc3
cmp dword [ebp + 0x10], edx
je 0x40fcc3
mov al, byte [esi + 0xcc]
mov byte [edi + 2], al
mov al, byte [esi + 0xd0]
mov byte [edi + 1], al
mov al, byte [esi + 0xd4]
mov byte [edi], al
add edi, dword [esi + 0xb4]
dec dword [ebp + 0x10]
jne 0x40fc7a
jmp 0x40fcc3
cmp dword [ebp + 0x10], edx
je 0x40fcc3
push dword [ebp + 0xc]
mov eax, esi
push dword [ebp + 8]
call fcn.0040f39e
add edi, dword [esi + 0xb4]
inc dword [ebp + 8]
dec dword [ebp + 0x10]
pop ecx
pop ecx
jne 0x40fca6
pop edi
pop ebx
pop ebp
ret