Function at 0x40c714
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x348
push ebx
push esi
push edi
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov ebx, eax
test ebx, ebx
mov dword [ebp - 0x40], ebx
je 0x40c7b8
movzx eax, word [ebx + 0xe]
cmp eax, 1
mov dword [ebp - 0x3c], eax
je 0x40c751
cmp eax, 4
je 0x40c751
cmp eax, 8
je 0x40c751
cmp eax, 0x18
jne 0x40c7b8
mov esi, dword [ebx + 4]
mov edi, dword [ebp + 0xc]
mov eax, dword [ebx + 8]
cmp esi, edi
mov dword [ebp - 0xc], esi
mov dword [ebp - 0x20], eax
jbe 0x40c769
mov esi, edi
mov dword [ebp - 0xc], esi
mov ecx, dword [ebp + 0x10]
cmp eax, ecx
jbe 0x40c773
mov dword [ebp - 0x20], ecx
mov eax, edi
push 8
sub eax, esi
push ecx
cdq
sub eax, edx
push edi
sar eax, 1
mov dword [ebp - 0x48], eax
mov eax, ecx
sub eax, dword [ebp - 0x20]
cdq
sub eax, edx
sar eax, 1
mov dword [ebp - 0x30], eax
call fcn.00404a52
add esp, 0xc
mov dword [ebp - 0x34], eax
test eax, eax
je 0x40c7af
push eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov edi, eax
test edi, edi
mov dword [ebp - 0x38], edi
jne 0x40c7bf
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret
lea eax, [esi + esi*2]
xor ecx, ecx
mov dword [ebp + 0xc], eax
mov eax, ecx
mov esi, 0xc0
and eax, 0xc0
imul eax, eax, 0xff
add eax, 0x60
cdq
idiv esi
add esi, 0x20
mov byte [ebp + ecx - 0x148], al
mov eax, ecx
and eax, 0x38
imul eax, eax, 0x3fc
add eax, 0x70
cdq
idiv esi
mov esi, 0xc0
mov byte [ebp + ecx - 0x248], al
mov eax, ecx
and eax, 6
imul eax, eax, 0x1fe0
add eax, 0x60
cdq
idiv esi
inc ecx
mov edx, 0x100
cmp ecx, edx
mov byte [ebp + ecx - 0x349], al
jl 0x40c7c7
mov eax, dword [edi]
xor esi, esi
add eax, edi
inc eax
mov cl, byte [ebp + esi - 0x148]
inc esi
mov byte [eax + 1], cl
mov cl, byte [ebp + esi - 0x249]
mov byte [eax], cl
mov cl, byte [ebp + esi - 0x349]
mov byte [eax - 1], cl
add eax, 4
cmp esi, edx
jl 0x40c82f
mov eax, dword [ebx]
add eax, ebx
mov dword [ebp - 0x18], eax
call fcn.00406115
mov eax, dword [ebp + 0xc]
mov esi, eax
shl esi, 2
push esi
call fcn.0042df00
push esi
mov dword [ebp - 0x24], eax
call fcn.0042df00
cmp dword [ebp - 0x24], 0
pop ecx
pop ecx
mov dword [ebp - 0x28], eax
je 0x40c7b8
test eax, eax
je 0x40c7b8
movzx esi, word [edi + 0xe]
imul esi, dword [edi + 4]
and dword [ebp + 0xc], 0
add esi, 0x1f
shr esi, 3
and esi, 0x1ffffffc
cmp dword [ebp + 0x10], 0
jle 0x40c8f5
cmp dword [edi + 0x10], 3
jne 0x40c8ba
mov eax, dword [edi]
lea eax, [eax + edi + 0xc]
jmp 0x40c8c4
mov eax, dword [edi + 0x20]
mov ecx, dword [edi]
lea eax, [ecx + eax*4]
add eax, edi
movzx ecx, word [edi + 0xe]
imul ecx, dword [edi + 4]
add ecx, 0x1f
push esi
shr ecx, 3
and ecx, 0x1ffffffc
push 0
imul ecx, dword [ebp + 0xc]
add ecx, eax
push ecx
call fcn.0042de60
add esp, 0xc
inc dword [ebp + 0xc]
mov eax, dword [ebp + 0xc]
cmp eax, dword [ebp + 0x10]
jl 0x40c8ac
cmp dword [ebx + 0x10], 3
jne 0x40c903
mov eax, dword [ebx]
lea edx, [eax + ebx + 0xc]
jmp 0x40c90d
mov eax, dword [ebx + 0x20]
mov ecx, dword [ebx]
lea edx, [ecx + eax*4]
add edx, ebx
and dword [ebp + 0x10], 0
cmp dword [ebp - 0xc], 0
mov esi, dword [ebp - 0x28]
mov dword [ebp - 4], edx
jle 0x40ca49
lea ecx, [edx + 1]
mov dword [ebp - 8], ecx
mov eax, dword [ebp - 0x3c]
dec eax
je 0x40c9d1
sub eax, 3
je 0x40c983
sub eax, 4
je 0x40c95d
sub eax, 0x10
jne 0x40ca1c
movzx eax, byte [ecx + 1]
mov dword [ebp + 0xc], eax
movzx eax, byte [ecx]
mov dword [ebp - 0x14], eax
movzx eax, byte [ecx - 1]
mov dword [ebp - 0x10], eax
jmp 0x40ca1c
mov eax, dword [ebp + 0x10]
movzx eax, byte [eax + edx]
mov edx, dword [ebp - 0x18]
lea eax, [edx + eax*4]
movzx edx, byte [eax + 2]
mov dword [ebp + 0xc], edx
movzx edx, byte [eax + 1]
movzx eax, byte [eax]
mov dword [ebp - 0x14], edx
mov dword [ebp - 0x10], eax
jmp 0x40ca19
mov eax, dword [ebp + 0x10]
push 2
cdq
pop ecx
idiv ecx
mov eax, dword [ebp + 0x10]
test edx, edx
cdq
jne 0x40c9a3
sub eax, edx
mov edx, dword [ebp - 4]
sar eax, 1
mov al, byte [eax + edx]
shr al, 4
jmp 0x40c9af
sub eax, edx
mov edx, dword [ebp - 4]
sar eax, 1
mov al, byte [eax + edx]
and al, 0xf
mov ecx, dword [ebp - 0x18]
movzx eax, al
lea eax, [ecx + eax*4]
movzx ecx, byte [eax + 2]
mov dword [ebp + 0xc], ecx
movzx ecx, byte [eax + 1]
movzx eax, byte [eax]
mov dword [ebp - 0x14], ecx
mov ecx, dword [ebp - 8]
mov dword [ebp - 0x10], eax
jmp 0x40ca1c
mov eax, dword [ebp + 0x10]
push 8
cdq
pop ecx
mov bl, 1
idiv ecx
mov eax, dword [ebp + 0x10]
push 7
pop ecx
push 8
sub ecx, edx
shl bl, cl
cdq
pop ecx
idiv ecx
mov ecx, dword [ebp - 4]
and bl, byte [eax + ecx]
je 0x40c9f6
mov bl, 1
mov ecx, dword [ebp - 0x18]
movzx eax, bl
mov ebx, dword [ebp - 0x40]
lea eax, [ecx + eax*4]
movzx ecx, byte [eax + 2]
mov dword [ebp + 0xc], ecx
movzx ecx, byte [eax + 1]
movzx eax, byte [eax]
mov dword [ebp - 0x14], ecx
mov ecx, dword [ebp - 8]
mov dword [ebp - 0x10], eax
mov edx, dword [ebp - 4]
mov eax, dword [ebp + 0xc]
add ecx, 3
mov dword [esi], eax
mov eax, dword [ebp - 0x14]
add esi, 4
mov dword [ebp - 8], ecx
mov dword [esi], eax
mov eax, dword [ebp - 0x10]
add esi, 4
mov dword [esi], eax
mov eax, dword [ebp - 0xc]
add esi, 4
inc dword [ebp + 0x10]
cmp dword [ebp + 0x10], eax
jl 0x40c927
and dword [ebp - 8], 0
cmp dword [ebp - 0x20], 0
jle 0x40cdae
push 1
pop eax
sub eax, dword [ebp - 0x30]
mov dword [ebp - 0x44], eax
jmp 0x40ca65
mov ebx, dword [ebp - 0x40]
mov eax, dword [ebp - 0x28]
mov ecx, dword [ebp - 0x24]
mov edx, dword [ebp - 8]
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x1c], ecx
dec eax
mov dword [ebp - 0x28], ecx
cmp edx, eax
je 0x40cbe0
cmp dword [ebx + 0x10], 3
jne 0x40ca91
mov eax, dword [ebx]
lea eax, [eax + ebx + 0xc]
jmp 0x40ca9b
mov eax, dword [ebx + 0x20]
mov esi, dword [ebx]
lea eax, [esi + eax*4]
add eax, ebx
movzx esi, word [ebx + 0xe]
imul esi, dword [ebx + 4]
mov ebx, dword [ebp - 0x44]
add esi, 0x1f
add ebx, edx
and dword [ebp + 0x10], 0
add ebx, dword [ebp - 0x30]
shr esi, 3
and esi, 0x1ffffffc
imul esi, ebx
add esi, eax
cmp dword [ebp - 0xc], 0
jle 0x40cbe0
lea edx, [esi + 1]
mov dword [ebp - 4], edx
mov eax, dword [ebp - 0x3c]
dec eax
je 0x40cb6b
sub eax, 3
je 0x40cb26
sub eax, 4
je 0x40cb06
sub eax, 0x10
jne 0x40cbb0
movzx eax, byte [edx + 1]
mov dword [ebp + 0xc], eax
movzx eax, byte [edx]
mov dword [ebp - 0x14], eax
movzx eax, byte [edx - 1]
mov dword [ebp - 0x10], eax
jmp 0x40cbb0
mov eax, dword [ebp + 0x10]
mov ebx, dword [ebp - 0x18]
movzx eax, byte [eax + esi]
lea eax, [ebx + eax*4]
movzx ebx, byte [eax + 2]
mov dword [ebp + 0xc], ebx
movzx ebx, byte [eax + 1]
movzx eax, byte [eax]
mov dword [ebp - 0x14], ebx
jmp 0x40cafe
mov eax, dword [ebp + 0x10]
push 2
cdq
pop ebx
idiv ebx
mov eax, dword [ebp + 0x10]
test edx, edx
cdq
jne 0x40cb43
sub eax, edx
sar eax, 1
mov al, byte [eax + esi]
shr al, 4
jmp 0x40cb4c
sub eax, edx
sar eax, 1
mov al, byte [eax + esi]
and al, 0xf
mov edx, dword [ebp - 0x18]
movzx eax, al
lea eax, [edx + eax*4]
movzx edx, byte [eax + 2]
mov dword [ebp + 0xc], edx
movzx edx, byte [eax + 1]
movzx eax, byte [eax]
mov dword [ebp - 0x14], edx
mov dword [ebp - 0x10], eax
jmp 0x40cbad
mov eax, dword [ebp + 0x10]
push 8
cdq
pop ecx
mov bl, 1
idiv ecx
mov eax, dword [ebp + 0x10]
push 7
pop ecx
push 8
sub ecx, edx
shl bl, cl
cdq
pop ecx
idiv ecx
and bl, byte [eax + esi]
je 0x40cb8d
mov bl, 1
mov ecx, dword [ebp - 0x18]
movzx eax, bl
lea eax, [ecx + eax*4]
movzx ecx, byte [eax + 2]
mov dword [ebp + 0xc], ecx
movzx ecx, byte [eax + 1]
movzx eax, byte [eax]
mov dword [ebp - 0x14], ecx
mov ecx, dword [ebp - 0x1c]
mov dword [ebp - 0x10], eax
mov edx, dword [ebp - 4]
mov eax, dword [ebp + 0xc]
add edx, 3
mov dword [ecx], eax
mov eax, dword [ebp - 0x14]
add ecx, 4
mov dword [ebp - 4], edx
mov dword [ecx], eax
mov eax, dword [ebp - 0x10]
add ecx, 4
mov dword [ecx], eax
add ecx, 4
inc dword [ebp + 0x10]
mov dword [ebp - 0x1c], ecx
mov eax, dword [ebp + 0x10]
cmp eax, dword [ebp - 0xc]
jl 0x40cad0
cmp dword [edi + 0x10], 3
jne 0x40cbee
mov eax, dword [edi]
lea ecx, [eax + edi + 0xc]
jmp 0x40cbf8
mov eax, dword [edi + 0x20]
mov ecx, dword [edi]
lea ecx, [ecx + eax*4]
add ecx, edi
movzx eax, word [edi + 0xe]
mov edx, eax
mov esi, dword [ebp - 8]
imul edx, dword [edi + 4]
imul eax, dword [ebp - 0x48]
mov ebx, dword [ebp - 0x30]
add edx, 0x1f
shr edx, 3
and edx, 0x1ffffffc
add esi, ebx
imul edx, esi
and dword [ebp - 4], 0
add ecx, edx
mov edx, dword [ebp - 0x24]
shr eax, 3
add eax, ecx
cmp dword [ebp - 0xc], 0
mov dword [ebp - 0x1c], eax
jle 0x40cd9f
mov eax, dword [ebp - 0x28]
mov ebx, 0xff
add eax, 8
mov esi, dword [edx]
mov ecx, dword [edx + 4]
add edx, 4
mov dword [ebp + 0x10], ecx
add edx, 4
mov ecx, dword [edx]
add edx, 4
test esi, esi
mov dword [ebp - 0x2c], ecx
jge 0x40cc5f
xor esi, esi
cmp esi, ebx
jle 0x40cc65
mov esi, ebx
cmp dword [ebp + 0x10], 0
jge 0x40cc6f
and dword [ebp + 0x10], 0
cmp dword [ebp + 0x10], ebx
jle 0x40cc77
mov dword [ebp + 0x10], ebx
test ecx, ecx
jge 0x40cc80
xor ecx, ecx
mov dword [ebp - 0x2c], ecx
cmp ecx, ebx
jle 0x40cc89
mov ecx, ebx
mov dword [ebp - 0x2c], ecx
mov edi, dword [ebp + 0x10]
mov ebx, 0x100
sar ecx, 3
and ecx, 0x18
and edi, 0xe0
or ecx, edi
mov edi, esi
sar ecx, 2
and edi, 0xc0
or ecx, edi
mov edi, dword [ebp - 0x1c]
mov byte [edi], cl
movzx edi, byte [ebp + ecx - 0x148]
sub ebx, edi
movzx edi, byte [ebp + ecx - 0x248]
add esi, ebx
mov ebx, 0x100
sub ebx, edi
mov edi, dword [ebp + 0x10]
add edi, ebx
movzx ebx, byte [ebp + ecx - 0x348]
mov ecx, 0x100
sub ecx, ebx
mov ebx, dword [ebp - 0x2c]
add ebx, ecx
mov ecx, dword [ebp - 0xc]
dec ecx
cmp dword [ebp - 4], ecx
je 0x40cd0b
mov ecx, dword [esi*4 + 0x453d78]
add dword [edx], ecx
mov ecx, dword [edi*4 + 0x453d78]
add dword [edx + 4], ecx
mov ecx, dword [ebx*4 + 0x453d78]
add dword [edx + 8], ecx
mov ecx, dword [ebp - 0x20]
dec ecx
cmp dword [ebp - 8], ecx
je 0x40cd85
mov ecx, esi
shl ecx, 2
mov esi, dword [ecx + 0x454578]
add dword [eax - 8], esi
mov esi, edi
shl esi, 2
mov edi, dword [esi + 0x454578]
add dword [eax - 4], edi
mov edi, ebx
shl edi, 2
mov ebx, dword [edi + 0x454578]
add dword [eax], ebx
cmp dword [ebp - 4], 0
jle 0x40cd5e
mov ebx, dword [ecx + 0x454d78]
add dword [eax - 0x14], ebx
mov ebx, dword [esi + 0x454d78]
add dword [eax - 0x10], ebx
mov ebx, dword [edi + 0x454d78]
add dword [eax - 0xc], ebx
mov ebx, dword [ebp - 0xc]
dec ebx
cmp dword [ebp - 4], ebx
je 0x40cd82
mov ecx, dword [ecx + 0x455578]
add dword [eax + 4], ecx
mov ecx, dword [esi + 0x455578]
add dword [eax + 8], ecx
mov ecx, dword [edi + 0x455578]
add dword [eax + 0xc], ecx
add eax, 0xc
inc dword [ebp - 4]
inc dword [ebp - 0x1c]
mov ecx, dword [ebp - 4]
mov edi, dword [ebp - 0x38]
cmp ecx, dword [ebp - 0xc]
mov ebx, 0xff
jl 0x40cc43
inc dword [ebp - 8]
mov eax, dword [ebp - 8]
cmp eax, dword [ebp - 0x20]
jl 0x40ca62
push dword [ebp + 8]
mov esi, dword [sym.imp.KERNEL32.dll_GlobalUnlock]
call esi
push dword [ebp - 0x34]
call esi
push dword [ebp - 0x24]
call fcn.0042deb8
push dword [ebp - 0x28]
call fcn.0042deb8
mov eax, dword [ebp - 0x34]
pop ecx
pop ecx
jmp 0x40c7ba