Function at 0x40ec36
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
lea ebp, [esp - 0x2b0]
sub esp, 0x330
mov eax, dword [0x4a4b60]
xor eax, ebp
mov dword [ebp + 0x2ac], eax
push esi
push 8
push dword [ebp + 0x2c4]
push dword [ebp + 0x2c0]
call fcn.00407058
mov esi, eax
add esp, 0xc
mov dword [ebp - 0x78], esi
test esi, esi
je 0x40f319
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov ebx, eax
mov dword [ebp - 0x80], ebx
test ebx, ebx
jne 0x40ec94
push esi
call fcn.004067e1
pop ecx
xor eax, eax
jmp 0x40f318
mov esi, dword [ebp + 0x2c0]
imul esi, esi, 3
xor ecx, ecx
push edi
mov eax, ecx
and eax, 0xc0
imul eax, eax, 0xff
add eax, 0x60
cdq
mov edi, 0xc0
idiv edi
add edi, 0x20
mov byte [ebp + ecx - 0x54], al
mov eax, ecx
and eax, 0x38
imul eax, eax, 0x3fc
add eax, 0x70
cdq
idiv edi
mov edi, 0xc0
mov byte [ebp + ecx + 0xac], al
mov eax, ecx
and eax, 6
imul eax, eax, 0x1fe0
add eax, 0x60
cdq
idiv edi
inc ecx
add edi, 0x40
cmp ecx, edi
mov byte [ebp + ecx + 0x1ab], al
jl 0x40eca0
mov eax, dword [ebx]
add eax, ebx
xor ecx, ecx
inc eax
mov dl, byte [ebp + ecx - 0x54]
mov byte [eax + 1], dl
mov dl, byte [ebp + ecx + 0xac]
mov byte [eax], dl
mov dl, byte [ebp + ecx + 0x1ac]
mov byte [eax - 1], dl
inc ecx
add eax, 4
cmp ecx, edi
jl 0x40ed03
call fcn.0040ae8e
shl esi, 2
push esi
mov dword [ebp - 0x7c], esi
call fcn.00462114
push esi
mov dword [ebp - 0x70], eax
call fcn.00462114
push esi
mov dword [ebp - 0x6c], eax
call fcn.00462114
mov dword [ebp - 0x74], eax
xor eax, eax
add esp, 0xc
cmp dword [ebp - 0x70], eax
je 0x40f315
cmp dword [ebp - 0x6c], eax
je 0x40f315
cmp dword [ebp + 0x2c8], eax
jne 0x40f050
push dword [ebp + 0x2c4]
cmp dword [ebp + 0x2cc], eax
je 0x40ed8a
push dword [ebp + 0x2bc]
push dword [ebp + 0x2b8]
jmp 0x40ed96
push dword [ebp + 0x2b8]
push dword [ebp + 0x2bc]
push eax
call fcn.00401b05
mov edi, dword [ebp + 0x2c0]
mov edx, eax
movzx ecx, al
shr eax, 0x10
shr edx, 8
add esp, 0x10
movzx esi, al
mov eax, dword [ebp - 0x6c]
movzx edx, dl
test edi, edi
jle 0x40edcf
mov dword [eax], ecx
add eax, 4
mov dword [eax], edx
add eax, 4
mov dword [eax], esi
add eax, 4
dec edi
jne 0x40edbd
and dword [ebp - 0x64], 0
cmp dword [ebp + 0x2c4], 0
jle 0x40f2ec
mov eax, dword [ebp - 0x6c]
mov esi, dword [ebp - 0x70]
mov ecx, dword [ebp - 0x64]
mov dword [ebp - 0x70], eax
mov eax, dword [ebp + 0x2c4]
lea edx, [eax - 1]
mov dword [ebp - 0x6c], esi
cmp ecx, edx
je 0x40ee78
cmp dword [ebp + 0x2cc], 0
je 0x40ee34
cdq
sub eax, edx
sar eax, 1
cmp ecx, eax
jg 0x40ee20
add eax, 2
push eax
push dword [ebp + 0x2bc]
push dword [ebp + 0x2b8]
jmp 0x40ee41
lea edx, [eax + 2]
push edx
push dword [ebp + 0x2b8]
sub ecx, eax
push dword [ebp + 0x2bc]
jmp 0x40ee42
push eax
push dword [ebp + 0x2b8]
push dword [ebp + 0x2bc]
inc ecx
push ecx
call fcn.00401b05
mov edi, dword [ebp + 0x2c0]
mov edx, eax
movzx ecx, al
shr edx, 8
shr eax, 0x10
add esp, 0x10
movzx edx, dl
movzx eax, al
test edi, edi
jle 0x40ee78
mov dword [esi], ecx
add esi, 4
mov dword [esi], edx
add esi, 4
mov dword [esi], eax
add esi, 4
dec edi
jne 0x40ee66
cmp dword [ebx + 0x10], 3
jne 0x40ee86
mov eax, dword [ebx]
lea eax, [eax + ebx + 0xc]
jmp 0x40ee90
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]
and dword [ebp - 0x68], 0
mov edi, dword [ebp - 0x70]
add edx, 0x1f
shr edx, 3
and edx, 0x1ffffffc
imul edx, dword [ebp - 0x64]
add edx, eax
cmp dword [ebp + 0x2c0], 0
jle 0x40f039
mov eax, dword [ebp - 0x6c]
add eax, 8
mov esi, dword [edi]
add edi, 4
mov ebx, dword [edi]
add edi, 4
mov dword [ebp - 0x58], ebx
mov ebx, dword [edi]
mov dword [ebp - 0x60], ebx
xor ebx, ebx
add edi, 4
cmp esi, ebx
mov ecx, 0xff
mov dword [ebp - 0x5c], esi
jge 0x40eeea
mov dword [ebp - 0x5c], ebx
cmp dword [ebp - 0x5c], ecx
jle 0x40eef2
mov dword [ebp - 0x5c], ecx
cmp dword [ebp - 0x58], ebx
jge 0x40eefa
mov dword [ebp - 0x58], ebx
cmp dword [ebp - 0x58], ecx
jle 0x40ef02
mov dword [ebp - 0x58], ecx
cmp dword [ebp - 0x60], ebx
jge 0x40ef0a
mov dword [ebp - 0x60], ebx
cmp dword [ebp - 0x60], ecx
jle 0x40ef12
mov dword [ebp - 0x60], ecx
mov ecx, dword [ebp - 0x60]
mov esi, dword [ebp - 0x58]
sar ecx, 3
and esi, 0xe0
and ecx, 0x18
or ecx, esi
mov esi, dword [ebp - 0x5c]
and esi, 0xc0
sar ecx, 2
or ecx, esi
movzx esi, byte [ebp + ecx - 0x54]
mov ebx, 0x100
sub ebx, esi
add dword [ebp - 0x5c], ebx
movzx esi, byte [ebp + ecx + 0xac]
mov ebx, 0x100
sub ebx, esi
mov esi, dword [ebp - 0x58]
mov byte [edx], cl
movzx ecx, byte [ebp + ecx + 0x1ac]
add esi, ebx
mov ebx, 0x100
sub ebx, ecx
add dword [ebp - 0x60], ebx
mov ecx, dword [ebp + 0x2c0]
dec ecx
cmp dword [ebp - 0x68], ecx
je 0x40ef9a
mov ecx, dword [ebp - 0x5c]
mov ecx, dword [ecx*4 + 0x4a69f0]
add dword [edi], ecx
mov ecx, dword [esi*4 + 0x4a69f0]
add dword [edi + 4], ecx
mov ecx, dword [ebp - 0x60]
mov ecx, dword [ecx*4 + 0x4a69f0]
add dword [edi + 8], ecx
mov ecx, dword [ebp + 0x2c4]
dec ecx
cmp dword [ebp - 0x64], ecx
je 0x40f023
mov ecx, dword [ebp - 0x5c]
shl ecx, 2
mov ebx, dword [ecx + 0x4a71f0]
add dword [eax - 8], ebx
shl esi, 2
mov ebx, dword [esi + 0x4a71f0]
add dword [eax - 4], ebx
mov ebx, dword [ebp - 0x60]
shl ebx, 2
mov dword [ebp - 0x58], ebx
mov ebx, dword [ebx + 0x4a71f0]
add dword [eax], ebx
cmp dword [ebp - 0x68], 0
jle 0x40eff6
mov ebx, dword [ecx + 0x4a79f0]
add dword [eax - 0x14], ebx
mov ebx, dword [esi + 0x4a79f0]
add dword [eax - 0x10], ebx
mov ebx, dword [ebp - 0x58]
mov ebx, dword [ebx + 0x4a79f0]
add dword [eax - 0xc], ebx
mov ebx, dword [ebp + 0x2c0]
dec ebx
cmp dword [ebp - 0x68], ebx
je 0x40f020
mov ecx, dword [ecx + 0x4a81f0]
add dword [eax + 4], ecx
mov ecx, dword [esi + 0x4a81f0]
add dword [eax + 8], ecx
mov ecx, dword [ebp - 0x58]
mov ecx, dword [ecx + 0x4a81f0]
add dword [eax + 0xc], ecx
add eax, 0xc
inc dword [ebp - 0x68]
mov ecx, dword [ebp - 0x68]
inc edx
cmp ecx, dword [ebp + 0x2c0]
jl 0x40eec4
mov ebx, dword [ebp - 0x80]
inc dword [ebp - 0x64]
mov eax, dword [ebp - 0x64]
cmp eax, dword [ebp + 0x2c4]
jl 0x40ede0
jmp 0x40f2ec
mov esi, dword [ebp - 0x74]
xor edi, edi
cmp dword [ebp + 0x2c0], edi
jle 0x40f0d6
cmp dword [ebp + 0x2cc], 0
je 0x40f092
mov eax, dword [ebp + 0x2c0]
cdq
sub eax, edx
sar eax, 1
cmp edi, eax
jg 0x40f07b
add eax, 2
push eax
jmp 0x40f098
lea ecx, [eax + 2]
push ecx
push dword [ebp + 0x2b8]
mov ecx, edi
push dword [ebp + 0x2bc]
sub ecx, eax
push ecx
jmp 0x40f0a5
push dword [ebp + 0x2c0]
push dword [ebp + 0x2bc]
push dword [ebp + 0x2b8]
push edi
call fcn.00401b05
movzx ecx, al
mov dword [esi], ecx
mov ecx, eax
shr ecx, 8
add esi, 4
shr eax, 0x10
movzx ecx, cl
mov dword [esi], ecx
add esi, 4
movzx eax, al
add esp, 0x10
mov dword [esi], eax
add esi, 4
inc edi
cmp edi, dword [ebp + 0x2c0]
jl 0x40f05d
push dword [ebp - 0x7c]
push dword [ebp - 0x74]
push dword [ebp - 0x6c]
call fcn.00461d60
and dword [ebp - 0x64], 0
add esp, 0xc
cmp dword [ebp + 0x2c4], 0
jle 0x40f2ec
mov eax, dword [ebp + 0x2c4]
mov edi, dword [ebp - 0x70]
mov esi, dword [ebp - 0x6c]
dec eax
mov dword [ebp - 0x70], esi
mov dword [ebp - 0x6c], edi
cmp dword [ebp - 0x64], eax
je 0x40f11f
push dword [ebp - 0x7c]
push dword [ebp - 0x74]
push edi
call fcn.00461d60
add esp, 0xc
cmp dword [ebx + 0x10], 3
jne 0x40f12d
mov eax, dword [ebx]
lea eax, [eax + ebx + 0xc]
jmp 0x40f137
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]
and dword [ebp - 0x68], 0
add edx, 0x1f
shr edx, 3
and edx, 0x1ffffffc
imul edx, dword [ebp - 0x64]
add edx, eax
cmp dword [ebp + 0x2c0], 0
jle 0x40f2da
lea eax, [edi + 8]
mov edi, dword [esi]
add esi, 4
mov ecx, dword [esi]
add esi, 4
mov dword [ebp - 0x58], ecx
mov ecx, dword [esi]
add esi, 4
mov dword [ebp - 0x5c], edi
mov dword [ebp - 0x60], ecx
test edi, edi
jge 0x40f185
and dword [ebp - 0x5c], 0
mov edi, 0xff
cmp dword [ebp - 0x5c], edi
jle 0x40f192
mov dword [ebp - 0x5c], edi
cmp dword [ebp - 0x58], 0
jge 0x40f19c
and dword [ebp - 0x58], 0
cmp dword [ebp - 0x58], edi
jle 0x40f1a4
mov dword [ebp - 0x58], edi
test ecx, ecx
jge 0x40f1ad
xor ecx, ecx
mov dword [ebp - 0x60], ecx
cmp ecx, edi
jle 0x40f1b6
mov ecx, edi
mov dword [ebp - 0x60], ecx
mov edi, dword [ebp - 0x58]
sar ecx, 3
and edi, 0xe0
and ecx, 0x18
or ecx, edi
mov edi, dword [ebp - 0x5c]
and edi, 0xc0
sar ecx, 2
or ecx, edi
movzx edi, byte [ebp + ecx - 0x54]
mov ebx, 0x100
sub ebx, edi
add dword [ebp - 0x5c], ebx
movzx edi, byte [ebp + ecx + 0xac]
mov ebx, 0x100
sub ebx, edi
mov edi, dword [ebp - 0x58]
mov byte [edx], cl
movzx ecx, byte [ebp + ecx + 0x1ac]
add edi, ebx
mov ebx, 0x100
sub ebx, ecx
add dword [ebp - 0x60], ebx
mov ecx, dword [ebp + 0x2c0]
dec ecx
cmp dword [ebp - 0x68], ecx
je 0x40f23b
mov ecx, dword [ebp - 0x5c]
mov ecx, dword [ecx*4 + 0x4a69f0]
add dword [esi], ecx
mov ecx, dword [edi*4 + 0x4a69f0]
add dword [esi + 4], ecx
mov ecx, dword [ebp - 0x60]
mov ecx, dword [ecx*4 + 0x4a69f0]
add dword [esi + 8], ecx
mov ecx, dword [ebp + 0x2c4]
dec ecx
cmp dword [ebp - 0x64], ecx
je 0x40f2c4
mov ecx, dword [ebp - 0x5c]
shl ecx, 2
mov ebx, dword [ecx + 0x4a71f0]
add dword [eax - 8], ebx
shl edi, 2
mov ebx, dword [edi + 0x4a71f0]
add dword [eax - 4], ebx
mov ebx, dword [ebp - 0x60]
shl ebx, 2
mov dword [ebp - 0x58], ebx
mov ebx, dword [ebx + 0x4a71f0]
add dword [eax], ebx
cmp dword [ebp - 0x68], 0
jle 0x40f297
mov ebx, dword [ecx + 0x4a79f0]
add dword [eax - 0x14], ebx
mov ebx, dword [edi + 0x4a79f0]
add dword [eax - 0x10], ebx
mov ebx, dword [ebp - 0x58]
mov ebx, dword [ebx + 0x4a79f0]
add dword [eax - 0xc], ebx
mov ebx, dword [ebp + 0x2c0]
dec ebx
cmp dword [ebp - 0x68], ebx
je 0x40f2c1
mov ecx, dword [ecx + 0x4a81f0]
add dword [eax + 4], ecx
mov ecx, dword [edi + 0x4a81f0]
add dword [eax + 8], ecx
mov ecx, dword [ebp - 0x58]
mov ecx, dword [ecx + 0x4a81f0]
add dword [eax + 0xc], ecx
add eax, 0xc
inc dword [ebp - 0x68]
mov ecx, dword [ebp - 0x68]
inc edx
cmp ecx, dword [ebp + 0x2c0]
jl 0x40f165
mov ebx, dword [ebp - 0x80]
inc dword [ebp - 0x64]
mov eax, dword [ebp - 0x64]
cmp eax, dword [ebp + 0x2c4]
jl 0x40f0f8
push dword [ebp - 0x70]
call fcn.00461ccb
push dword [ebp - 0x6c]
call fcn.00461ccb
push dword [ebp - 0x74]
call fcn.00461ccb
add esp, 0xc
push dword [ebp - 0x78]
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov eax, dword [ebp - 0x78]
jmp 0x40f317
xor eax, eax
pop edi
pop ebx
mov ecx, dword [ebp + 0x2ac]
xor ecx, ebp
pop esi
call fcn.00461b8a
add ebp, 0x2b0
leave
ret