Function at 0x406748
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffff690
push ebx
push esi
push edi
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x10]
mov dword [ebp - 0x14], edx
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0x18]
mov dword [ebp - 0x18], eax
mov edx, dword [ebp + 8]
mov ecx, dword [edx + 0x14]
mov dword [ebp - 0x1c], ecx
mov eax, dword [ebp + 8]
mov esi, dword [eax + 0x20]
mov eax, dword [ebp + 8]
add eax, 0x24
mov dword [ebp - 0x20], eax
mov edx, dword [ebp + 8]
mov ecx, dword [edx + 0x48]
mov dword [ebp - 0x24], ecx
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x28]
mov dword [ebp - 0x28], edx
mov ecx, dword [ebp + 8]
mov al, byte [ecx + 0x30]
mov byte [ebp - 0x29], al
mov edx, dword [ebp + 8]
mov ecx, dword [edx + 0x26c]
cmp ecx, 4
jl 0x4067b9
push str.________sort_initialise_..._n
push 0x4216e4
call fcn.00413848
add esp, 8
xor eax, eax
mov dword [ebp - 4], eax
mov edx, dword [ebp - 0x14]
mov ecx, edx
mov dword [ebp - 0x68], ecx
mov eax, dword [ebp - 4]
cdq
idiv dword [ebp - 0x24]
mov ecx, dword [ebp - 0x14]
mov al, byte [ecx + edx]
mov edx, dword [ebp - 0x68]
mov ecx, dword [ebp - 0x24]
mov byte [edx + ecx], al
inc dword [ebp - 4]
inc dword [ebp - 0x68]
mov eax, dword [ebp - 4]
cmp eax, 0x14
jl 0x4067c6
xor edx, edx
mov dword [ebp - 4], edx
mov ecx, dword [ebp - 0x1c]
mov eax, ecx
mov dword [ebp - 0x68], eax
jmp 0x406808
mov edx, dword [ebp - 0x68]
mov word [edx], 0
inc dword [ebp - 4]
add dword [ebp - 0x68], 2
mov ecx, dword [ebp - 0x24]
add ecx, 0x14
mov eax, dword [ebp - 4]
cmp ecx, eax
jg 0x4067f9
mov edx, dword [ebp - 0x24]
cmp edx, 0xfa0
jg 0x4068c0
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0x26c]
cmp eax, 4
jl 0x406844
push str.________simpleSort_..._n
push 0x4216e4
call fcn.00413848
add esp, 8
xor edx, edx
mov dword [ebp - 4], edx
mov ecx, dword [ebp - 0x18]
mov eax, ecx
mov dword [ebp - 0x68], eax
mov edx, dword [ebp - 4]
mov ecx, dword [ebp - 0x24]
cmp edx, ecx
jge 0x406874
mov eax, dword [ebp - 0x68]
mov edx, dword [ebp - 4]
mov dword [eax], edx
inc dword [ebp - 4]
add dword [ebp - 0x68], 4
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x24]
cmp ecx, eax
jl 0x40685b
mov byte [ebp - 0x29], 0
xor edx, edx
mov dword [ebp - 0x28], edx
mov eax, dword [ebp - 0x20]
mov dword [eax], edx
push 0
mov ecx, dword [ebp - 0x24]
dec ecx
push ecx
push 0
mov eax, dword [ebp + 8]
push eax
call fcn.00406180
add esp, 0x10
mov edx, dword [ebp + 8]
mov ecx, dword [edx + 0x26c]
cmp ecx, 4
jl 0x406eb8
push str.________simpleSort_done._n
push 0x4216e4
call fcn.00413848
add esp, 8
jmp 0x406eb8
xor eax, eax
mov dword [ebp - 0x10], eax
xor edx, edx
mov dword [ebp - 4], edx
lea ecx, [ebp - 0x970]
mov dword [ebp - 0x68], ecx
mov eax, dword [ebp - 0x68]
mov byte [eax], 0
inc dword [ebp - 4]
inc dword [ebp - 0x68]
mov edx, dword [ebp - 4]
cmp edx, 0xff
jle 0x4068d3
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0x26c]
cmp eax, 4
jl 0x40690a
push str.________bucket_sorting_..._n
push 0x4216e4
call fcn.00413848
add esp, 8
xor edx, edx
mov dword [ebp - 4], edx
mov ecx, esi
mov dword [ebp - 0x68], ecx
mov eax, dword [ebp - 0x68]
xor edx, edx
mov dword [eax], edx
inc dword [ebp - 4]
add dword [ebp - 0x68], 4
mov ecx, dword [ebp - 4]
cmp ecx, 0x10000
jle 0x406914
mov eax, dword [ebp - 0x14]
mov edx, dword [ebp - 0x24]
mov dl, byte [eax + edx - 1]
xor eax, eax
mov dword [ebp - 4], eax
mov ecx, dword [ebp - 0x14]
mov eax, ecx
mov dword [ebp - 0x68], eax
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x24]
cmp ecx, eax
jge 0x406977
mov ecx, dword [ebp - 0x68]
mov al, byte [ecx]
and edx, 0xff
shl edx, 8
xor ecx, ecx
mov cl, al
add edx, ecx
inc dword [esi + edx*4]
mov edx, eax
inc dword [ebp - 4]
inc dword [ebp - 0x68]
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 0x24]
cmp eax, ecx
jl 0x40694e
mov dword [ebp - 4], 1
mov eax, esi
mov dword [ebp - 0x68], eax
mov edx, dword [ebp - 0x68]
mov ecx, dword [edx]
mov eax, dword [ebp - 0x68]
add dword [eax + 4], ecx
inc dword [ebp - 4]
add dword [ebp - 0x68], 4
mov edx, dword [ebp - 4]
cmp edx, 0x10000
jle 0x406983
mov ecx, dword [ebp - 0x14]
mov dl, byte [ecx]
xor eax, eax
mov dword [ebp - 4], eax
mov ecx, dword [ebp - 0x14]
lea eax, [ecx + 1]
mov dword [ebp - 0x68], eax
jmp 0x4069de
mov ecx, dword [ebp - 0x68]
mov al, byte [ecx]
xor ebx, ebx
mov bl, dl
shl ebx, 8
xor edx, edx
mov dl, al
add ebx, edx
mov edx, eax
dec dword [esi + ebx*4]
mov eax, dword [ebp - 0x18]
mov ecx, dword [esi + ebx*4]
mov ebx, dword [ebp - 4]
mov dword [eax + ecx*4], ebx
inc dword [ebp - 4]
inc dword [ebp - 0x68]
mov eax, dword [ebp - 0x24]
dec eax
mov ecx, dword [ebp - 4]
cmp eax, ecx
jg 0x4069b5
mov edx, dword [ebp - 0x14]
mov eax, dword [ebp - 0x24]
xor ebx, ebx
mov bl, byte [edx + eax - 1]
shl ebx, 8
mov eax, dword [ebp - 0x14]
xor edx, edx
mov dl, byte [eax]
add ebx, edx
dec dword [esi + ebx*4]
mov ecx, dword [ebp - 0x18]
mov eax, dword [esi + ebx*4]
mov edx, dword [ebp - 0x24]
dec edx
mov dword [ecx + eax*4], edx
xor ecx, ecx
mov dword [ebp - 4], ecx
lea eax, [ebp - 0x470]
mov dword [ebp - 0x68], eax
mov edx, dword [ebp - 0x68]
mov ecx, dword [ebp - 4]
mov dword [edx], ecx
inc dword [ebp - 4]
add dword [ebp - 0x68], 4
mov eax, dword [ebp - 4]
cmp eax, 0xff
jle 0x406a1f
mov ecx, 1
lea edx, [ecx + ecx*2]
inc edx
mov ecx, edx
cmp ecx, 0x100
jle 0x406a3d
mov eax, ecx
mov ecx, 3
cdq
idiv ecx
mov ecx, eax
mov dword [ebp - 4], ecx
mov eax, dword [ebp - 4]
lea edx, [ebp + eax*4 - 0x470]
mov dword [ebp - 0x68], edx
mov eax, dword [ebp - 4]
cmp eax, 0xff
jg 0x406b03
mov edx, dword [ebp - 0x68]
mov eax, dword [edx]
mov dword [ebp - 0x30], eax
mov ebx, dword [ebp - 4]
mov eax, dword [ebp - 0x30]
shl eax, 7
lea edx, [esi + eax*8]
mov dword [ebp - 0x6c], edx
jmp 0x406aa9
mov eax, ebx
sub eax, ecx
mov edx, dword [ebp + eax*4 - 0x470]
mov dword [ebp + ebx*4 - 0x470], edx
sub ebx, ecx
lea eax, [ecx - 1]
cmp ebx, eax
jle 0x406ae3
mov edx, ebx
sub edx, ecx
mov eax, dword [ebp + edx*4 - 0x470]
inc eax
shl eax, 8
mov edx, dword [esi + eax*4]
mov eax, ebx
sub eax, ecx
mov eax, dword [ebp + eax*4 - 0x470]
shl eax, 8
mov eax, dword [esi + eax*4]
sub edx, eax
mov eax, dword [ebp - 0x30]
inc eax
shl eax, 8
mov eax, dword [esi + eax*4]
mov edi, dword [ebp - 0x6c]
mov edi, dword [edi]
sub eax, edi
cmp edx, eax
jg 0x406a8e
mov eax, dword [ebp - 0x30]
mov dword [ebp + ebx*4 - 0x470], eax
inc dword [ebp - 4]
add dword [ebp - 0x68], 4
mov edx, dword [ebp - 4]
cmp edx, 0xff
jle 0x406a75
cmp ecx, 1
jne 0x406a4b
xor ecx, ecx
mov dword [ebp - 4], ecx
lea eax, [ebp - 0x470]
mov dword [ebp - 0x68], eax
mov edx, dword [ebp - 0x68]
mov ecx, dword [edx]
mov dword [ebp - 0xc], ecx
xor ebx, ebx
mov eax, dword [ebp - 0xc]
cmp ebx, eax
je 0x406bd8
mov edi, dword [ebp - 0xc]
shl edi, 8
add edi, ebx
test byte [esi + edi*4 + 2], 0x20
jne 0x406bd1
mov eax, dword [esi + edi*4]
and eax, 0xffdfffff
mov dword [ebp - 0x34], eax
mov edx, dword [esi + edi*4 + 4]
and edx, 0xffdfffff
dec edx
mov dword [ebp - 0x38], edx
mov ecx, dword [ebp - 0x38]
mov eax, dword [ebp - 0x34]
cmp ecx, eax
jle 0x406bd1
mov edx, dword [ebp + 8]
mov ecx, dword [edx + 0x26c]
cmp ecx, 4
jl 0x406b98
mov eax, dword [ebp - 0x38]
mov edx, dword [ebp - 0x34]
sub eax, edx
inc eax
push eax
mov ecx, dword [ebp - 0x10]
push ecx
push ebx
mov eax, dword [ebp - 0xc]
push eax
push str.________qsort__0x_x__0x_x____done__d___this__d_n
push 0x4216e4
call fcn.00413848
add esp, 0x18
push 2
mov edx, dword [ebp - 0x38]
push edx
mov ecx, dword [ebp - 0x34]
push ecx
mov eax, dword [ebp + 8]
push eax
call fcn.004063ec
add esp, 0x10
mov edx, dword [ebp - 0x38]
mov ecx, dword [ebp - 0x34]
sub edx, ecx
inc edx
add dword [ebp - 0x10], edx
mov eax, dword [ebp - 0x20]
mov edx, dword [eax]
mov ecx, dword [ebp - 0x28]
cmp edx, ecx
jle 0x406bd1
mov al, byte [ebp - 0x29]
test al, al
jne 0x406eb8
or dword [esi + edi*4], 0x200000
inc ebx
cmp ebx, 0xff
jle 0x406b24
mov edx, dword [ebp - 0xc]
shl edx, 8
mov ecx, dword [ebp - 0xc]
add edx, ecx
mov dword [ebp - 0x4c], edx
mov eax, dword [ebp - 0x4c]
mov edx, dword [esi + eax*4]
and edx, 0xffdfffff
mov dword [ebp - 0x50], edx
mov ecx, dword [ebp - 0x4c]
mov eax, dword [esi + ecx*4 + 4]
and eax, 0xffdfffff
dec eax
mov dword [ebp - 0x54], eax
mov dl, byte [ebp - 0xc]
mov byte [ebp - 0x55], dl
mov ecx, dword [ebp - 0x50]
mov dword [ebp - 0x3c], ecx
mov eax, dword [ebp - 0xc]
shl eax, 8
mov edx, dword [esi + eax*4]
and edx, 0xffdfffff
mov dword [ebp - 0x40], edx
mov ecx, dword [ebp - 0x54]
mov dword [ebp - 0x44], ecx
mov eax, dword [ebp - 0xc]
inc eax
shl eax, 8
mov edx, dword [esi + eax*4]
and edx, 0xffdfffff
dec edx
mov dword [ebp - 0x48], edx
mov ecx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x3c]
lea edx, [ecx + eax*4]
mov dword [ebp - 0x70], edx
mov ecx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x40]
lea eax, [ecx + eax*4]
mov edx, dword [ebp - 0x40]
mov ecx, dword [ebp - 0x3c]
cmp edx, ecx
jge 0x406c9c
mov ebx, dword [eax]
dec ebx
test ebx, ebx
jge 0x406c73
add ebx, dword [ebp - 0x24]
mov edx, dword [ebp - 0x14]
mov dl, byte [edx + ebx]
mov cl, byte [ebp - 0x55]
cmp dl, cl
jne 0x406c8c
mov edx, dword [ebp - 0x70]
mov dword [edx], ebx
inc dword [ebp - 0x3c]
add dword [ebp - 0x70], 4
inc dword [ebp - 0x40]
add eax, 4
mov ecx, dword [ebp - 0x40]
mov edx, dword [ebp - 0x3c]
cmp ecx, edx
jl 0x406c69
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x44]
lea eax, [eax + ecx*4]
mov edx, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x48]
lea edx, [edx + ecx*4]
mov dword [ebp - 0x70], edx
mov ecx, dword [ebp - 0x48]
mov edx, dword [ebp - 0x44]
cmp ecx, edx
jle 0x406cee
mov ecx, dword [ebp - 0x70]
mov ebx, dword [ecx]
dec ebx
test ebx, ebx
jge 0x406cc8
add ebx, dword [ebp - 0x24]
mov edx, dword [ebp - 0x14]
mov dl, byte [edx + ebx]
mov cl, byte [ebp - 0x55]
cmp dl, cl
jne 0x406cdd
mov dword [eax], ebx
dec dword [ebp - 0x44]
add eax, 0xfffffffc
dec dword [ebp - 0x48]
add dword [ebp - 0x70], 0xfffffffc
mov edx, dword [ebp - 0x48]
mov ecx, dword [ebp - 0x44]
cmp edx, ecx
jg 0x406cbb
mov eax, dword [ebp - 0x4c]
or dword [esi + eax*4], 0x200000
mov eax, dword [ebp - 0xc]
mov byte [ebp + eax - 0x970], 1
mov edx, dword [ebp - 4]
cmp edx, 0xff
jge 0x406daf
mov ecx, dword [ebp - 0xc]
shl ecx, 8
mov eax, dword [esi + ecx*4]
and eax, 0xffdfffff
mov dword [ebp - 0x5c], eax
mov edx, dword [ebp - 0xc]
inc edx
shl edx, 8
mov ecx, dword [esi + edx*4]
and ecx, 0xffdfffff
mov eax, dword [ebp - 0x5c]
sub ecx, eax
mov dword [ebp - 0x60], ecx
xor edx, edx
jmp 0x406d40
inc edx
mov ecx, edx
mov eax, dword [ebp - 0x60]
sar eax, cl
cmp eax, 0xfffe
jg 0x406d3f
xor ebx, ebx
mov eax, dword [ebp - 0x60]
cmp ebx, eax
jge 0x406d94
mov ecx, dword [ebp - 0x5c]
add ecx, ebx
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + ecx*4]
mov ecx, edx
mov edi, ebx
sar edi, cl
mov word [ebp - 0x62], di
mov ecx, dword [ebp - 0x1c]
mov di, word [ebp - 0x62]
mov word [ecx + eax*2], di
cmp eax, 0x14
jge 0x406d8c
mov ecx, dword [ebp - 0x24]
add eax, ecx
mov ecx, dword [ebp - 0x1c]
mov di, word [ebp - 0x62]
mov word [ecx + eax*2], di
inc ebx
mov eax, dword [ebp - 0x60]
cmp ebx, eax
jl 0x406d57
mov ecx, edx
mov edx, dword [ebp - 0x60]
dec edx
sar edx, cl
cmp edx, 0xffff
jle 0x406daf
push 0x3ea
call fcn.0040ab08
pop ecx
xor ebx, ebx
lea eax, [ebp - 0x870]
mov edx, ebx
shl edx, 8
mov ecx, dword [ebp - 0xc]
add edx, ecx
mov edx, dword [esi + edx*4]
and edx, 0xffdfffff
mov dword [eax], edx
inc ebx
add eax, 4
cmp ebx, 0xff
jle 0x406db7
mov eax, dword [ebp - 0xc]
shl eax, 8
mov ebx, dword [esi + eax*4]
and ebx, 0xffdfffff
mov eax, dword [ebp - 0x18]
lea eax, [eax + ebx*4]
jmp 0x406e41
mov edx, dword [eax]
dec edx
mov dword [ebp - 8], edx
mov ecx, dword [ebp - 8]
test ecx, ecx
jge 0x406e02
mov edx, dword [ebp - 0x24]
add dword [ebp - 8], edx
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 8]
mov dl, byte [ecx + edx]
xor ecx, ecx
mov cl, dl
mov cl, byte [ebp + ecx - 0x970]
test cl, cl
jne 0x406e3d
xor ecx, ecx
mov cl, dl
mov ecx, dword [ebp + ecx*4 - 0x870]
mov edi, dword [ebp - 0x18]
lea edi, [edi + ecx*4]
mov ecx, dword [ebp - 8]
mov dword [edi], ecx
and edx, 0xff
inc dword [ebp + edx*4 - 0x870]
inc ebx
add eax, 4
mov edx, dword [ebp - 0xc]
inc edx
shl edx, 8
mov ecx, dword [esi + edx*4]
and ecx, 0xffdfffff
cmp ebx, ecx
jl 0x406def
xor ebx, ebx
mov eax, ebx
shl eax, 8
mov edx, dword [ebp - 0xc]
add eax, edx
or dword [esi + eax*4], 0x200000
inc ebx
cmp ebx, 0xff
jle 0x406e57
inc dword [ebp - 4]
add dword [ebp - 0x68], 4
mov ecx, dword [ebp - 4]
cmp ecx, 0xff
jle 0x406b1a
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x26c]
cmp edx, 4
jl 0x406eb8
mov ecx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x10]
sub ecx, eax
push ecx
mov edx, dword [ebp - 0x10]
push edx
mov ecx, dword [ebp - 0x24]
push ecx
push str._________d_pointers___d_sorted___d_scanned_n
push 0x4216e4
call fcn.00413848
add esp, 0x14
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret