Function at 0x40861c
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x124
mov dword [ebp - 0x10], ecx
mov dword [ecx], 0x40f070
lea eax, [ebp + 8]
lea ecx, [ebp + 8]
add eax, ecx
lea ecx, [ebp + 8]
lea edx, [ebp + 8]
push ebx
imul ecx, edx
push esi
cmp ecx, eax
push edi
jne 0x40882b
xor eax, eax
xor ecx, ecx
cmp byte [eax], 0
je 0x408657
inc eax
inc ecx
jmp 0x40864e
mov ecx, dword [ebp + 8]
push 1
pop ebx
and dword [ebp - 4], 0
push 1
pop esi
cmp ebx, esi
jle 0x408683
lea edi, [ebp + ecx*4 - 0x1c]
mov eax, ebx
cdq
idiv esi
test edx, edx
jne 0x40867e
add dword [ebp - 4], esi
mov dword [edi], esi
inc ecx
add edi, 4
inc esi
cmp esi, ebx
jl 0x40866c
xor ecx, ecx
inc ebx
cmp ebx, 0x3e8
jle 0x40865d
xor eax, eax
xor edi, edi
mov dl, byte [eax]
test dl, dl
je 0x4086d0
push 0x30
pop ebx
cmp dl, bl
jl 0x4086c8
cmp dl, 0x39
jg 0x4086c8
movsx ecx, dl
sub ecx, ebx
inc eax
mov dword [edi], ecx
mov dl, byte [eax]
cmp dl, bl
jl 0x4086c5
cmp dl, 0x39
jg 0x4086c5
mov esi, ecx
movsx edx, dl
lea ecx, [esi + esi*4]
lea ecx, [edx + ecx*2 - 0x30]
jmp 0x4086a9
add edi, 4
mov dl, byte [eax + 1]
inc eax
test dl, dl
jne 0x40869b
xor edx, edx
xor esi, esi
cmp byte [edx], 0
je 0x4086dc
inc edx
jmp 0x4086d4
mov al, byte [esi]
test al, al
je 0x4086e8
mov byte [edx], al
inc edx
inc esi
jmp 0x4086dc
xor eax, eax
lea edx, [ebp - 0x124]
inc eax
mov dword [edx], eax
add edx, 4
cmp eax, 0xa
jl 0x4086f0
push 0xa
xor ecx, ecx
pop esi
xor edx, edx
push 1
pop edi
cmp dword [ebp + edx*4 - 0x124], 0
lea eax, [ebp + edx*4 - 0x124]
je 0x408717
inc ecx
cmp ecx, 3
jne 0x408722
and dword [eax], 0
dec esi
xor ecx, ecx
inc edx
cmp edx, 0xa
jne 0x40872a
xor edx, edx
cmp esi, edi
jg 0x408705
xor eax, eax
xor ecx, ecx
cmp byte [eax], 0
je 0x40873b
inc eax
inc ecx
jmp 0x408732
and dword [ebp - 0xc], 0
or dword [ebp - 0x40], 0xffffffff
mov dword [ebp - 4], edi
lea esi, [ebp - 0x40]
mov eax, dword [esi]
inc eax
cmp eax, 9
mov dword [esi], eax
jge 0x4087bd
xor edi, edi
cmp dword [ebp - 4], 1
jle 0x40876b
lea edx, [ebp - 0x40]
cmp dword [edx], eax
je 0x40876b
inc edi
add edx, 4
cmp edi, dword [ebp - 0xc]
jl 0x40875e
cmp edi, dword [ebp - 0xc]
jne 0x4087b4
cmp dword [ebp - 4], 9
jge 0x408784
inc dword [ebp - 0xc]
inc dword [ebp - 4]
add esi, 4
or dword [esi], 0xffffffff
jmp 0x4087bd
lea eax, [ebp - 0x40]
xor edi, edi
sub eax, 4
mov edx, dword [edi]
mov ebx, eax
mov dword [ebp - 8], 3
add eax, 0xc
mov ecx, dword [ebx + 4]
add ebx, 4
mov dword [edx], ecx
add edx, 4
dec dword [ebp - 8]
jne 0x40879a
add edi, 4
cmp edi, 0xc
jl 0x40878c
jmp 0x4087bd
dec dword [ebp - 0xc]
dec dword [ebp - 4]
sub esi, 4
cmp dword [ebp - 0x40], 9
jl 0x408749
push 2
xor eax, eax
pop edi
push 1
mov edx, edi
pop esi
push 4
pop ecx
test eax, eax
jge 0x4087e1
cmp edx, ecx
jge 0x4087f3
test eax, eax
jge 0x4087e1
add eax, 0x10
jmp 0x4087f7
cmp edx, ecx
jl 0x4087e9
sub edx, ecx
jmp 0x4087f7
lea ebx, [eax + edx]
cmp dword [ebp + ebx*4 - 0x5c], 0
je 0x4087f7
add eax, 8
dec edx
lea ebx, [eax + edx]
sub eax, ecx
mov dword [ebp + ebx*4 - 0x5c], esi
inc esi
inc edx
cmp esi, 0x10
jle 0x4087d0
push 3
pop esi
mov eax, esi
mov esi, edi
cdq
idiv edi
mov eax, esi
mov ebx, edx
cdq
idiv ebx
mov edi, ebx
test edx, edx
jne 0x40880a
push 1
pop eax
push 9
pop ecx
dec ecx
lea eax, [eax + eax + 2]
jne 0x408824
lea eax, [ebp + 8]
test eax, eax
jne 0x4088d3
mov eax, dword [eax]
push 0x20
pop esi
xor edx, edx
push 4
pop ecx
add edx, dword [eax]
add eax, ecx
dec esi
jne 0x408840
mov edi, ecx
mov eax, 0x80
mov edx, dword [edi]
push 0x20
xor esi, esi
pop ebx
add esi, dword [edx]
add edx, ecx
dec ebx
jne 0x408855
add edi, ecx
cmp edi, eax
jl 0x40884e
xor edi, edi
xor edx, edx
xor esi, esi
mov ebx, dword [esi]
add esi, ecx
add edx, dword [ebx + edi]
cmp esi, eax
jl 0x408868
add edi, ecx
cmp edi, eax
jl 0x408864
xor esi, esi
xor edx, edx
mov edi, dword [edx]
add esi, dword [edx + edi]
add edx, ecx
cmp edx, eax
jl 0x40887d
push 0x7c
xor edx, edx
xor esi, esi
pop edi
mov ebx, dword [edi]
sub edi, ecx
add edx, dword [ebx + esi]
add esi, ecx
cmp esi, eax
jl 0x40888f
mov ecx, dword [ebp + 8]
push 1
pop ebx
and dword [ebp - 8], 0
push 1
pop esi
cmp ebx, esi
jle 0x4088c8
lea edi, [ebp + ecx*4 - 0x1c]
mov eax, ebx
cdq
idiv esi
test edx, edx
jne 0x4088c3
add dword [ebp - 8], esi
mov dword [edi], esi
inc ecx
add edi, 4
inc esi
cmp esi, ebx
jl 0x4088b1
xor ecx, ecx
inc ebx
cmp ebx, 0x3e8
jle 0x4088a2
mov ebx, dword [ebp - 0x10]
xor edx, edx
lea eax, [ebx + 4]
mov byte [eax], dl
inc edx
inc eax
cmp dx, 0x100
jl 0x4088db
and byte [ebx + 0x104], 0
and byte [ebx + 0x105], 0
add ebx, 4
xor dl, dl
xor edi, edi
mov dword [ebp - 8], 0x100
mov eax, dword [ebp + 8]
mov cl, byte [ebx]
movzx esi, dl
movzx edx, byte [esi + eax]
movzx eax, cl
add edi, edx
add eax, edi
mov edi, 0x100
cdq
idiv edi
mov eax, dword [ebp - 0x10]
add eax, 4
movzx edi, dl
mov dl, byte [eax + edi]
add eax, edi
mov byte [ebx], dl
mov byte [eax], cl
lea eax, [esi + 1]
cdq
idiv dword [ebp + 0xc]
inc ebx
dec dword [ebp - 8]
jne 0x408902
mov eax, dword [ebp - 0x10]
pop edi
pop esi
pop ebx
leave
ret 8