Function at 0x40cdd8
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x35c
push ebx
push esi
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GlobalLock]
push dword [ebp + 8]
call edi
test eax, eax
mov dword [ebp - 0x44], eax
je 0x40ce5c
movzx ecx, word [eax + 0xe]
cmp ecx, 1
mov dword [ebp - 0x50], ecx
je 0x40ce11
cmp ecx, 4
je 0x40ce11
cmp ecx, 8
je 0x40ce11
cmp ecx, 0x18
jne 0x40ce5c
mov esi, dword [eax + 4]
mov eax, dword [eax + 8]
cmp esi, dword [ebp + 0xc]
mov dword [ebp - 0x10], esi
mov dword [ebp - 0x24], eax
jbe 0x40ce28
mov esi, dword [ebp + 0xc]
mov dword [ebp - 0x10], esi
mov ecx, dword [ebp + 0x10]
cmp eax, ecx
jbe 0x40ce32
mov dword [ebp - 0x24], ecx
push 8
push ecx
push dword [ebp + 0xc]
call fcn.00404a52
add esp, 0xc
mov dword [ebp - 0x54], eax
test eax, eax
je 0x40ce53
push eax
call edi
mov ebx, eax
test ebx, ebx
mov dword [ebp - 0x38], ebx
jne 0x40ce63
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 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 - 0x15c], al
mov eax, ecx
and eax, 0x38
imul eax, eax, 0x3fc
add eax, 0x70
cdq
idiv edi
mov edi, esi
mov byte [ebp + ecx - 0x25c], 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 - 0x35d], al
jl 0x40ce70
mov eax, dword [ebx]
xor esi, esi
add eax, ebx
inc eax
mov cl, byte [ebp + esi - 0x15c]
inc esi
mov byte [eax + 1], cl
mov cl, byte [ebp + esi - 0x25d]
mov byte [eax], cl
mov cl, byte [ebp + esi - 0x35d]
mov byte [eax - 1], cl
add eax, 4
cmp esi, edi
jl 0x40ced1
mov ecx, dword [ebp - 0x44]
mov eax, dword [ecx]
add eax, ecx
mov dword [ebp - 0x30], 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 - 0x34], eax
call fcn.0042df00
cmp dword [ebp - 0x34], 0
pop ecx
pop ecx
mov dword [ebp - 0x3c], eax
je 0x40ce5c
test eax, eax
je 0x40ce5c
movzx esi, word [ebx + 0xe]
imul esi, dword [ebx + 4]
and dword [ebp - 8], 0
add esi, 0x1f
shr esi, 3
mov edi, 0x1ffffffc
and esi, edi
cmp dword [ebp + 0x10], 0
jle 0x40cf97
cmp dword [ebx + 0x10], 3
jne 0x40cf60
mov eax, dword [ebx]
lea eax, [eax + ebx + 0xc]
jmp 0x40cf6a
mov eax, dword [ebx + 0x20]
mov ecx, dword [ebx]
lea eax, [ecx + eax*4]
add eax, ebx
movzx ecx, word [ebx + 0xe]
imul ecx, dword [ebx + 4]
add ecx, 0x1f
push esi
shr ecx, 3
and ecx, edi
push 0
imul ecx, dword [ebp - 8]
add ecx, eax
push ecx
call fcn.0042de60
add esp, 0xc
inc dword [ebp - 8]
mov eax, dword [ebp - 8]
cmp eax, dword [ebp + 0x10]
jl 0x40cf52
mov eax, dword [ebp - 0x44]
cmp dword [eax + 0x10], 3
jne 0x40cfa8
mov ecx, dword [eax]
lea edi, [ecx + eax + 0xc]
jmp 0x40cfb2
mov ecx, dword [eax + 0x20]
mov edx, dword [eax]
lea edi, [edx + ecx*4]
add edi, eax
mov esi, dword [ebp - 0x3c]
xor edx, edx
cmp dword [ebp - 0x10], edx
mov dword [ebp - 4], edx
jle 0x40d0b2
lea ecx, [edi + 1]
mov dword [ebp - 0xc], ecx
mov eax, dword [ebp - 0x50]
dec eax
je 0x40d042
sub eax, 3
je 0x40d001
sub eax, 4
je 0x40cffb
sub eax, 0x10
jne 0x40d084
movzx eax, byte [ecx + 1]
mov dword [ebp - 0x18], eax
movzx eax, byte [ecx]
mov dword [ebp - 0x14], eax
movzx eax, byte [ecx - 1]
mov dword [ebp - 0x1c], eax
jmp 0x40d084
movzx eax, byte [edx + edi]
jmp 0x40d029
mov eax, edx
push 2
cdq
pop ebx
idiv ebx
mov eax, dword [ebp - 4]
test edx, edx
cdq
jne 0x40d01d
sub eax, edx
sar eax, 1
mov al, byte [eax + edi]
shr al, 4
jmp 0x40d026
sub eax, edx
sar eax, 1
mov al, byte [eax + edi]
and al, 0xf
movzx eax, al
mov edx, dword [ebp - 0x30]
lea eax, [edx + eax*4]
movzx edx, byte [eax + 2]
mov dword [ebp - 0x18], edx
movzx edx, byte [eax + 1]
movzx eax, byte [eax]
mov dword [ebp - 0x14], edx
jmp 0x40cff3
mov eax, dword [ebp - 4]
push 8
cdq
pop ecx
mov bl, 1
idiv ecx
mov eax, dword [ebp - 4]
push 7
pop ecx
push 8
sub ecx, edx
shl bl, cl
cdq
pop ecx
idiv ecx
and bl, byte [eax + edi]
je 0x40d064
mov bl, 1
mov ecx, dword [ebp - 0x30]
movzx eax, bl
lea eax, [ecx + eax*4]
movzx ecx, byte [eax + 2]
mov dword [ebp - 0x18], ecx
movzx ecx, byte [eax + 1]
movzx eax, byte [eax]
mov dword [ebp - 0x14], ecx
mov ecx, dword [ebp - 0xc]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x18]
mov edx, dword [ebp - 4]
mov dword [esi], eax
mov eax, dword [ebp - 0x14]
add esi, 4
add ecx, 3
mov dword [ebp - 0xc], ecx
mov dword [esi], eax
mov eax, dword [ebp - 0x1c]
add esi, 4
mov dword [esi], eax
add esi, 4
inc edx
cmp edx, dword [ebp - 0x10]
mov dword [ebp - 4], edx
jl 0x40cfc9
and dword [ebp - 0x28], 0
cmp dword [ebp - 0x24], 0
jle 0x40d464
and dword [ebp - 0x40], 0
mov eax, dword [ebp - 0x44]
mov ebx, dword [ebp - 0x38]
jmp 0x40d0d2
mov ebx, dword [ebp - 0x38]
mov eax, dword [ebp - 0x44]
mov ecx, dword [ebp - 0x3c]
mov edi, dword [ebp - 0x34]
mov edx, dword [ebp - 0x28]
mov dword [ebp - 0x34], ecx
mov ecx, dword [ebp - 0x24]
mov dword [ebp - 0x3c], edi
dec ecx
cmp edx, ecx
je 0x40d241
cmp dword [eax + 0x10], 3
jne 0x40d0fb
mov ecx, dword [eax]
lea ecx, [ecx + eax + 0xc]
jmp 0x40d105
mov ecx, dword [eax + 0x20]
mov esi, dword [eax]
lea ecx, [esi + ecx*4]
add ecx, eax
movzx esi, word [eax + 0xe]
imul esi, dword [eax + 4]
add esi, 0x1f
shr esi, 3
and esi, 0x1ffffffc
inc edx
imul esi, edx
xor edx, edx
add esi, ecx
cmp dword [ebp - 0x10], edx
mov dword [ebp - 4], edx
jle 0x40d241
lea ecx, [esi + 1]
mov dword [ebp - 0xc], ecx
mov eax, dword [ebp - 0x50]
dec eax
je 0x40d1ce
sub eax, 3
je 0x40d186
sub eax, 4
je 0x40d169
sub eax, 0x10
jne 0x40d213
movzx eax, byte [ecx + 1]
mov dword [ebp - 0x18], eax
movzx eax, byte [ecx]
mov dword [ebp - 0x14], eax
movzx eax, byte [ecx - 1]
mov dword [ebp - 0x1c], eax
jmp 0x40d213
movzx eax, byte [edx + esi]
mov edx, dword [ebp - 0x30]
lea eax, [edx + eax*4]
movzx edx, byte [eax + 2]
mov dword [ebp - 0x18], edx
movzx edx, byte [eax + 1]
movzx eax, byte [eax]
mov dword [ebp - 0x14], edx
jmp 0x40d161
mov eax, dword [ebp - 4]
push 2
cdq
pop ebx
idiv ebx
mov eax, dword [ebp - 4]
test edx, edx
cdq
jne 0x40d1a3
sub eax, edx
sar eax, 1
mov al, byte [eax + esi]
shr al, 4
jmp 0x40d1ac
sub eax, edx
sar eax, 1
mov al, byte [eax + esi]
and al, 0xf
mov edx, dword [ebp - 0x30]
mov ebx, dword [ebp - 0x38]
movzx eax, al
lea eax, [edx + eax*4]
movzx edx, byte [eax + 2]
mov dword [ebp - 0x18], edx
movzx edx, byte [eax + 1]
movzx eax, byte [eax]
mov dword [ebp - 0x14], edx
mov dword [ebp - 0x1c], eax
jmp 0x40d213
mov eax, dword [ebp - 4]
push 8
cdq
pop ecx
mov bl, 1
idiv ecx
mov eax, dword [ebp - 4]
push 7
pop ecx
push 8
sub ecx, edx
shl bl, cl
cdq
pop ecx
idiv ecx
and bl, byte [eax + esi]
je 0x40d1f0
mov bl, 1
mov ecx, dword [ebp - 0x30]
movzx eax, bl
mov ebx, dword [ebp - 0x38]
lea eax, [ecx + eax*4]
movzx ecx, byte [eax + 2]
mov dword [ebp - 0x18], ecx
movzx ecx, byte [eax + 1]
movzx eax, byte [eax]
mov dword [ebp - 0x14], ecx
mov ecx, dword [ebp - 0xc]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x18]
mov edx, dword [ebp - 4]
mov dword [edi], eax
mov eax, dword [ebp - 0x14]
add edi, 4
add ecx, 3
mov dword [ebp - 0xc], ecx
mov dword [edi], eax
mov eax, dword [ebp - 0x1c]
add edi, 4
mov dword [edi], eax
add edi, 4
inc edx
cmp edx, dword [ebp - 0x10]
mov dword [ebp - 4], edx
jl 0x40d133
cmp dword [ebx + 0x10], 3
jne 0x40d24f
mov eax, dword [ebx]
lea edx, [eax + ebx + 0xc]
jmp 0x40d259
mov eax, dword [ebx + 0x20]
mov ecx, dword [ebx]
lea edx, [ecx + eax*4]
add edx, ebx
mov eax, dword [ebp - 0x38]
and dword [ebp - 4], 0
mov edi, dword [ebp - 0x34]
movzx ecx, word [eax + 0xe]
imul ecx, dword [eax + 4]
add ecx, 0x1f
shr ecx, 3
and ecx, 0x1ffffffc
imul ecx, dword [ebp - 0x28]
add ecx, edx
cmp dword [ebp - 0x10], 0
jle 0x40d44f
mov eax, dword [ebp - 0x3c]
mov edx, 0xff
add eax, 8
mov esi, dword [edi]
mov ebx, dword [edi + 4]
add edi, 4
mov dword [ebp - 0x2c], ebx
add edi, 4
mov dword [ebp - 0x20], esi
mov ebx, dword [edi]
add edi, 4
mov dword [ebp - 8], ebx
xor ebx, ebx
cmp esi, ebx
mov dword [ebp - 0x58], edi
jge 0x40d2b7
mov dword [ebp - 0x20], ebx
cmp dword [ebp - 0x20], edx
jle 0x40d2bf
mov dword [ebp - 0x20], edx
cmp dword [ebp - 0x2c], ebx
jge 0x40d2c7
mov dword [ebp - 0x2c], ebx
cmp dword [ebp - 0x2c], edx
jle 0x40d2cf
mov dword [ebp - 0x2c], edx
cmp dword [ebp - 8], ebx
jge 0x40d2d7
mov dword [ebp - 8], ebx
cmp dword [ebp - 8], edx
jle 0x40d2df
mov dword [ebp - 8], edx
mov edx, dword [ebp - 8]
mov esi, dword [ebp - 0x2c]
sar edx, 3
and edx, 0x18
and esi, 0xe0
or edx, esi
mov esi, dword [ebp - 0x20]
sar edx, 2
and esi, 0xc0
or edx, esi
mov esi, dword [ebp - 4]
mov dword [ebp - 0xc], esi
mov esi, dword [ebp + 0xc]
cmp dword [ebp - 4], esi
jge 0x40d35b
mov esi, dword [ebp - 0x28]
cmp esi, dword [ebp + 0x10]
mov dword [ebp - 0x48], esi
jge 0x40d34d
mov esi, dword [ebp - 0x40]
mov dword [ebp - 0x4c], esi
mov esi, dword [ebp - 0x24]
imul esi, dword [ebp + 0xc]
mov dword [ebp - 0x5c], esi
mov esi, dword [ebp - 0x4c]
sub esi, dword [ebp - 0x40]
sub esi, dword [ebp - 4]
add esi, dword [ebp - 0xc]
mov byte [esi + ecx], dl
mov esi, dword [ebp - 0x24]
add dword [ebp - 0x48], esi
mov esi, dword [ebp - 0x5c]
add dword [ebp - 0x4c], esi
mov esi, dword [ebp + 0x10]
cmp dword [ebp - 0x48], esi
jl 0x40d32a
mov esi, dword [ebp - 0xc]
add esi, dword [ebp - 0x10]
cmp esi, dword [ebp + 0xc]
mov dword [ebp - 0xc], esi
jl 0x40d30f
movzx esi, byte [ebp + edx - 0x15c]
mov ebx, 0x100
sub ebx, esi
movzx esi, byte [ebp + edx - 0x25c]
add dword [ebp - 0x20], ebx
mov ebx, 0x100
sub ebx, esi
mov esi, dword [ebp - 0x2c]
add esi, ebx
movzx ebx, byte [ebp + edx - 0x35c]
mov edx, 0x100
sub edx, ebx
mov ebx, dword [ebp - 8]
add ebx, edx
mov edx, dword [ebp - 0x10]
dec edx
cmp dword [ebp - 4], edx
je 0x40d3be
mov edx, dword [ebp - 0x20]
mov edx, dword [edx*4 + 0x453d78]
add dword [edi], edx
mov edx, dword [esi*4 + 0x453d78]
add dword [edi + 4], edx
mov edx, dword [ebx*4 + 0x453d78]
add dword [edi + 8], edx
mov edx, dword [ebp - 0x24]
dec edx
cmp dword [ebp - 0x28], edx
je 0x40d43a
mov edx, dword [ebp - 0x20]
shl edx, 2
shl esi, 2
mov edi, dword [edx + 0x454578]
add dword [eax - 8], edi
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 0x40d410
mov ebx, dword [edx + 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 - 0x10]
dec ebx
cmp dword [ebp - 4], ebx
je 0x40d434
mov edx, dword [edx + 0x455578]
add dword [eax + 4], edx
mov edx, dword [esi + 0x455578]
add dword [eax + 8], edx
mov edx, dword [edi + 0x455578]
add dword [eax + 0xc], edx
mov edi, dword [ebp - 0x58]
add eax, 0xc
inc dword [ebp - 4]
inc ecx
mov esi, dword [ebp - 4]
mov edx, 0xff
cmp esi, dword [ebp - 0x10]
jl 0x40d292
mov eax, dword [ebp + 0xc]
inc dword [ebp - 0x28]
add dword [ebp - 0x40], eax
mov eax, dword [ebp - 0x28]
cmp eax, dword [ebp - 0x24]
jl 0x40d0cc
push dword [ebp + 8]
mov esi, dword [sym.imp.KERNEL32.dll_GlobalUnlock]
call esi
push dword [ebp - 0x54]
call esi
push dword [ebp - 0x34]
call fcn.0042deb8
push dword [ebp - 0x3c]
call fcn.0042deb8
mov eax, dword [ebp - 0x54]
pop ecx
pop ecx
jmp 0x40ce5e