Function at 0x3105910
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x1c
mov edi, dword [esp + 0x3c]
mov edx, dword [esp + 0x38]
mov ecx, dword [esp + 0x34]
mov ax, word [esp + 0x30]
test edi, edi
sets bl
mov esi, edi
sub esi, 1
sete bh
or bl, bh
mov esi, edi
sub esi, 0x25
setge bh
or bl, bh
test bl, 1
jne 0x3105948
jmp 0x310594d
jmp 0x3105b75
movsx ebp, ax
cmp ebp, 0
setge bl
mov esi, 0x3d10b0fe
sub esi, ebp
add esi, 0xc2ef4f02
cmp ebp, 0
jge 0x310596b
mov ax, si
mov esi, ecx
add esi, edx
add esi, 0xffffffff
mov byte [ecx + edx - 1], 0
movzx ecx, ax
cmp ecx, 0
jne 0x310598d
mov ecx, esi
add ecx, 0xffffffff
mov byte [esi - 1], 0x30
jmp 0x3105b75
cmp edi, 0xa
sete cl
test cl, 1
jne 0x310599d
jmp 0x3105a98
jmp 0x310599f
movzx ecx, ax
cmp ecx, 0x64
jb 0x31059df
mov edi, 0x64
mov eax, ecx
xor edx, edx
div edi
shl edx, 1
mov al, byte [edx + 0x311c761]
mov edi, esi
add edi, 0xffffffff
mov byte [esi - 1], al
mov al, byte [edx + 0x311c760]
add edi, 0xffffffff
mov byte [esi - 2], al
mov esi, 0x64
mov eax, ecx
xor edx, edx
div esi
mov esi, edi
jmp 0x310599f
cmp ecx, 0xa
setb al
test al, 1
jne 0x31059eb
jmp 0x31059fb
mov al, byte [ecx + str.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ]
add esi, 0xffffffff
jmp 0x31059f7
mov byte [esi], al
jmp 0x3105a1b
shl ecx, 1
mov al, byte [ecx + 0x311c761]
mov edx, esi
add edx, 0xffffffff
mov byte [esi - 1], al
mov al, byte [ecx + 0x311c760]
add edx, 0xffffffff
mov byte [esi - 2], al
mov esi, edx
test bl, 1
je 0x3105a27
mov ecx, esi
jmp 0x3105b75
mov al, byte [esp + 0xc]
mov byte [esp + 0x10], al
mov byte [esp + 0x14], 0x75
mov eax, 1
mov byte [esp + eax + 0x14], 0
add eax, 1
cmp eax, 7
jne 0x3105a39
jmp 0x3105a48
mov dword [esp + 8], 0
mov eax, dword [esp + 8]
cmp eax, 7
jae 0x3105a85
mov eax, dword [esp + 8]
mov ecx, dword [esp + 8]
movzx ecx, byte [esp + ecx + 0x14]
mov dword [esp + 4], eax
mov dword [esp], ecx
call fcn.0310a220
mov ecx, dword [esp + 8]
mov byte [esp + ecx + 0x14], al
mov eax, dword [esp + 8]
inc eax
mov dword [esp + 8], eax
jmp 0x3105a50
mov al, byte [esp + 0x14]
jmp 0x3105a8b
mov ecx, esi
add ecx, 0xffffffff
mov byte [esi - 1], al
jmp 0x3105b75
cmp edi, 0x10
sete cl
jmp 0x3105aa0
test cl, 1
jne 0x3105aac
jmp 0x3105aa7
jmp 0x3105b4a
jmp 0x3105aae
movzx eax, ax
cmp eax, 0x100
setge cl
test cl, 1
jne 0x3105ac0
jmp 0x3105aed
mov ecx, eax
and ecx, 0xff
shl ecx, 1
mov dl, byte [ecx + 0x311c82a]
mov edi, esi
add edi, 0xffffffff
mov byte [esi - 1], dl
mov cl, byte [ecx + str.000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF]
add edi, 0xffffffff
mov byte [esi - 2], cl
shr eax, 8
mov esi, edi
jmp 0x3105aae
cmp eax, 0x10
setl cl
test cl, 1
jne 0x3105afa
jmp 0x3105b0f
lea ecx, str.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ
add ecx, eax
mov al, byte [ecx]
add esi, 0xffffffff
jmp 0x3105b09
mov byte [esi], al
mov ecx, esi
jmp 0x3105b75
mov ecx, eax
xor ecx, 0xffffffff
and ecx, 2
mov edx, eax
and edx, 0xfffffffd
imul edx, ecx
mov ecx, eax
and ecx, 2
or eax, 2
imul eax, ecx
add eax, edx
mov dl, byte [eax + 0x311c82a]
mov ecx, esi
add ecx, 0xffffffff
mov byte [esi - 1], dl
mov al, byte [eax + str.000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF]
add ecx, 0xffffffff
mov byte [esi - 2], al
jmp 0x3105b75
movzx ecx, ax
cmp ecx, 0
jbe 0x3105b71
mov eax, ecx
xor edx, edx
div edi
mov al, byte [edx + str.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ]
mov ebx, esi
add ebx, 0xffffffff
mov byte [esi - 1], al
mov eax, ecx
xor edx, edx
div edi
mov esi, ebx
jmp 0x3105b4a
mov ecx, esi
jmp 0x3105b75
mov eax, ecx
add esp, 0x1c
pop esi
pop edi
pop ebx
pop ebp
ret