Function at 0x40a6d0
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x3c
mov ebx, dword [esp + 0x50]
mov eax, dword [ebx + 0xc]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x60]
or eax, dword [esp + 0x5c]
je 0x40a920
mov esi, dword [ebx + 0x28]
test esi, esi
jne 0x40a9de
mov eax, dword [esp + 0x1c]
mov dword [ebx + 0x28], 0
mov dword [esp + 0x24], 0
add eax, eax
mov dword [esp + 0x2c], eax
mov eax, dword [ebx + 0x20]
add eax, esi
cmp eax, dword [esp + 0x58]
je 0x40a838
mov edx, dword [ebx + 0x2c]
test edx, edx
je 0x40a915
cmp dword [ebx + 0x1c], 1
jle 0x40a765
mov edi, dword [esp + 0x54]
mov eax, ebx
mov dword [esp], 1
add edi, esi
mov ecx, edi
call fcn.0040a140
test eax, eax
jne 0x40a844
cmp dword [ebx + 0x1c], 1
movzx eax, word [ebx + 2]
jle 0x40a76f
movzx edx, word [ebx + 6]
shl edx, 3
jmp 0x40a77c
mov edi, dword [esp + 0x54]
movzx eax, word [ebx + 2]
add edi, esi
movzx edx, word [ebx + 0x14]
and dx, word [ebx]
movzx edx, dx
shl edx, 3
xor edx, eax
mov eax, dword [ebx + 0x40]
mov ecx, dword [ebx + 0x44]
and eax, edx
shr eax, 3
movzx ecx, byte [ecx + eax]
mov eax, edx
and eax, 7
bt ecx, eax
jae 0x40a7bc
mov eax, dword [ebx + 0x3c]
and edx, dword [ebx + 0x34]
mov edx, dword [eax + edx*4]
test edx, edx
je 0x40a7bc
mov ecx, edi
mov eax, ebx
mov dword [esp], 0
call fcn.0040a140
test eax, eax
jne 0x40a9b4
mov eax, dword [ebx + 0x1c]
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x2c]
movzx edx, byte [edi]
movzx eax, byte [edi + eax]
movzx ecx, dl
movzx edx, dl
mov byte [esp + 0x2b], al
mov eax, dword [esp + 0x1c]
movzx ebp, byte [edi + eax]
mov eax, ebp
movzx edi, al
mov eax, edi
add ax, word [ebx]
sub ax, cx
mov ecx, dword [ebx + 0x10]
mov word [ebx], ax
shl edx, cl
sub ax, dx
add word [ebx + 2], ax
cmp dword [esp + 0x20], 1
jle 0x40a826
movzx eax, byte [esp + 0x2b]
and ebp, 0xff
add ax, word [ebx + 4]
shl ebp, cl
sub ax, di
mov word [ebx + 4], ax
add ax, word [ebx + 6]
sub ax, bp
mov word [ebx + 6], ax
mov eax, dword [ebx + 0x20]
add esi, 1
add eax, esi
cmp eax, dword [esp + 0x58]
jne 0x40a723
mov eax, dword [esp + 0x24]
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret
add dword [esp + 0x24], eax
mov edx, 1
xor eax, eax
add eax, dword [esp + 0x1c]
add esi, eax
mov eax, dword [ebx + 0x20]
add eax, esi
cmp dword [esp + 0x58], eax
jb 0x40a902
cmp dword [ebx + 0x1c], 1
setg byte [esp + 0x20]
cmp edx, 1
jne 0x40a8c0
cmp byte [esp + 0x20], 0
je 0x40a8c0
mov eax, dword [ebx + 4]
mov dword [ebx], eax
mov eax, dword [esp + 0x1c]
xor edi, edi
xor ebp, ebp
test eax, eax
je 0x40a8ad
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x1c]
add edx, esi
add edx, dword [esp + 0x54]
movzx ecx, byte [edx]
add edx, 1
movzx ecx, cl
add ebp, ecx
imul ecx, eax
add edi, ecx
sub eax, 1
jne 0x40a898
mov word [ebx + 4], bp
mov word [ebx + 6], di
jmp 0x40a714
mov eax, dword [esp + 0x1c]
xor edi, edi
xor ebp, ebp
test eax, eax
je 0x40a8eb
mov edx, dword [esp + 0x54]
mov eax, dword [esp + 0x1c]
add edx, esi
movzx ecx, byte [edx]
add edx, 1
movzx ecx, cl
add ebp, ecx
imul ecx, eax
add edi, ecx
sub eax, 1
jne 0x40a8d6
cmp byte [esp + 0x20], 0
mov word [ebx], bp
mov word [ebx + 2], di
je 0x40a714
jmp 0x40a87e
sub eax, dword [esp + 0x58]
mov dword [ebx + 0x28], eax
mov eax, dword [esp + 0x24]
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret
mov edi, dword [esp + 0x54]
add edi, esi
jmp 0x40a752
mov dword [ebx + 0x2c], 0
xor esi, esi
mov dword [esp + 0x24], 0
mov eax, dword [esp + 0x1c]
xor edi, edi
xor ebp, ebp
test eax, eax
je 0x40a965
mov edx, dword [esp + 0x54]
mov eax, dword [esp + 0x1c]
add edx, dword [esp + 0x24]
lea esi, [esi]
movzx ecx, byte [edx]
add edx, 1
movzx ecx, cl
add ebp, ecx
imul ecx, eax
add edi, ecx
sub eax, 1
jne 0x40a950
cmp dword [ebx + 0x1c], 1
mov word [ebx], bp
mov word [ebx + 2], di
jle 0x40a6fb
mov eax, dword [esp + 0x1c]
xor edi, edi
xor ebp, ebp
test eax, eax
je 0x40a9a7
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x1c]
add edx, dword [esp + 0x1c]
add edx, dword [esp + 0x54]
movzx ecx, byte [edx]
add edx, 1
movzx ecx, cl
add ebp, ecx
imul ecx, eax
add edi, ecx
sub eax, 1
jne 0x40a992
mov word [ebx + 4], bp
mov word [ebx + 6], di
jmp 0x40a6fb
mov edx, dword [ebx + 0x1c]
add dword [esp + 0x24], eax
test edx, edx
je 0x40a9d1
cmp edx, 1
jle 0x40a84d
mov eax, dword [esp + 0x1c]
jmp 0x40a84f
mov dword [esp + 0x20], 0
jmp 0x40a7c3
mov dword [esp + 0x24], esi
jmp 0x40a931