Function at 0x40b4ab
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x324
push ebx
push esi
mov esi, dword [ebp + 0x10]
push edi
push 8
push dword [ebp + 0x14]
push esi
call fcn.00404a52
mov edi, eax
add esp, 0xc
test edi, edi
mov dword [ebp - 0x24], edi
je 0x40b4e8
push edi
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov ebx, eax
test ebx, ebx
mov dword [ebp - 0x20], ebx
jne 0x40b4ef
push edi
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 edi, esi
and eax, esi
imul eax, eax, 0xff
add eax, 0x60
cdq
idiv edi
mov edi, 0xe0
mov byte [ebp + ecx - 0x124], al
mov eax, ecx
and eax, 0x38
imul eax, eax, 0x3fc
add eax, 0x70
cdq
idiv edi
mov edi, esi
mov byte [ebp + ecx - 0x224], al
mov eax, ecx
and eax, 6
imul eax, eax, 0x1fe0
add eax, 0x60
cdq
idiv edi
inc ecx
mov edi, 0x100
cmp ecx, edi
mov byte [ebp + ecx - 0x325], al
jl 0x40b4fc
mov eax, dword [ebx]
xor ecx, ecx
add eax, ebx
inc eax
mov dl, byte [ebp + ecx - 0x124]
inc ecx
mov byte [eax + 1], dl
mov dl, byte [ebp + ecx - 0x225]
mov byte [eax], dl
mov dl, byte [ebp + ecx - 0x325]
mov byte [eax - 1], dl
add eax, 4
cmp ecx, edi
jl 0x40b55d
call fcn.00406115
mov eax, dword [ebp - 0x1c]
mov esi, eax
shl esi, 2
push esi
mov dword [ebp - 0x10], esi
call fcn.0042df00
push esi
mov dword [ebp - 0x18], eax
call fcn.0042df00
push esi
mov dword [ebp - 0x14], eax
call fcn.0042df00
mov dword [ebp - 0x1c], eax
xor eax, eax
add esp, 0xc
cmp dword [ebp - 0x18], eax
je 0x40b4e8
cmp dword [ebp - 0x14], eax
je 0x40b4e8
cmp dword [ebp + 0x18], eax
jne 0x40b86c
cmp dword [ebp + 0x1c], eax
push dword [ebp + 0x14]
je 0x40b5dd
push dword [ebp + 0xc]
push dword [ebp + 8]
jmp 0x40b5e3
push dword [ebp + 8]
push dword [ebp + 0xc]
push eax
call fcn.00406084
mov edi, dword [ebp + 0x10]
xor edx, edx
movzx ecx, al
mov dl, ah
add esp, 0x10
shr eax, 0x10
movzx esi, al
mov eax, dword [ebp - 0x14]
test edi, edi
movzx edx, dl
jle 0x40b618
mov dword [eax], ecx
add eax, 4
mov dword [eax], edx
add eax, 4
mov dword [eax], esi
add eax, 4
dec edi
jne 0x40b606
and dword [ebp - 0x10], 0
cmp dword [ebp + 0x14], 0
jle 0x40bad8
mov eax, dword [ebp - 0x14]
mov esi, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 0x18], eax
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x14], esi
lea edx, [eax - 1]
cmp ecx, edx
je 0x40b6a2
cmp dword [ebp + 0x1c], 0
je 0x40b668
cdq
sub eax, edx
sar eax, 1
cmp ecx, eax
jg 0x40b65a
add eax, 2
push eax
push dword [ebp + 0xc]
push dword [ebp + 8]
jmp 0x40b66f
lea edx, [eax + 2]
sub ecx, eax
push edx
push dword [ebp + 8]
push dword [ebp + 0xc]
jmp 0x40b670
push eax
push dword [ebp + 8]
push dword [ebp + 0xc]
inc ecx
push ecx
call fcn.00406084
mov edi, dword [ebp + 0x10]
xor edx, edx
movzx ecx, al
mov dl, ah
add esp, 0x10
shr eax, 0x10
test edi, edi
movzx edx, dl
movzx eax, al
jle 0x40b6a2
mov dword [esi], ecx
add esi, 4
mov dword [esi], edx
add esi, 4
mov dword [esi], eax
add esi, 4
dec edi
jne 0x40b690
cmp dword [ebx + 0x10], 3
jne 0x40b6b0
mov eax, dword [ebx]
lea eax, [eax + ebx + 0xc]
jmp 0x40b6ba
mov eax, dword [ebx + 0x20]
mov ecx, dword [ebx]
lea eax, [ecx + eax*4]
add eax, ebx
movzx edx, word [ebx + 0xe]
imul edx, dword [ebx + 4]
add edx, 0x1f
and dword [ebp - 0xc], 0
shr edx, 3
and edx, 0x1ffffffc
mov edi, dword [ebp - 0x18]
imul edx, dword [ebp - 0x10]
add edx, eax
cmp dword [ebp + 0x10], 0
jle 0x40b858
mov eax, dword [ebp - 0x14]
add eax, 8
mov esi, dword [edi]
mov ebx, dword [edi + 4]
add edi, 4
mov dword [ebp - 8], ebx
add edi, 4
mov ecx, 0xff
mov dword [ebp + 0x18], esi
mov ebx, dword [edi]
add edi, 4
mov dword [ebp - 4], ebx
xor ebx, ebx
cmp esi, ebx
jge 0x40b712
mov dword [ebp + 0x18], ebx
cmp dword [ebp + 0x18], ecx
jle 0x40b71a
mov dword [ebp + 0x18], ecx
cmp dword [ebp - 8], ebx
jge 0x40b722
mov dword [ebp - 8], ebx
cmp dword [ebp - 8], ecx
jle 0x40b72a
mov dword [ebp - 8], ecx
cmp dword [ebp - 4], ebx
jge 0x40b732
mov dword [ebp - 4], ebx
cmp dword [ebp - 4], ecx
jle 0x40b73a
mov dword [ebp - 4], ecx
mov ecx, dword [ebp - 4]
mov esi, dword [ebp - 8]
sar ecx, 3
and ecx, 0x18
and esi, 0xe0
or ecx, esi
mov esi, dword [ebp + 0x18]
sar ecx, 2
and esi, 0xc0
mov ebx, 0x100
or ecx, esi
mov byte [edx], cl
movzx esi, byte [ebp + ecx - 0x124]
sub ebx, esi
movzx esi, byte [ebp + ecx - 0x224]
add dword [ebp + 0x18], ebx
mov ebx, 0x100
movzx ecx, byte [ebp + ecx - 0x324]
sub ebx, esi
mov esi, dword [ebp - 8]
add esi, ebx
mov ebx, 0x100
sub ebx, ecx
mov ecx, dword [ebp + 0x10]
add dword [ebp - 4], ebx
dec ecx
cmp dword [ebp - 0xc], ecx
je 0x40b7c2
mov ecx, dword [ebp + 0x18]
mov ecx, dword [ecx*4 + 0x453d78]
add dword [edi], ecx
mov ecx, dword [esi*4 + 0x453d78]
add dword [edi + 4], ecx
mov ecx, dword [ebp - 4]
mov ecx, dword [ecx*4 + 0x453d78]
add dword [edi + 8], ecx
mov ecx, dword [ebp + 0x14]
dec ecx
cmp dword [ebp - 0x10], ecx
je 0x40b845
mov ecx, dword [ebp + 0x18]
shl ecx, 2
shl esi, 2
mov ebx, dword [ecx + 0x454578]
add dword [eax - 8], ebx
mov ebx, dword [esi + 0x454578]
add dword [eax - 4], ebx
mov ebx, dword [ebp - 4]
shl ebx, 2
mov dword [ebp + 0x18], ebx
mov ebx, dword [ebx + 0x454578]
add dword [eax], ebx
cmp dword [ebp - 0xc], 0
jle 0x40b81b
mov ebx, dword [ecx + 0x454d78]
add dword [eax - 0x14], ebx
mov ebx, dword [esi + 0x454d78]
add dword [eax - 0x10], ebx
mov ebx, dword [ebp + 0x18]
mov ebx, dword [ebx + 0x454d78]
add dword [eax - 0xc], ebx
mov ebx, dword [ebp + 0x10]
dec ebx
cmp dword [ebp - 0xc], ebx
je 0x40b842
mov ecx, dword [ecx + 0x455578]
add dword [eax + 4], ecx
mov ecx, dword [esi + 0x455578]
add dword [eax + 8], ecx
mov ecx, dword [ebp + 0x18]
mov ecx, dword [ecx + 0x455578]
add dword [eax + 0xc], ecx
add eax, 0xc
inc dword [ebp - 0xc]
inc edx
mov ecx, dword [ebp - 0xc]
cmp ecx, dword [ebp + 0x10]
jl 0x40b6eb
mov ebx, dword [ebp - 0x20]
inc dword [ebp - 0x10]
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp + 0x14]
jl 0x40b626
jmp 0x40bad8
mov esi, dword [ebp - 0x1c]
xor edi, edi
cmp dword [ebp + 0x10], edi
jle 0x40b8d6
cmp dword [ebp + 0x1c], 0
je 0x40b89f
mov eax, dword [ebp + 0x10]
cdq
sub eax, edx
sar eax, 1
cmp edi, eax
jg 0x40b88e
add eax, 2
push eax
jmp 0x40b8a2
lea ecx, [eax + 2]
push ecx
mov ecx, edi
push dword [ebp + 8]
sub ecx, eax
push dword [ebp + 0xc]
push ecx
jmp 0x40b8a9
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push dword [ebp + 8]
push edi
call fcn.00406084
movzx ecx, al
mov dword [esi], ecx
xor ecx, ecx
mov cl, ah
add esi, 4
movzx ecx, cl
shr eax, 0x10
mov dword [esi], ecx
add esi, 4
movzx eax, al
mov dword [esi], eax
add esp, 0x10
add esi, 4
inc edi
cmp edi, dword [ebp + 0x10]
jl 0x40b876
push dword [ebp - 0x10]
push dword [ebp - 0x1c]
push dword [ebp - 0x14]
call fcn.0042d5f0
and dword [ebp + 0xc], 0
add esp, 0xc
cmp dword [ebp + 0x14], 0
jle 0x40bad8
mov eax, dword [ebp + 0x14]
mov edi, dword [ebp - 0x18]
mov esi, dword [ebp - 0x14]
dec eax
cmp dword [ebp + 0xc], eax
mov dword [ebp - 0x18], esi
mov dword [ebp - 0x14], edi
je 0x40b919
push dword [ebp - 0x10]
push dword [ebp - 0x1c]
push edi
call fcn.0042d5f0
add esp, 0xc
cmp dword [ebx + 0x10], 3
jne 0x40b927
mov eax, dword [ebx]
lea eax, [eax + ebx + 0xc]
jmp 0x40b931
mov eax, dword [ebx + 0x20]
mov ecx, dword [ebx]
lea eax, [ecx + eax*4]
add eax, ebx
movzx edx, word [ebx + 0xe]
imul edx, dword [ebx + 4]
add edx, 0x1f
and dword [ebp - 0xc], 0
shr edx, 3
and edx, 0x1ffffffc
imul edx, dword [ebp + 0xc]
add edx, eax
cmp dword [ebp + 0x10], 0
jle 0x40bac9
lea eax, [edi + 8]
mov ebx, dword [esi]
mov ecx, dword [esi + 4]
add esi, 4
mov dword [ebp - 8], ecx
add esi, 4
mov edi, 0xff
mov dword [ebp + 0x18], ebx
mov ecx, dword [esi]
add esi, 4
test ebx, ebx
mov dword [ebp - 4], ecx
jge 0x40b982
and dword [ebp + 0x18], 0
cmp dword [ebp + 0x18], edi
jle 0x40b98a
mov dword [ebp + 0x18], edi
cmp dword [ebp - 8], 0
jge 0x40b994
and dword [ebp - 8], 0
cmp dword [ebp - 8], edi
jle 0x40b99c
mov dword [ebp - 8], edi
test ecx, ecx
jge 0x40b9a5
xor ecx, ecx
mov dword [ebp - 4], ecx
cmp ecx, edi
jle 0x40b9ae
mov ecx, edi
mov dword [ebp - 4], 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 + 0x18]
sar ecx, 2
and edi, 0xc0
or ecx, edi
mov byte [edx], cl
movzx edi, byte [ebp + ecx - 0x124]
sub ebx, edi
movzx edi, byte [ebp + ecx - 0x224]
add dword [ebp + 0x18], ebx
mov ebx, 0x100
movzx ecx, byte [ebp + ecx - 0x324]
sub ebx, edi
mov edi, dword [ebp - 8]
add edi, ebx
mov ebx, 0x100
sub ebx, ecx
mov ecx, dword [ebp + 0x10]
add dword [ebp - 4], ebx
dec ecx
cmp dword [ebp - 0xc], ecx
je 0x40ba33
mov ecx, dword [ebp + 0x18]
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 - 4]
mov ecx, dword [ecx*4 + 0x453d78]
add dword [esi + 8], ecx
mov ecx, dword [ebp + 0x14]
dec ecx
cmp dword [ebp + 0xc], ecx
je 0x40bab6
mov ecx, dword [ebp + 0x18]
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 - 4]
shl ebx, 2
mov dword [ebp + 0x18], ebx
mov ebx, dword [ebx + 0x454578]
add dword [eax], ebx
cmp dword [ebp - 0xc], 0
jle 0x40ba8c
mov ebx, dword [ecx + 0x454d78]
add dword [eax - 0x14], ebx
mov ebx, dword [edi + 0x454d78]
add dword [eax - 0x10], ebx
mov ebx, dword [ebp + 0x18]
mov ebx, dword [ebx + 0x454d78]
add dword [eax - 0xc], ebx
mov ebx, dword [ebp + 0x10]
dec ebx
cmp dword [ebp - 0xc], ebx
je 0x40bab3
mov ecx, dword [ecx + 0x455578]
add dword [eax + 4], ecx
mov ecx, dword [edi + 0x455578]
add dword [eax + 8], ecx
mov ecx, dword [ebp + 0x18]
mov ecx, dword [ecx + 0x455578]
add dword [eax + 0xc], ecx
add eax, 0xc
inc dword [ebp - 0xc]
inc edx
mov ecx, dword [ebp - 0xc]
cmp ecx, dword [ebp + 0x10]
jl 0x40b95c
mov ebx, dword [ebp - 0x20]
inc dword [ebp + 0xc]
mov eax, dword [ebp + 0xc]
cmp eax, dword [ebp + 0x14]
jl 0x40b8f5
push dword [ebp - 0x18]
call fcn.0042deb8
push dword [ebp - 0x14]
call fcn.0042deb8
push dword [ebp - 0x1c]
call fcn.0042deb8
add esp, 0xc
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov eax, dword [ebp - 0x24]
jmp 0x40b4ea