Function at 0x40bb04
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x328
push ebx
push esi
mov esi, dword [ebp + 0xc]
push edi
push 8
push dword [ebp + 0x10]
push esi
call fcn.00404a52
mov ebx, eax
add esp, 0xc
test ebx, ebx
mov dword [ebp - 0x24], ebx
je 0x40bb41
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov edi, eax
test edi, edi
mov dword [ebp - 0x28], edi
jne 0x40bb48
push ebx
call fcn.0040507a
pop ecx
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret
lea eax, [esi + esi*2]
xor ecx, ecx
mov dword [ebp - 0x1c], eax
mov esi, 0xc0
mov eax, ecx
mov ebx, esi
and eax, esi
imul eax, eax, 0xff
add eax, 0x60
cdq
idiv ebx
mov ebx, 0xe0
mov byte [ebp + ecx - 0x228], al
mov eax, ecx
and eax, 0x38
imul eax, eax, 0x3fc
add eax, 0x70
cdq
idiv ebx
mov ebx, esi
mov byte [ebp + ecx - 0x128], al
mov eax, ecx
and eax, 6
imul eax, eax, 0x1fe0
add eax, 0x60
cdq
idiv ebx
inc ecx
mov edx, 0x100
cmp ecx, edx
mov byte [ebp + ecx - 0x329], al
jl 0x40bb55
mov eax, dword [edi]
xor ecx, ecx
add eax, edi
inc eax
mov bl, byte [ebp + ecx - 0x228]
inc ecx
mov byte [eax + 1], bl
mov bl, byte [ebp + ecx - 0x129]
mov byte [eax], bl
mov bl, byte [ebp + ecx - 0x329]
mov byte [eax - 1], bl
add eax, 4
cmp ecx, edx
jl 0x40bbb6
call fcn.00406115
mov eax, dword [ebp - 0x1c]
mov esi, eax
shl esi, 2
push esi
mov dword [ebp - 0x1c], esi
call fcn.0042df00
push esi
mov dword [ebp - 0x20], eax
call fcn.0042df00
push esi
mov dword [ebp - 0x14], eax
call fcn.0042df00
add esp, 0xc
cmp dword [ebp - 0x20], 0
mov dword [ebp - 0x18], eax
je 0x40bb41
cmp dword [ebp - 0x14], 0
je 0x40bb41
mov eax, dword [ebp + 8]
mov ebx, dword [ebp + 0xc]
xor edx, edx
movzx ecx, al
mov dl, ah
shr eax, 0x10
movzx esi, al
mov eax, dword [ebp - 0x18]
test ebx, ebx
movzx edx, dl
jle 0x40bc4c
mov dword [eax], ecx
add eax, 4
mov dword [eax], edx
add eax, 4
mov dword [eax], esi
add eax, 4
dec ebx
jne 0x40bc3a
push dword [ebp - 0x1c]
push dword [ebp - 0x18]
push dword [ebp - 0x14]
call fcn.0042d5f0
and dword [ebp - 0xc], 0
add esp, 0xc
cmp dword [ebp + 0x10], 0
jle 0x40be4e
mov eax, dword [ebp + 0x10]
mov ebx, dword [ebp - 0x20]
mov esi, dword [ebp - 0x14]
dec eax
cmp dword [ebp - 0xc], eax
mov dword [ebp - 0x20], esi
mov dword [ebp - 0x14], ebx
je 0x40bc8f
push dword [ebp - 0x1c]
push dword [ebp - 0x18]
push ebx
call fcn.0042d5f0
add esp, 0xc
cmp dword [edi + 0x10], 3
jne 0x40bc9d
mov eax, dword [edi]
lea eax, [eax + edi + 0xc]
jmp 0x40bca7
mov eax, dword [edi + 0x20]
mov ecx, dword [edi]
lea eax, [ecx + eax*4]
add eax, edi
movzx edx, word [edi + 0xe]
imul edx, dword [edi + 4]
add edx, 0x1f
and dword [ebp - 4], 0
shr edx, 3
and edx, 0x1ffffffc
imul edx, dword [ebp - 0xc]
add edx, eax
cmp dword [ebp + 0xc], 0
jle 0x40be3f
lea eax, [ebx + 8]
mov edi, dword [esi]
mov ecx, dword [esi + 4]
add esi, 4
mov dword [ebp - 8], ecx
add esi, 4
mov dword [ebp + 8], edi
mov ecx, dword [esi]
add esi, 4
test edi, edi
mov dword [ebp - 0x10], ecx
jge 0x40bcf3
and dword [ebp + 8], 0
mov edi, 0xff
cmp dword [ebp + 8], edi
jle 0x40bd00
mov dword [ebp + 8], edi
cmp dword [ebp - 8], 0
jge 0x40bd0a
and dword [ebp - 8], 0
cmp dword [ebp - 8], edi
jle 0x40bd12
mov dword [ebp - 8], edi
test ecx, ecx
jge 0x40bd1b
xor ecx, ecx
mov dword [ebp - 0x10], ecx
cmp ecx, edi
jle 0x40bd24
mov ecx, edi
mov dword [ebp - 0x10], ecx
mov edi, dword [ebp - 8]
mov ebx, 0x100
sar ecx, 3
and ecx, 0x18
and edi, 0xe0
or ecx, edi
mov edi, dword [ebp + 8]
sar ecx, 2
and edi, 0xc0
or ecx, edi
mov byte [edx], cl
movzx edi, byte [ebp + ecx - 0x228]
sub ebx, edi
movzx edi, byte [ebp + ecx - 0x128]
add dword [ebp + 8], ebx
mov ebx, 0x100
movzx ecx, byte [ebp + ecx - 0x328]
sub ebx, edi
mov edi, dword [ebp - 8]
add edi, ebx
mov ebx, 0x100
sub ebx, ecx
mov ecx, dword [ebp + 0xc]
add dword [ebp - 0x10], ebx
dec ecx
cmp dword [ebp - 4], ecx
je 0x40bda9
mov ecx, dword [ebp + 8]
mov ecx, dword [ecx*4 + 0x453d78]
add dword [esi], ecx
mov ecx, dword [edi*4 + 0x453d78]
add dword [esi + 4], ecx
mov ecx, dword [ebp - 0x10]
mov ecx, dword [ecx*4 + 0x453d78]
add dword [esi + 8], ecx
mov ecx, dword [ebp + 0x10]
dec ecx
cmp dword [ebp - 0xc], ecx
je 0x40be2c
mov ecx, dword [ebp + 8]
shl ecx, 2
shl edi, 2
mov ebx, dword [ecx + 0x454578]
add dword [eax - 8], ebx
mov ebx, dword [edi + 0x454578]
add dword [eax - 4], ebx
mov ebx, dword [ebp - 0x10]
shl ebx, 2
mov dword [ebp + 8], ebx
mov ebx, dword [ebx + 0x454578]
add dword [eax], ebx
cmp dword [ebp - 4], 0
jle 0x40be02
mov ebx, dword [ecx + 0x454d78]
add dword [eax - 0x14], ebx
mov ebx, dword [edi + 0x454d78]
add dword [eax - 0x10], ebx
mov ebx, dword [ebp + 8]
mov ebx, dword [ebx + 0x454d78]
add dword [eax - 0xc], ebx
mov ebx, dword [ebp + 0xc]
dec ebx
cmp dword [ebp - 4], ebx
je 0x40be29
mov ecx, dword [ecx + 0x455578]
add dword [eax + 4], ecx
mov ecx, dword [edi + 0x455578]
add dword [eax + 8], ecx
mov ecx, dword [ebp + 8]
mov ecx, dword [ecx + 0x455578]
add dword [eax + 0xc], ecx
add eax, 0xc
inc dword [ebp - 4]
inc edx
mov ecx, dword [ebp - 4]
cmp ecx, dword [ebp + 0xc]
jl 0x40bcd2
mov edi, dword [ebp - 0x28]
inc dword [ebp - 0xc]
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp + 0x10]
jl 0x40bc6b
push dword [ebp - 0x20]
call fcn.0042deb8
push dword [ebp - 0x14]
call fcn.0042deb8
push dword [ebp - 0x18]
call fcn.0042deb8
add esp, 0xc
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov eax, dword [ebp - 0x24]
jmp 0x40bb43