Function at 0x4061fc
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x358
push ebx
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GlobalLock]
push edi
push dword [ebp + 8]
call esi
test eax, eax
mov dword [ebp - 0x38], eax
je 0x4064bc
movzx ecx, word [eax + 0xe]
cmp ecx, 1
mov dword [ebp - 0x54], ecx
je 0x40623d
cmp ecx, 4
je 0x40623d
cmp ecx, 8
je 0x40623d
cmp ecx, 0x18
jne 0x4064bc
mov edi, dword [eax + 4]
mov eax, dword [eax + 8]
push 8
push eax
push edi
mov dword [ebp - 0x24], edi
mov dword [ebp - 0x3c], eax
call fcn.00404a52
add esp, 0xc
mov dword [ebp - 0x58], eax
test eax, eax
jne 0x40626a
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
jmp 0x4064bc
push eax
call esi
test eax, eax
mov dword [ebp - 0x20], eax
je 0x40625c
push 2
lea edx, [edi + edi*2]
pop eax
mov ecx, 0xc0
cmp dword [ebp + 0x10], eax
mov esi, 0xe0
mov dword [ebp - 0x28], edx
mov dword [ebp - 0x50], ecx
mov dword [ebp - 0x40], esi
mov dword [ebp - 0x48], eax
mov dword [ebp - 0x44], ecx
mov dword [ebp - 0x4c], 5
mov edx, 0x100
jne 0x406333
xor edi, edi
mov eax, edi
xor edx, edx
and eax, ecx
mov ebx, ecx
imul eax, eax, 0xff
add eax, 0x60
div ebx
xor edx, edx
mov ebx, esi
mov byte [ebp + edi - 0x158], al
mov eax, edi
and eax, 0x38
imul eax, eax, 0x3fc
add eax, 0x70
div ebx
xor edx, edx
mov ebx, ecx
mov byte [ebp + edi - 0x258], al
mov eax, edi
and eax, 6
imul eax, eax, 0x1fe0
add eax, 0x60
div ebx
inc edi
mov edx, 0x100
cmp edi, edx
mov byte [ebp + edi - 0x359], al
jb 0x4062aa
mov edi, dword [ebp - 0x20]
mov eax, dword [edi]
add eax, edi
xor edi, edi
inc eax
mov bl, byte [ebp + edi - 0x158]
inc edi
mov byte [eax + 1], bl
mov bl, byte [ebp + edi - 0x259]
mov byte [eax], bl
mov bl, byte [ebp + edi - 0x359]
mov byte [eax - 1], bl
add eax, 4
cmp edi, edx
jb 0x40630e
cmp dword [ebp + 0x10], 3
jne 0x4063dd
mov dword [ebp - 0x50], esi
mov dword [ebp - 0x40], esi
mov dword [ebp - 0x48], 3
mov dword [ebp - 0x44], ecx
mov dword [ebp - 0x4c], 6
xor edi, edi
mov eax, edi
xor edx, edx
and eax, esi
mov ebx, esi
imul eax, eax, 0xff
add eax, 0x70
div ebx
xor edx, edx
mov byte [ebp + edi - 0x158], al
mov eax, edi
and eax, 0x1c
imul eax, eax, 0x7f8
add eax, 0x70
div ebx
xor edx, edx
mov ebx, ecx
mov byte [ebp + edi - 0x258], al
mov eax, edi
and eax, 3
imul eax, eax, 0x3fc0
add eax, 0x60
div ebx
inc edi
mov edx, 0x100
cmp edi, edx
mov byte [ebp + edi - 0x359], al
jb 0x406356
mov ecx, dword [ebp - 0x20]
mov eax, dword [ecx]
add eax, ecx
xor ecx, ecx
inc eax
mov bl, byte [ebp + ecx - 0x158]
inc ecx
mov byte [eax + 1], bl
mov bl, byte [ebp + ecx - 0x259]
mov byte [eax], bl
mov bl, byte [ebp + ecx - 0x359]
mov byte [eax - 1], bl
add eax, 4
cmp ecx, edx
jb 0x4063b8
cmp dword [ebp + 0x10], 4
jne 0x406481
mov eax, 0x80
mov dword [ebp - 0x48], 1
mov dword [ebp - 0x50], eax
mov dword [ebp - 0x40], eax
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x4c], 2
xor ecx, ecx
mov ebx, ecx
and bx, ax
imul ebx, ebx, 0xff
add ebx, 0x40
shr ebx, 7
mov byte [ebp + ecx - 0x158], bl
mov ebx, ecx
and ebx, 0x40
imul ebx, ebx, 0x1fe
add ebx, 0x40
shr ebx, 7
mov byte [ebp + ecx - 0x258], bl
mov ebx, ecx
and ebx, 0x20
imul ebx, ebx, 0x3fc
add ebx, 0x40
shr ebx, 7
mov byte [ebp + ecx - 0x358], bl
inc ecx
cmp ecx, edx
jb 0x406405
mov ecx, dword [ebp - 0x20]
mov eax, dword [ecx]
add eax, ecx
xor ecx, ecx
inc eax
mov bl, byte [ebp + ecx - 0x158]
inc ecx
mov byte [eax + 1], bl
mov bl, byte [ebp + ecx - 0x259]
mov byte [eax], bl
mov bl, byte [ebp + ecx - 0x359]
mov byte [eax - 1], bl
add eax, 4
cmp ecx, edx
jb 0x40645c
mov ecx, dword [ebp - 0x38]
mov eax, dword [ecx]
add eax, ecx
cmp dword [ebp + 0x10], 1
mov dword [ebp - 0x30], eax
je 0x4064c3
call fcn.00406115
mov eax, dword [ebp - 0x28]
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 - 0x28], eax
je 0x4064bc
test eax, eax
jne 0x4064c3
xor eax, eax
jmp 0x40695d
cmp dword [ebp + 0x10], 2
jl 0x406932
mov eax, dword [ebp - 0x38]
cmp dword [eax + 0x10], 3
jne 0x4064de
mov ecx, dword [eax]
lea edi, [ecx + eax + 0xc]
jmp 0x4064e8
mov ecx, dword [eax + 0x20]
mov edx, dword [eax]
lea edi, [edx + ecx*4]
add edi, eax
mov esi, dword [ebp - 0x28]
xor edx, edx
cmp dword [ebp - 0x24], edx
mov dword [ebp - 4], edx
jle 0x4065e8
lea ecx, [edi + 1]
mov dword [ebp - 0x18], ecx
mov eax, dword [ebp - 0x54]
dec eax
je 0x406578
sub eax, 3
je 0x406537
sub eax, 4
je 0x406531
sub eax, 0x10
jne 0x4065ba
movzx eax, byte [ecx + 1]
mov dword [ebp - 0xc], eax
movzx eax, byte [ecx]
mov dword [ebp - 0x10], eax
movzx eax, byte [ecx - 1]
mov dword [ebp - 8], eax
jmp 0x4065ba
movzx eax, byte [edx + edi]
jmp 0x40655f
mov eax, edx
push 2
cdq
pop ebx
idiv ebx
mov eax, dword [ebp - 4]
test edx, edx
cdq
jne 0x406553
sub eax, edx
sar eax, 1
mov al, byte [eax + edi]
shr al, 4
jmp 0x40655c
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 - 0xc], edx
movzx edx, byte [eax + 1]
movzx eax, byte [eax]
mov dword [ebp - 0x10], edx
jmp 0x406529
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 0x40659a
mov bl, 1
mov ecx, dword [ebp - 0x30]
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 - 0x10], ecx
mov ecx, dword [ebp - 0x18]
mov dword [ebp - 8], eax
mov eax, dword [ebp - 0xc]
mov edx, dword [ebp - 4]
mov dword [esi], eax
mov eax, dword [ebp - 0x10]
add esi, 4
add ecx, 3
mov dword [ebp - 0x18], ecx
mov dword [esi], eax
mov eax, dword [ebp - 8]
add esi, 4
mov dword [esi], eax
add esi, 4
inc edx
cmp edx, dword [ebp - 0x24]
mov dword [ebp - 4], edx
jl 0x4064ff
and dword [ebp - 0x18], 0
cmp dword [ebp - 0x3c], 0
jle 0x406932
mov eax, dword [ebp - 0x38]
mov edx, dword [ebp - 0x20]
jmp 0x406604
mov edx, dword [ebp - 0x20]
mov eax, dword [ebp - 0x38]
mov ecx, dword [ebp - 0x28]
mov edi, dword [ebp - 0x34]
mov ebx, dword [ebp - 0x18]
mov dword [ebp - 0x34], ecx
mov ecx, dword [ebp - 0x3c]
mov dword [ebp - 0x28], edi
dec ecx
cmp ebx, ecx
je 0x40676f
cmp dword [eax + 0x10], 3
jne 0x40662d
mov ecx, dword [eax]
lea ecx, [ecx + eax + 0xc]
jmp 0x406637
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 ebx
imul esi, ebx
xor ebx, ebx
add esi, ecx
cmp dword [ebp - 0x24], ebx
mov dword [ebp - 4], ebx
jle 0x40676f
lea ecx, [esi + 1]
mov dword [ebp - 0x1c], ecx
mov eax, dword [ebp - 0x54]
dec eax
je 0x4066fc
sub eax, 3
je 0x4066b8
sub eax, 4
je 0x40669b
sub eax, 0x10
jne 0x406741
movzx eax, byte [ecx + 1]
mov dword [ebp - 0xc], eax
movzx eax, byte [ecx]
mov dword [ebp - 0x10], eax
movzx eax, byte [ecx - 1]
mov dword [ebp - 8], eax
jmp 0x406741
movzx eax, byte [ebx + esi]
mov ebx, dword [ebp - 0x30]
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 - 0x10], ebx
jmp 0x406693
mov eax, ebx
push 2
cdq
pop ebx
idiv ebx
mov eax, dword [ebp - 4]
test edx, edx
cdq
jne 0x4066d4
sub eax, edx
sar eax, 1
mov al, byte [eax + esi]
shr al, 4
jmp 0x4066dd
sub eax, edx
sar eax, 1
mov al, byte [eax + esi]
and al, 0xf
mov edx, dword [ebp - 0x30]
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 - 0x10], edx
mov dword [ebp - 8], eax
jmp 0x40673e
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 0x40671e
mov bl, 1
mov ecx, dword [ebp - 0x30]
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 - 0x10], ecx
mov ecx, dword [ebp - 0x1c]
mov dword [ebp - 8], eax
mov edx, dword [ebp - 0x20]
mov eax, dword [ebp - 0xc]
mov ebx, dword [ebp - 4]
mov dword [edi], eax
mov eax, dword [ebp - 0x10]
add edi, 4
add ecx, 3
mov dword [ebp - 0x1c], ecx
mov dword [edi], eax
mov eax, dword [ebp - 8]
add edi, 4
mov dword [edi], eax
add edi, 4
inc ebx
cmp ebx, dword [ebp - 0x24]
mov dword [ebp - 4], ebx
jl 0x406665
cmp dword [edx + 0x10], 3
jne 0x40677d
mov eax, dword [edx]
lea ecx, [eax + edx + 0xc]
jmp 0x406787
mov eax, dword [edx + 0x20]
mov ecx, dword [edx]
lea ecx, [ecx + eax*4]
add ecx, edx
mov eax, dword [ebp - 0x20]
and dword [ebp - 0x1c], 0
mov edi, dword [ebp - 0x34]
movzx esi, word [eax + 0xe]
imul esi, dword [eax + 4]
add esi, 0x1f
shr esi, 3
and esi, 0x1ffffffc
imul esi, dword [ebp - 0x18]
add esi, ecx
cmp dword [ebp - 0x24], 0
jle 0x406923
mov eax, dword [ebp - 0x28]
lea edx, [eax + 8]
mov ebx, dword [edi]
mov eax, dword [edi + 4]
add edi, 4
mov dword [ebp - 0x2c], eax
add edi, 4
mov ecx, 0xff
mov dword [ebp - 4], ebx
mov eax, dword [edi]
add edi, 4
test ebx, ebx
mov dword [ebp - 0x14], eax
jge 0x4067e1
and dword [ebp - 4], 0
cmp dword [ebp - 4], ecx
jle 0x4067e9
mov dword [ebp - 4], ecx
cmp dword [ebp - 0x2c], 0
jge 0x4067f3
and dword [ebp - 0x2c], 0
cmp dword [ebp - 0x2c], ecx
jle 0x4067fb
mov dword [ebp - 0x2c], ecx
test eax, eax
jge 0x406804
xor eax, eax
mov dword [ebp - 0x14], eax
cmp eax, ecx
jle 0x40680d
mov eax, ecx
mov dword [ebp - 0x14], eax
and eax, dword [ebp - 0x44]
mov ecx, dword [ebp - 0x4c]
mov ebx, dword [ebp - 0x2c]
and ebx, dword [ebp - 0x40]
sar eax, cl
mov ecx, dword [ebp - 0x48]
sar ebx, cl
mov ecx, dword [ebp - 4]
and ecx, dword [ebp - 0x50]
or eax, ebx
mov ebx, 0x100
or eax, ecx
mov byte [esi], al
movzx ecx, byte [ebp + eax - 0x158]
sub ebx, ecx
movzx ecx, byte [ebp + eax - 0x258]
add dword [ebp - 4], ebx
mov ebx, 0x100
movzx eax, byte [ebp + eax - 0x358]
sub ebx, ecx
mov ecx, dword [ebp - 0x2c]
add ecx, ebx
mov ebx, 0x100
sub ebx, eax
mov eax, dword [ebp - 0x24]
add dword [ebp - 0x14], ebx
dec eax
cmp dword [ebp - 0x1c], eax
je 0x406890
mov eax, dword [ebp - 4]
mov eax, dword [eax*4 + 0x453d78]
add dword [edi], eax
mov eax, dword [ecx*4 + 0x453d78]
add dword [edi + 4], eax
mov eax, dword [ebp - 0x14]
mov eax, dword [eax*4 + 0x453d78]
add dword [edi + 8], eax
mov eax, dword [ebp - 0x3c]
dec eax
cmp dword [ebp - 0x18], eax
je 0x406913
mov eax, dword [ebp - 4]
shl eax, 2
shl ecx, 2
mov ebx, dword [eax + 0x454578]
add dword [edx - 8], ebx
mov ebx, dword [ecx + 0x454578]
add dword [edx - 4], ebx
mov ebx, dword [ebp - 0x14]
shl ebx, 2
mov dword [ebp - 0x14], ebx
mov ebx, dword [ebx + 0x454578]
add dword [edx], ebx
cmp dword [ebp - 0x1c], 0
jle 0x4068e9
mov ebx, dword [eax + 0x454d78]
add dword [edx - 0x14], ebx
mov ebx, dword [ecx + 0x454d78]
add dword [edx - 0x10], ebx
mov ebx, dword [ebp - 0x14]
mov ebx, dword [ebx + 0x454d78]
add dword [edx - 0xc], ebx
mov ebx, dword [ebp - 0x24]
dec ebx
cmp dword [ebp - 0x1c], ebx
je 0x406910
mov eax, dword [eax + 0x455578]
add dword [edx + 4], eax
mov eax, dword [ecx + 0x455578]
add dword [edx + 8], eax
mov eax, dword [ebp - 0x14]
mov eax, dword [eax + 0x455578]
add dword [edx + 0xc], eax
add edx, 0xc
inc dword [ebp - 0x1c]
inc esi
mov eax, dword [ebp - 0x1c]
cmp eax, dword [ebp - 0x24]
jl 0x4067bb
inc dword [ebp - 0x18]
mov eax, dword [ebp - 0x18]
cmp eax, dword [ebp - 0x3c]
jl 0x4065fe
push dword [ebp + 8]
mov esi, dword [sym.imp.KERNEL32.dll_GlobalUnlock]
call esi
push dword [ebp - 0x58]
call esi
cmp dword [ebp + 0x10], 1
je 0x40695a
push dword [ebp - 0x34]
call fcn.0042deb8
push dword [ebp - 0x28]
call fcn.0042deb8
pop ecx
pop ecx
mov eax, dword [ebp - 0x58]
pop edi
pop esi
pop ebx
leave
ret