Function at 0x406b7a
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
lea eax, [ebp + 8]
lea edx, [ebp + 8]
sub eax, edx
lea edx, [ebp + 8]
push ebx
push esi
cmp eax, edx
push edi
mov dword [ebp - 0x14], ecx
mov dword [ecx], 0x40d074
jne 0x406d8c
xor ebx, ebx
xor esi, esi
xor eax, eax
xor edi, edi
mov dl, byte [eax]
test dl, dl
je 0x406bca
mov cl, byte [esi]
cmp cl, dl
jne 0x406bc1
test cl, cl
je 0x406bc1
mov cl, byte [esi + 1]
inc esi
inc eax
inc edi
cmp cl, byte [eax]
je 0x406bb3
sub esi, edi
sub eax, edi
xor edi, edi
inc eax
jmp 0x406ba7
push 1
pop esi
mov ecx, esi
mov eax, esi
cmp eax, 5
jg 0x406bf1
cmp eax, ebx
je 0x406bea
mov dl, byte [ebp + ecx + 7]
cmp dl, byte [ebp + eax + 9]
je 0x406bea
mov eax, dword [ebp + eax*4 - 0x30]
jmp 0x406bec
inc ecx
inc eax
cmp ecx, 3
jle 0x406bd1
mov ecx, esi
mov eax, esi
cmp eax, 5
jg 0x406c15
cmp eax, ebx
je 0x406c0e
mov dl, byte [ebp + ecx + 7]
cmp dl, byte [ebp + eax + 9]
je 0x406c0e
mov eax, dword [ebp + eax*4 - 0x30]
jmp 0x406c10
inc ecx
inc eax
cmp ecx, 3
jle 0x406bf5
push 3
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x2c], ebx
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x24], ebx
pop ebx
mov dword [ebp - 0x10], ebx
mov dword [ebp - 8], ebx
xor edx, edx
xor eax, eax
lea ecx, [eax + eax*2]
add edx, dword [ebp + ecx*4 - 0x30]
inc eax
cmp eax, ebx
jl 0x406c2e
push 2
xor esi, esi
pop eax
lea ecx, [esi + eax*2]
mov edi, eax
lea ecx, [ebp + ecx*4 - 0x30]
cmp edi, esi
je 0x406c4e
add edx, dword [ecx]
inc edi
add ecx, 8
cmp edi, eax
jle 0x406c48
inc esi
dec eax
cmp eax, 0xffffffff
jg 0x406c3f
dec dword [ebp - 8]
jne 0x406c2a
dec dword [ebp - 0x10]
jne 0x406c27
push 1
pop eax
mov ecx, eax
cmp eax, 5
jg 0x406c8b
test eax, eax
je 0x406c85
mov dl, byte [ebp + ecx + 7]
cmp dl, byte [ebp + eax + 9]
je 0x406c85
mov eax, dword [ebp + eax*4 - 0x30]
jmp 0x406c87
inc ecx
inc eax
cmp ecx, ebx
jle 0x406c6c
xor eax, eax
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x24], eax
jmp 0x406ca1
push 3
pop ebx
xor edx, edx
xor eax, eax
lea ecx, [eax + eax*2]
add edx, dword [ebp + ecx*4 - 0x30]
inc eax
cmp eax, 3
jl 0x406ca5
push 2
xor esi, esi
pop eax
lea ecx, [esi + eax*2]
mov edi, eax
lea ecx, [ebp + ecx*4 - 0x30]
cmp edi, esi
je 0x406cc6
add edx, dword [ecx]
inc edi
add ecx, 8
cmp edi, eax
jle 0x406cc0
inc esi
dec eax
cmp eax, 0xffffffff
jg 0x406cb7
dec ebx
jne 0x406ca1
dec dword [ebp - 0x10]
jne 0x406c9e
xor eax, eax
xor ecx, ecx
mov dl, byte [eax]
test dl, dl
je 0x406d1f
push 0x30
pop ebx
cmp dl, bl
jl 0x406d17
cmp dl, 0x39
jg 0x406d17
movsx edx, dl
sub edx, ebx
inc eax
mov dword [ecx], edx
mov dl, byte [eax]
cmp dl, bl
jl 0x406d14
cmp dl, 0x39
jg 0x406d14
mov esi, dword [ecx]
movsx edx, dl
lea esi, [esi + esi*4]
lea edx, [edx + esi*2 - 0x30]
jmp 0x406cf8
add ecx, 4
mov dl, byte [eax + 1]
inc eax
test dl, dl
jne 0x406cea
push 1
mov dword [ebp - 0x24], 3
pop ecx
lea edx, [ebp - 0x28]
push 2
mov dword [ebp - 0x20], ecx
pop esi
mov dword [ebp - 0x2c], ecx
mov dword [ebp - 0x28], esi
inc dword [ebp - 0x20]
mov edi, dword [ebp - 0x20]
mov eax, dword [edx]
and dword [ebp - 0xc], 0
cmp esi, ecx
mov dword [ebp + edi*4 - 0x20], eax
jg 0x406d7a
add eax, eax
push 2
mov dword [ebp - 0x10], eax
pop eax
lea ecx, [edx + 4]
sub eax, esi
mov edi, dword [ecx]
mov ebx, dword [ebp - 0x10]
add ebx, edi
cmp dword [ebp + ebx*4 - 0x30], 0
je 0x406d71
inc dword [ebp - 0xc]
mov ebx, dword [ebp - 0xc]
mov dword [ebp + ebx*4 - 0xc], edi
add ecx, 4
dec eax
jne 0x406d59
push 1
pop ecx
dec dword [ebp - 0x20]
inc esi
add edx, 4
lea eax, [esi - 1]
cmp eax, 3
jle 0x406d38
mov ecx, dword [ebp - 0x14]
lea edi, [ecx + 4]
xor eax, eax
mov ecx, edi
mov byte [ecx], al
inc eax
inc ecx
cmp ax, 0x100
jl 0x406d93
and byte [edi + 0x100], 0
and byte [edi + 0x101], 0
xor dl, dl
xor ebx, ebx
mov ecx, edi
mov dword [ebp - 0x10], 0x100
mov al, byte [ecx]
movzx esi, dl
mov edx, dword [ebp + 8]
mov byte [ebp - 1], al
movzx eax, al
movzx edx, byte [esi + edx]
add ebx, edx
add eax, ebx
mov ebx, 0x100
cdq
idiv ebx
movzx ebx, dl
mov al, byte [ebx + edi]
mov byte [ecx], al
mov al, byte [ebp - 1]
mov byte [ebx + edi], al
lea eax, [esi + 1]
cdq
idiv dword [ebp + 0xc]
inc ecx
dec dword [ebp - 0x10]
jne 0x406db8
mov eax, dword [ebp - 0x14]
pop edi
pop esi
pop ebx
leave
ret 8