Function at 0x40de30
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
lea ebp, [esp - 0x2d8]
sub esp, 0x358
mov eax, dword [0x4a4b60]
xor eax, ebp
mov dword [ebp + 0x2d4], eax
mov eax, dword [ebp + 0x2e0]
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_GlobalLock]
push eax
mov dword [ebp - 0x64], eax
call ebx
mov dword [ebp - 0x60], eax
test eax, eax
jne 0x40de69
xor eax, eax
jmp 0x40dee7
movzx ecx, word [eax + 0xe]
mov dword [ebp - 0x78], ecx
cmp ecx, 1
je 0x40de84
cmp ecx, 4
je 0x40de84
cmp ecx, 8
je 0x40de84
cmp ecx, 0x18
jne 0x40de65
push esi
mov esi, dword [eax + 4]
mov eax, dword [eax + 8]
push edi
mov edi, dword [ebp + 0x2e4]
mov dword [ebp - 0x48], esi
mov dword [ebp - 0x58], eax
cmp esi, edi
jbe 0x40dea1
mov esi, edi
mov dword [ebp - 0x48], edi
mov ecx, dword [ebp + 0x2e8]
cmp eax, ecx
jbe 0x40deae
mov dword [ebp - 0x58], ecx
mov eax, edi
sub eax, esi
cdq
sub eax, edx
sar eax, 1
mov dword [ebp - 0x80], eax
mov eax, ecx
sub eax, dword [ebp - 0x58]
push 8
cdq
sub eax, edx
push ecx
sar eax, 1
push edi
mov dword [ebp - 0x68], eax
call fcn.00407058
add esp, 0xc
mov dword [ebp - 0x70], eax
test eax, eax
jne 0x40defd
push dword [ebp - 0x64]
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
xor eax, eax
pop edi
pop esi
mov ecx, dword [ebp + 0x2d4]
xor ecx, ebp
pop ebx
call fcn.00461b8a
add ebp, 0x2d8
leave
ret
push eax
call ebx
mov edi, eax
mov dword [ebp - 0x74], edi
test edi, edi
je 0x40deda
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 + 0xd4], al
mov eax, ecx
and eax, 0x38
imul eax, eax, 0x3fc
add eax, 0x70
cdq
idiv ebx
mov ebx, 0xc0
mov byte [ebp + ecx - 0x2c], 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 + 0x1d3], al
jl 0x40df0e
mov eax, dword [edi]
add eax, edi
xor ecx, ecx
inc eax
mov bl, byte [ebp + ecx + 0xd4]
mov byte [eax + 1], bl
mov bl, byte [ebp + ecx - 0x2c]
mov byte [eax], bl
mov bl, byte [ebp + ecx + 0x1d4]
mov byte [eax - 1], bl
inc ecx
add eax, 4
cmp ecx, edx
jl 0x40df71
mov ecx, dword [ebp - 0x60]
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 - 0x54], eax
call fcn.00462114
cmp dword [ebp - 0x54], 0
pop ecx
pop ecx
mov dword [ebp - 0x5c], eax
je 0x40dee3
test eax, eax
je 0x40dee3
movzx esi, word [edi + 0xe]
imul esi, dword [edi + 4]
and dword [ebp - 0x34], 0
add esi, 0x1f
shr esi, 3
mov ebx, 0x1ffffffc
and esi, ebx
cmp dword [ebp + 0x2e8], 0
jle 0x40e035
cmp dword [edi + 0x10], 3
jne 0x40dffb
mov eax, dword [edi]
lea eax, [eax + edi + 0xc]
jmp 0x40e005
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 - 0x34]
push esi
add ecx, eax
push 0
push ecx
call fcn.00461b10
add esp, 0xc
inc dword [ebp - 0x34]
mov eax, dword [ebp - 0x34]
cmp eax, dword [ebp + 0x2e8]
jl 0x40dfed
mov eax, dword [ebp - 0x60]
cmp dword [eax + 0x10], 3
jne 0x40e046
mov ecx, dword [eax]
lea ecx, [ecx + eax + 0xc]
jmp 0x40e050
mov ecx, dword [eax + 0x20]
mov edx, dword [eax]
lea ecx, [edx + ecx*4]
add ecx, eax
mov esi, dword [ebp - 0x5c]
xor edx, edx
cmp dword [ebp - 0x48], edx
mov dword [ebp - 0x34], ecx
mov dword [ebp - 0x30], edx
jle 0x40e19e
lea ebx, [ecx + 1]
mov dword [ebp - 0x44], ebx
mov eax, dword [ebp - 0x78]
dec eax
je 0x40e0e0
sub eax, 3
je 0x40e0b3
sub eax, 4
je 0x40e099
sub eax, 0x10
jne 0x40e131
movzx eax, byte [ebx + 1]
mov dword [ebp - 0x38], eax
movzx eax, byte [ebx]
mov dword [ebp - 0x40], eax
movzx eax, byte [ebx - 1]
jmp 0x40e12e
movzx eax, byte [edx + ecx]
mov edx, dword [ebp - 0x50]
lea eax, [edx + eax*4]
movzx edx, byte [eax + 2]
mov dword [ebp - 0x38], edx
movzx edx, byte [eax + 1]
mov dword [ebp - 0x40], edx
jmp 0x40e12b
and edx, 0x80000001
jns 0x40e0c0
dec edx
or edx, 0xfffffffe
inc edx
mov eax, dword [ebp - 0x30]
cdq
jne 0x40e0d2
sub eax, edx
sar eax, 1
mov al, byte [eax + ecx]
shr al, 4
jmp 0x40e0db
sub eax, edx
sar eax, 1
mov al, byte [eax + ecx]
and al, 0xf
movzx eax, al
jmp 0x40e09d
mov eax, dword [ebp - 0x30]
mov edx, eax
and edx, reloc.OLEAUT32.dll_VariantInit
jns 0x40e0f2
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 - 0x34]
add eax, edx
sar eax, 3
and bl, byte [eax + ecx]
je 0x40e10e
mov bl, 1
mov ecx, dword [ebp - 0x50]
movzx eax, bl
mov ebx, dword [ebp - 0x44]
lea eax, [ecx + eax*4]
movzx ecx, byte [eax + 2]
mov dword [ebp - 0x38], ecx
movzx ecx, byte [eax + 1]
mov dword [ebp - 0x40], ecx
mov ecx, dword [ebp - 0x34]
movzx eax, byte [eax]
mov dword [ebp - 0x3c], eax
cmp dword [ebp + 0x2ec], 0x64
je 0x40e170
mov eax, dword [ebp - 0x3c]
imul eax, dword [ebp + 0x2ec]
cdq
push 0x64
pop ebx
idiv ebx
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp - 0x40]
imul eax, dword [ebp + 0x2ec]
cdq
idiv ebx
mov dword [ebp - 0x40], eax
mov eax, dword [ebp - 0x38]
imul eax, dword [ebp + 0x2ec]
cdq
idiv ebx
mov ebx, dword [ebp - 0x44]
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x38]
mov edx, dword [ebp - 0x30]
mov dword [esi], eax
mov eax, dword [ebp - 0x40]
add esi, 4
mov dword [esi], eax
mov eax, dword [ebp - 0x3c]
add esi, 4
mov dword [esi], eax
add esi, 4
inc edx
add ebx, 3
cmp edx, dword [ebp - 0x48]
mov dword [ebp - 0x30], edx
mov dword [ebp - 0x44], ebx
jl 0x40e06a
mov eax, dword [ebp - 0x58]
and dword [ebp - 0x44], 0
test eax, eax
jle 0x40e528
xor ebx, ebx
inc ebx
sub ebx, dword [ebp - 0x68]
mov dword [ebp - 0x7c], ebx
jmp 0x40e1bb
mov ebx, dword [ebp - 0x7c]
mov ecx, dword [ebp - 0x54]
mov edx, dword [ebp - 0x5c]
dec eax
mov dword [ebp - 0x4c], ecx
mov dword [ebp - 0x54], edx
mov dword [ebp - 0x5c], ecx
cmp dword [ebp - 0x44], eax
je 0x40e35c
mov eax, dword [ebp - 0x60]
cmp dword [eax + 0x10], 3
jne 0x40e1e5
mov edx, dword [eax]
lea edx, [edx + eax + 0xc]
jmp 0x40e1ef
mov edx, dword [eax + 0x20]
mov esi, dword [eax]
lea edx, [esi + edx*4]
add edx, eax
movzx esi, word [eax + 0xe]
imul esi, dword [eax + 4]
mov eax, dword [ebp - 0x44]
and dword [ebp - 0x30], 0
add esi, 0x1f
shr esi, 3
add ebx, eax
add ebx, dword [ebp - 0x68]
and esi, 0x1ffffffc
imul esi, ebx
add esi, edx
cmp dword [ebp - 0x48], 0
jle 0x40e35c
lea ebx, [esi + 1]
mov dword [ebp - 0x34], ebx
mov eax, dword [ebp - 0x78]
dec eax
je 0x40e29f
sub eax, 3
je 0x40e270
sub eax, 4
je 0x40e253
sub eax, 0x10
jne 0x40e2ed
movzx eax, byte [ebx + 1]
mov dword [ebp - 0x38], eax
movzx eax, byte [ebx]
mov dword [ebp - 0x40], eax
movzx eax, byte [ebx - 1]
jmp 0x40e2ea
mov eax, dword [ebp - 0x30]
movzx eax, byte [eax + esi]
mov edx, dword [ebp - 0x50]
lea eax, [edx + eax*4]
movzx edx, byte [eax + 2]
mov dword [ebp - 0x38], edx
movzx edx, byte [eax + 1]
mov dword [ebp - 0x40], edx
jmp 0x40e2e7
mov eax, dword [ebp - 0x30]
and eax, 0x80000001
jns 0x40e27f
dec eax
or eax, 0xfffffffe
inc eax
mov eax, dword [ebp - 0x30]
cdq
jne 0x40e291
sub eax, edx
sar eax, 1
mov al, byte [eax + esi]
shr al, 4
jmp 0x40e29a
sub eax, edx
sar eax, 1
mov al, byte [eax + esi]
and al, 0xf
movzx eax, al
jmp 0x40e25a
mov eax, dword [ebp - 0x30]
mov edx, eax
and edx, reloc.OLEAUT32.dll_VariantInit
jns 0x40e2b1
dec edx
or edx, 0xfffffff8
inc edx
push 7
pop ecx
sub ecx, edx
cdq
mov bl, 1
and edx, 7
shl bl, cl
add eax, edx
sar eax, 3
and bl, byte [eax + esi]
je 0x40e2ca
mov bl, 1
mov ecx, dword [ebp - 0x50]
movzx eax, bl
mov ebx, dword [ebp - 0x34]
lea eax, [ecx + eax*4]
movzx ecx, byte [eax + 2]
mov dword [ebp - 0x38], ecx
movzx ecx, byte [eax + 1]
mov dword [ebp - 0x40], ecx
mov ecx, dword [ebp - 0x4c]
movzx eax, byte [eax]
mov dword [ebp - 0x3c], eax
cmp dword [ebp + 0x2ec], 0x64
je 0x40e32c
mov eax, dword [ebp - 0x3c]
imul eax, dword [ebp + 0x2ec]
cdq
push 0x64
pop ebx
idiv ebx
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp - 0x40]
imul eax, dword [ebp + 0x2ec]
cdq
idiv ebx
mov dword [ebp - 0x40], eax
mov eax, dword [ebp - 0x38]
imul eax, dword [ebp + 0x2ec]
cdq
idiv ebx
mov ebx, dword [ebp - 0x34]
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x38]
mov dword [ecx], eax
mov eax, dword [ebp - 0x40]
add ecx, 4
mov dword [ecx], eax
mov eax, dword [ebp - 0x3c]
add ecx, 4
mov dword [ecx], eax
add ecx, 4
inc dword [ebp - 0x30]
mov eax, dword [ebp - 0x30]
add ebx, 3
cmp eax, dword [ebp - 0x48]
mov dword [ebp - 0x4c], ecx
mov dword [ebp - 0x34], ebx
jl 0x40e224
cmp dword [edi + 0x10], 3
jne 0x40e36a
mov eax, dword [edi]
lea ecx, [eax + edi + 0xc]
jmp 0x40e374
mov eax, dword [edi + 0x20]
mov ecx, dword [edi]
lea ecx, [ecx + eax*4]
add ecx, edi
movzx eax, word [edi + 0xe]
mov edx, dword [edi + 4]
mov esi, dword [ebp - 0x44]
imul edx, eax
imul eax, dword [ebp - 0x80]
mov ebx, dword [ebp - 0x68]
and dword [ebp - 0x34], 0
add edx, 0x1f
shr edx, 3
and edx, 0x1ffffffc
add esi, ebx
imul edx, esi
add edx, ecx
shr eax, 3
add eax, edx
cmp dword [ebp - 0x48], 0
mov edx, dword [ebp - 0x54]
mov dword [ebp - 0x4c], eax
jle 0x40e519
mov eax, dword [ebp - 0x5c]
add eax, 8
mov ebx, 0xff
mov esi, dword [edx]
add edx, 4
mov ecx, dword [edx]
add edx, 4
mov dword [ebp - 0x30], ecx
mov ecx, dword [edx]
add edx, 4
mov dword [ebp - 0x6c], ecx
test esi, esi
jge 0x40e3da
xor esi, esi
cmp esi, ebx
jle 0x40e3e0
mov esi, ebx
cmp dword [ebp - 0x30], 0
jge 0x40e3ea
and dword [ebp - 0x30], 0
cmp dword [ebp - 0x30], ebx
jle 0x40e3f2
mov dword [ebp - 0x30], ebx
test ecx, ecx
jge 0x40e3fb
xor ecx, ecx
mov dword [ebp - 0x6c], ecx
cmp ecx, ebx
jle 0x40e404
mov ecx, ebx
mov dword [ebp - 0x6c], ecx
mov edi, dword [ebp - 0x30]
sar ecx, 3
and edi, 0xe0
and ecx, 0x18
or ecx, edi
sar ecx, 2
mov edi, esi
and edi, 0xc0
or ecx, edi
mov edi, dword [ebp - 0x4c]
mov byte [edi], cl
movzx edi, byte [ebp + ecx + 0xd4]
mov ebx, 0x100
sub ebx, edi
movzx edi, byte [ebp + ecx - 0x2c]
movzx ecx, byte [ebp + ecx + 0x1d4]
add esi, ebx
mov ebx, 0x100
sub ebx, edi
mov edi, dword [ebp - 0x30]
add edi, ebx
mov ebx, 0x100
sub ebx, ecx
mov ecx, ebx
mov ebx, dword [ebp - 0x6c]
add ebx, ecx
mov ecx, dword [ebp - 0x48]
dec ecx
cmp dword [ebp - 0x34], ecx
je 0x40e485
mov ecx, dword [esi*4 + 0x4a69f0]
add dword [edx], ecx
mov ecx, dword [edi*4 + 0x4a69f0]
add dword [edx + 4], ecx
mov ecx, dword [ebx*4 + 0x4a69f0]
add dword [edx + 8], ecx
mov ecx, dword [ebp - 0x58]
dec ecx
cmp dword [ebp - 0x44], ecx
je 0x40e4ff
mov ecx, esi
shl ecx, 2
mov esi, dword [ecx + 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 - 0x34], 0
jle 0x40e4d8
mov ebx, dword [ecx + 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 - 0x48]
dec ebx
cmp dword [ebp - 0x34], ebx
je 0x40e4fc
mov ecx, dword [ecx + 0x4a81f0]
add dword [eax + 4], ecx
mov ecx, dword [esi + 0x4a81f0]
add dword [eax + 8], ecx
mov ecx, dword [edi + 0x4a81f0]
add dword [eax + 0xc], ecx
add eax, 0xc
inc dword [ebp - 0x34]
mov ecx, dword [ebp - 0x34]
inc dword [ebp - 0x4c]
cmp ecx, dword [ebp - 0x48]
mov edi, dword [ebp - 0x74]
mov ebx, 0xff
jl 0x40e3bf
inc dword [ebp - 0x44]
mov eax, dword [ebp - 0x58]
cmp dword [ebp - 0x44], eax
jl 0x40e1b8
push dword [ebp - 0x64]
mov esi, dword [sym.imp.KERNEL32.dll_GlobalUnlock]
call esi
push dword [ebp - 0x70]
call esi
push dword [ebp - 0x54]
call fcn.00461ccb
push dword [ebp - 0x5c]
call fcn.00461ccb
mov eax, dword [ebp - 0x70]
pop ecx
pop ecx
jmp 0x40dee5