Function at 0x40e552
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
lea ebp, [esp - 0x2e8]
sub esp, 0x368
mov eax, dword [0x4a4b60]
xor eax, ebp
mov dword [ebp + 0x2e4], eax
push ebx
mov ebx, dword [ebp + 0x2f0]
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GlobalLock]
push ebx
mov dword [ebp - 0x7c], ebx
call edi
mov dword [ebp - 0x68], eax
test eax, eax
jne 0x40e58c
xor eax, eax
jmp 0x40e5f4
movzx ecx, word [eax + 0xe]
mov dword [ebp - 0x6c], ecx
cmp ecx, 1
je 0x40e5a7
cmp ecx, 4
je 0x40e5a7
cmp ecx, 8
je 0x40e5a7
cmp ecx, 0x18
jne 0x40e588
push esi
mov esi, dword [eax + 4]
mov eax, dword [eax + 8]
mov dword [ebp - 0x2c], esi
mov dword [ebp - 0x48], eax
cmp esi, dword [ebp + 0x2f4]
jbe 0x40e5c5
mov esi, dword [ebp + 0x2f4]
mov dword [ebp - 0x2c], esi
mov ecx, dword [ebp + 0x2f8]
cmp eax, ecx
jbe 0x40e5d2
mov dword [ebp - 0x48], ecx
push 8
push ecx
push dword [ebp + 0x2f4]
call fcn.00407058
add esp, 0xc
mov dword [ebp - 0x70], eax
test eax, eax
jne 0x40e60b
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
xor eax, eax
pop esi
mov ecx, dword [ebp + 0x2e4]
pop edi
xor ecx, ebp
pop ebx
call fcn.00461b8a
add ebp, 0x2e8
leave
ret
push eax
call edi
mov edi, eax
mov dword [ebp - 0x74], edi
test edi, edi
je 0x40e5ea
imul esi, esi, 3
xor ecx, ecx
mov eax, ecx
and eax, 0xc0
imul eax, eax, 0xff
add eax, 0x60
cdq
mov ebx, 0xc0
idiv ebx
add ebx, 0x20
mov byte [ebp + ecx + 0xe4], al
mov eax, ecx
and eax, 0x38
imul eax, eax, 0x3fc
add eax, 0x70
cdq
idiv ebx
mov ebx, 0xc0
mov byte [ebp + ecx + 0x1e4], al
mov eax, ecx
and eax, 6
imul eax, eax, 0x1fe0
add eax, 0x60
cdq
idiv ebx
inc ecx
lea edx, [ebx + 0x40]
cmp ecx, edx
mov byte [ebp + ecx - 0x1d], al
jl 0x40e61c
mov eax, dword [edi]
add eax, edi
xor ecx, ecx
inc eax
mov bl, byte [ebp + ecx + 0xe4]
mov byte [eax + 1], bl
mov bl, byte [ebp + ecx + 0x1e4]
mov byte [eax], bl
mov bl, byte [ebp + ecx - 0x1c]
mov byte [eax - 1], bl
inc ecx
add eax, 4
cmp ecx, edx
jl 0x40e67f
mov ecx, dword [ebp - 0x68]
mov eax, dword [ecx]
add eax, ecx
mov dword [ebp - 0x50], eax
call fcn.0040ae8e
shl esi, 2
push esi
call fcn.00462114
push esi
mov dword [ebp - 0x58], eax
call fcn.00462114
cmp dword [ebp - 0x58], 0
pop ecx
pop ecx
mov dword [ebp - 0x54], eax
je 0x40e5f1
test eax, eax
je 0x40e5f1
movzx esi, word [edi + 0xe]
imul esi, dword [edi + 4]
and dword [ebp - 0x28], 0
add esi, 0x1f
shr esi, 3
mov ebx, 0x1ffffffc
and esi, ebx
cmp dword [ebp + 0x2f8], 0
jle 0x40e743
cmp dword [edi + 0x10], 3
jne 0x40e709
mov eax, dword [edi]
lea eax, [eax + edi + 0xc]
jmp 0x40e713
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
shr ecx, 3
and ecx, ebx
imul ecx, dword [ebp - 0x28]
push esi
add ecx, eax
push 0
push ecx
call fcn.00461b10
add esp, 0xc
inc dword [ebp - 0x28]
mov eax, dword [ebp - 0x28]
cmp eax, dword [ebp + 0x2f8]
jl 0x40e6fb
mov eax, dword [ebp - 0x68]
cmp dword [eax + 0x10], 3
jne 0x40e754
mov ecx, dword [eax]
lea ecx, [ecx + eax + 0xc]
jmp 0x40e75e
mov ecx, dword [eax + 0x20]
mov edx, dword [eax]
lea ecx, [edx + ecx*4]
add ecx, eax
mov esi, dword [ebp - 0x54]
xor edx, edx
cmp dword [ebp - 0x2c], edx
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x20], edx
jle 0x40e86d
lea ebx, [ecx + 1]
mov dword [ebp - 0x3c], ebx
mov eax, dword [ebp - 0x6c]
dec eax
je 0x40e7ee
sub eax, 3
je 0x40e7c1
sub eax, 4
je 0x40e7a7
sub eax, 0x10
jne 0x40e83f
movzx eax, byte [ebx + 1]
mov dword [ebp - 0x34], eax
movzx eax, byte [ebx]
mov dword [ebp - 0x38], eax
movzx eax, byte [ebx - 1]
jmp 0x40e83c
movzx eax, byte [edx + ecx]
mov edx, dword [ebp - 0x50]
lea eax, [edx + eax*4]
movzx edx, byte [eax + 2]
mov dword [ebp - 0x34], edx
movzx edx, byte [eax + 1]
mov dword [ebp - 0x38], edx
jmp 0x40e839
and edx, 0x80000001
jns 0x40e7ce
dec edx
or edx, 0xfffffffe
inc edx
mov eax, dword [ebp - 0x20]
cdq
jne 0x40e7e0
sub eax, edx
sar eax, 1
mov al, byte [eax + ecx]
shr al, 4
jmp 0x40e7e9
sub eax, edx
sar eax, 1
mov al, byte [eax + ecx]
and al, 0xf
movzx eax, al
jmp 0x40e7ab
mov eax, dword [ebp - 0x20]
mov edx, eax
and edx, reloc.OLEAUT32.dll_VariantInit
jns 0x40e800
dec edx
or edx, 0xfffffff8
inc edx
push 7
pop ecx
sub ecx, edx
cdq
mov bl, 1
and edx, 7
shl bl, cl
mov ecx, dword [ebp - 0x28]
add eax, edx
sar eax, 3
and bl, byte [eax + ecx]
je 0x40e81c
mov bl, 1
mov ecx, dword [ebp - 0x50]
movzx eax, bl
mov ebx, dword [ebp - 0x3c]
lea eax, [ecx + eax*4]
movzx ecx, byte [eax + 2]
mov dword [ebp - 0x34], ecx
movzx ecx, byte [eax + 1]
mov dword [ebp - 0x38], ecx
mov ecx, dword [ebp - 0x28]
movzx eax, byte [eax]
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x34]
mov edx, dword [ebp - 0x20]
mov dword [esi], eax
mov eax, dword [ebp - 0x38]
add esi, 4
mov dword [esi], eax
mov eax, dword [ebp - 0x30]
add esi, 4
mov dword [esi], eax
add esi, 4
inc edx
add ebx, 3
cmp edx, dword [ebp - 0x2c]
mov dword [ebp - 0x20], edx
mov dword [ebp - 0x3c], ebx
jl 0x40e778
and dword [ebp - 0x44], 0
cmp dword [ebp - 0x48], 0
jle 0x40ec0c
mov eax, dword [ebp - 0x54]
mov ebx, dword [ebp - 0x58]
mov edx, dword [ebp - 0x44]
mov dword [ebp - 0x58], eax
mov eax, dword [ebp - 0x48]
dec eax
mov dword [ebp - 0x54], ebx
cmp edx, eax
je 0x40e9e2
mov eax, dword [ebp - 0x68]
cmp dword [eax + 0x10], 3
jne 0x40e8a7
mov ecx, dword [eax]
lea ecx, [ecx + eax + 0xc]
jmp 0x40e8b1
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]
and dword [ebp - 0x20], 0
add esi, 0x1f
shr esi, 3
and esi, 0x1ffffffc
inc edx
imul esi, edx
add esi, ecx
cmp dword [ebp - 0x2c], 0
jle 0x40e9e2
lea ecx, [esi + 1]
mov dword [ebp - 0x3c], ecx
mov eax, dword [ebp - 0x6c]
dec eax
je 0x40e95d
sub eax, 3
je 0x40e92e
sub eax, 4
je 0x40e90e
sub eax, 0x10
jne 0x40e9b5
movzx eax, byte [ecx + 1]
mov dword [ebp - 0x34], eax
movzx eax, byte [ecx]
mov dword [ebp - 0x38], eax
movzx eax, byte [ecx - 1]
jmp 0x40e9b2
mov eax, dword [ebp - 0x20]
movzx eax, byte [eax + esi]
mov edx, dword [ebp - 0x50]
lea eax, [edx + eax*4]
movzx edx, byte [eax + 2]
mov dword [ebp - 0x34], edx
movzx edx, byte [eax + 1]
mov dword [ebp - 0x38], edx
jmp 0x40e9af
mov eax, dword [ebp - 0x20]
and eax, 0x80000001
jns 0x40e93d
dec eax
or eax, 0xfffffffe
inc eax
mov eax, dword [ebp - 0x20]
cdq
jne 0x40e94f
sub eax, edx
sar eax, 1
mov al, byte [eax + esi]
shr al, 4
jmp 0x40e958
sub eax, edx
sar eax, 1
mov al, byte [eax + esi]
and al, 0xf
movzx eax, al
jmp 0x40e915
mov eax, dword [ebp - 0x20]
mov edx, eax
and edx, reloc.OLEAUT32.dll_VariantInit
jns 0x40e96f
dec edx
or edx, 0xfffffff8
inc edx
push 7
pop ecx
sub ecx, edx
cdq
and edx, 7
add eax, edx
mov byte [ebp - 0x21], 1
shl byte [ebp - 0x21], cl
mov ecx, eax
mov al, byte [ebp - 0x21]
sar ecx, 3
and al, byte [ecx + esi]
je 0x40e995
mov byte [ebp - 0x21], 1
mov al, byte [ebp - 0x21]
mov ecx, dword [ebp - 0x50]
movzx eax, al
lea eax, [ecx + eax*4]
movzx ecx, byte [eax + 2]
mov dword [ebp - 0x34], ecx
movzx ecx, byte [eax + 1]
mov dword [ebp - 0x38], ecx
mov ecx, dword [ebp - 0x3c]
movzx eax, byte [eax]
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x34]
mov dword [ebx], eax
mov eax, dword [ebp - 0x38]
add ebx, 4
mov dword [ebx], eax
mov eax, dword [ebp - 0x30]
add ebx, 4
mov dword [ebx], eax
add ebx, 4
inc dword [ebp - 0x20]
mov eax, dword [ebp - 0x20]
add ecx, 3
cmp eax, dword [ebp - 0x2c]
mov dword [ebp - 0x3c], ecx
jl 0x40e8df
cmp dword [edi + 0x10], 3
jne 0x40e9f0
mov eax, dword [edi]
lea eax, [eax + edi + 0xc]
jmp 0x40e9fa
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]
and dword [ebp - 0x20], 0
mov esi, dword [ebp - 0x58]
add ecx, 0x1f
shr ecx, 3
and ecx, 0x1ffffffc
imul ecx, dword [ebp - 0x44]
add ecx, eax
cmp dword [ebp - 0x2c], 0
jle 0x40ebfd
mov eax, dword [ebp - 0x54]
add eax, 8
mov edi, dword [esi]
add esi, 4
mov ebx, dword [esi]
add esi, 4
mov dword [ebp - 0x4c], ebx
mov ebx, dword [esi]
mov dword [ebp - 0x28], ebx
add esi, 4
xor ebx, ebx
cmp edi, ebx
mov edx, 0xff
mov dword [ebp - 0x40], edi
mov dword [ebp - 0x78], esi
jge 0x40ea54
mov dword [ebp - 0x40], ebx
cmp dword [ebp - 0x40], edx
jle 0x40ea5c
mov dword [ebp - 0x40], edx
cmp dword [ebp - 0x4c], ebx
jge 0x40ea64
mov dword [ebp - 0x4c], ebx
cmp dword [ebp - 0x4c], edx
jle 0x40ea6c
mov dword [ebp - 0x4c], edx
cmp dword [ebp - 0x28], ebx
jge 0x40ea74
mov dword [ebp - 0x28], ebx
cmp dword [ebp - 0x28], edx
jle 0x40ea7c
mov dword [ebp - 0x28], edx
mov edx, dword [ebp - 0x28]
mov edi, dword [ebp - 0x4c]
sar edx, 3
and edi, 0xe0
and edx, 0x18
or edx, edi
mov edi, dword [ebp - 0x40]
and edi, 0xc0
sar edx, 2
or edx, edi
mov edi, dword [ebp - 0x20]
cmp edi, dword [ebp + 0x2f4]
mov dword [ebp - 0x3c], edi
jge 0x40eb0a
mov edi, ecx
sub edi, dword [ebp - 0x20]
mov dword [ebp - 0x80], edi
mov edi, dword [ebp - 0x44]
cmp edi, dword [ebp + 0x2f8]
mov dword [ebp - 0x60], edi
jge 0x40eaf9
mov edi, dword [ebp - 0x48]
imul edi, dword [ebp + 0x2f4]
mov ebx, dword [ebp - 0x3c]
mov dword [ebp - 0x5c], edi
mov edi, dword [ebp - 0x80]
add edi, ebx
mov dword [ebp - 0x64], edi
mov edi, dword [ebp - 0x60]
add edi, dword [ebp - 0x48]
mov ebx, dword [ebp - 0x64]
mov dword [ebp - 0x60], edi
mov edi, dword [ebp - 0x5c]
add dword [ebp - 0x64], edi
mov edi, dword [ebp - 0x60]
cmp edi, dword [ebp + 0x2f8]
mov byte [ebx], dl
jl 0x40eadd
mov edi, dword [ebp - 0x3c]
add edi, dword [ebp - 0x2c]
cmp edi, dword [ebp + 0x2f4]
mov dword [ebp - 0x3c], edi
jl 0x40eab4
movzx edi, byte [ebp + edx + 0xe4]
mov ebx, 0x100
sub ebx, edi
add dword [ebp - 0x40], ebx
movzx edi, byte [ebp + edx + 0x1e4]
movzx edx, byte [ebp + edx - 0x1c]
mov ebx, 0x100
sub ebx, edi
mov edi, dword [ebp - 0x4c]
add edi, ebx
mov ebx, 0x100
sub ebx, edx
mov edx, ebx
mov ebx, dword [ebp - 0x28]
add ebx, edx
mov edx, dword [ebp - 0x2c]
dec edx
cmp dword [ebp - 0x20], edx
je 0x40eb6c
mov edx, dword [ebp - 0x40]
mov edx, dword [edx*4 + 0x4a69f0]
add dword [esi], edx
mov edx, dword [edi*4 + 0x4a69f0]
add dword [esi + 4], edx
mov edx, dword [ebx*4 + 0x4a69f0]
add dword [esi + 8], edx
mov edx, dword [ebp - 0x48]
dec edx
cmp dword [ebp - 0x44], edx
je 0x40ebea
mov edx, dword [ebp - 0x40]
shl edx, 2
mov esi, dword [edx + 0x4a71f0]
add dword [eax - 8], esi
mov esi, edi
shl esi, 2
mov edi, dword [esi + 0x4a71f0]
add dword [eax - 4], edi
mov edi, ebx
shl edi, 2
mov ebx, dword [edi + 0x4a71f0]
add dword [eax], ebx
cmp dword [ebp - 0x20], 0
jle 0x40ebc0
mov ebx, dword [edx + 0x4a79f0]
add dword [eax - 0x14], ebx
mov ebx, dword [esi + 0x4a79f0]
add dword [eax - 0x10], ebx
mov ebx, dword [edi + 0x4a79f0]
add dword [eax - 0xc], ebx
mov ebx, dword [ebp - 0x2c]
dec ebx
cmp dword [ebp - 0x20], ebx
je 0x40ebe4
mov edx, dword [edx + 0x4a81f0]
add dword [eax + 4], edx
mov edx, dword [esi + 0x4a81f0]
add dword [eax + 8], edx
mov edx, dword [edi + 0x4a81f0]
add dword [eax + 0xc], edx
mov esi, dword [ebp - 0x78]
add eax, 0xc
inc dword [ebp - 0x20]
mov edx, dword [ebp - 0x20]
mov edi, dword [ebp - 0x74]
inc ecx
cmp edx, dword [ebp - 0x2c]
jl 0x40ea2b
inc dword [ebp - 0x44]
mov eax, dword [ebp - 0x44]
cmp eax, dword [ebp - 0x48]
jl 0x40e87b
push dword [ebp - 0x7c]
mov esi, dword [sym.imp.KERNEL32.dll_GlobalUnlock]
call esi
push dword [ebp - 0x70]
call esi
push dword [ebp - 0x58]
call fcn.00461ccb
push dword [ebp - 0x54]
call fcn.00461ccb
mov eax, dword [ebp - 0x70]
pop ecx
pop ecx
jmp 0x40e5f3