Function at 0x4051c0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
sub esp, 0x1c
push ebx
push ebp
push esi
push edi
mov edi, ecx
lea eax, [esp + 0x30]
xor ebx, ebx
mov dword [esp + 0x1c], edi
test eax, eax
mov dword [edi], 0x40c45c
jne 0x405594
mov esi, 1
mov dword [esp + 0x24], ebx
lea ebp, [esp + 0x24]
cmp eax, ebx
je 0x405205
lea edx, [esp + 0x30]
dec edx
mov cl, byte [edx + esi]
cmp cl, byte [edx + eax]
je 0x405205
mov eax, dword [esp + eax*4 + 0x20]
jmp 0x405223
inc esi
add ebp, 4
lea edx, [esp + 0x30]
inc eax
dec edx
mov cl, byte [edx + esi]
cmp cl, byte [edx + eax]
je 0x40521c
mov dword [ebp], eax
jmp 0x405223
mov edx, dword [esp + eax*4 + 0x20]
mov dword [ebp], edx
cmp esi, 0xa
jl 0x4051ee
mov esi, 1
xor eax, eax
mov dword [esp + 0x24], ebx
lea ebp, [esp + 0x24]
cmp eax, ebx
je 0x40524e
lea edx, [esp + 0x30]
dec edx
mov cl, byte [edx + esi]
cmp cl, byte [edx + eax]
je 0x40524e
mov eax, dword [esp + eax*4 + 0x20]
jmp 0x40526c
inc esi
add ebp, 4
lea edx, [esp + 0x30]
inc eax
dec edx
mov cl, byte [edx + esi]
cmp cl, byte [edx + eax]
je 0x405265
mov dword [ebp], eax
jmp 0x40526c
mov edx, dword [esp + eax*4 + 0x20]
mov dword [ebp], edx
cmp esi, 0xa
jl 0x405237
mov esi, 1
xor eax, eax
mov dword [esp + 0x24], ebx
lea ebp, [esp + 0x24]
cmp eax, ebx
je 0x405297
lea edx, [esp + 0x30]
dec edx
mov cl, byte [edx + esi]
cmp cl, byte [edx + eax]
je 0x405297
mov eax, dword [esp + eax*4 + 0x20]
jmp 0x4052b5
inc esi
add ebp, 4
lea edx, [esp + 0x30]
inc eax
dec edx
mov cl, byte [edx + esi]
cmp cl, byte [edx + eax]
je 0x4052ae
mov dword [ebp], eax
jmp 0x4052b5
mov edx, dword [esp + eax*4 + 0x20]
mov dword [ebp], edx
cmp esi, 0xa
jl 0x405280
mov esi, 1
xor eax, eax
mov dword [esp + 0x24], ebx
lea ebp, [esp + 0x24]
cmp eax, ebx
je 0x4052e0
lea edx, [esp + 0x30]
dec edx
mov cl, byte [edx + esi]
cmp cl, byte [edx + eax]
je 0x4052e0
mov eax, dword [esp + eax*4 + 0x20]
jmp 0x4052fe
inc esi
add ebp, 4
lea edx, [esp + 0x30]
inc eax
dec edx
mov cl, byte [edx + esi]
cmp cl, byte [edx + eax]
je 0x4052f7
mov dword [ebp], eax
jmp 0x4052fe
mov edx, dword [esp + eax*4 + 0x20]
mov dword [ebp], edx
cmp esi, 0xa
jl 0x4052c9
mov esi, 1
xor eax, eax
mov dword [esp + 0x24], ebx
lea ebp, [esp + 0x24]
cmp eax, ebx
je 0x405329
lea edx, [esp + 0x30]
dec edx
mov cl, byte [edx + esi]
cmp cl, byte [edx + eax]
je 0x405329
mov eax, dword [esp + eax*4 + 0x20]
jmp 0x405347
inc esi
add ebp, 4
lea edx, [esp + 0x30]
inc eax
dec edx
mov cl, byte [edx + esi]
cmp cl, byte [edx + eax]
je 0x405340
mov dword [ebp], eax
jmp 0x405347
mov edx, dword [esp + eax*4 + 0x20]
mov dword [ebp], edx
cmp esi, 0xa
jl 0x405312
mov esi, 1
xor eax, eax
mov dword [esp + 0x24], ebx
lea ebp, [esp + 0x24]
cmp eax, ebx
je 0x405372
lea edx, [esp + 0x30]
dec edx
mov cl, byte [edx + esi]
cmp cl, byte [edx + eax]
je 0x405372
mov eax, dword [esp + eax*4 + 0x20]
jmp 0x405390
inc esi
add ebp, 4
lea edx, [esp + 0x30]
inc eax
dec edx
mov cl, byte [edx + esi]
cmp cl, byte [edx + eax]
je 0x405389
mov dword [ebp], eax
jmp 0x405390
mov edx, dword [esp + eax*4 + 0x20]
mov dword [ebp], edx
cmp esi, 0xa
jl 0x40535b
mov esi, 1
xor eax, eax
mov dword [esp + 0x24], ebx
lea ebp, [esp + 0x24]
cmp eax, ebx
je 0x4053bb
lea edx, [esp + 0x30]
dec edx
mov cl, byte [edx + esi]
cmp cl, byte [edx + eax]
je 0x4053bb
mov eax, dword [esp + eax*4 + 0x20]
jmp 0x4053d9
inc esi
add ebp, 4
lea edx, [esp + 0x30]
inc eax
dec edx
mov cl, byte [edx + esi]
cmp cl, byte [edx + eax]
je 0x4053d2
mov dword [ebp], eax
jmp 0x4053d9
mov edx, dword [esp + eax*4 + 0x20]
mov dword [ebp], edx
cmp esi, 0xa
jl 0x4053a4
mov esi, 1
xor eax, eax
mov dword [esp + 0x24], ebx
lea ebp, [esp + 0x24]
cmp eax, ebx
je 0x405404
lea edx, [esp + 0x30]
dec edx
mov cl, byte [edx + esi]
cmp cl, byte [edx + eax]
je 0x405404
mov eax, dword [esp + eax*4 + 0x20]
jmp 0x405422
inc esi
add ebp, 4
lea edx, [esp + 0x30]
inc eax
dec edx
mov cl, byte [edx + esi]
cmp cl, byte [edx + eax]
je 0x40541b
mov dword [ebp], eax
jmp 0x405422
mov edx, dword [esp + eax*4 + 0x20]
mov dword [ebp], edx
cmp esi, 0xa
jl 0x4053ed
mov esi, 1
xor eax, eax
mov dword [esp + 0x24], ebx
lea ebp, [esp + 0x24]
cmp eax, ebx
je 0x40544d
lea edx, [esp + 0x30]
dec edx
mov cl, byte [edx + esi]
cmp cl, byte [edx + eax]
je 0x40544d
mov eax, dword [esp + eax*4 + 0x20]
jmp 0x40546b
inc esi
add ebp, 4
lea edx, [esp + 0x30]
inc eax
dec edx
mov cl, byte [edx + esi]
cmp cl, byte [edx + eax]
je 0x405464
mov dword [ebp], eax
jmp 0x40546b
mov edx, dword [esp + eax*4 + 0x20]
mov dword [ebp], edx
cmp esi, 0xa
jl 0x405436
mov esi, 1
xor eax, eax
mov dword [esp + 0x24], ebx
lea ebp, [esp + 0x24]
cmp eax, ebx
je 0x405496
lea edx, [esp + 0x30]
dec edx
mov cl, byte [edx + esi]
cmp cl, byte [edx + eax]
je 0x405496
mov eax, dword [esp + eax*4 + 0x20]
jmp 0x4054b4
inc esi
add ebp, 4
lea edx, [esp + 0x30]
inc eax
dec edx
mov cl, byte [edx + esi]
cmp cl, byte [edx + eax]
je 0x4054ad
mov dword [ebp], eax
jmp 0x4054b4
mov edx, dword [esp + eax*4 + 0x20]
mov dword [ebp], edx
cmp esi, 0xa
jl 0x40547f
mov esi, 1
xor eax, eax
mov dword [esp + 0x24], ebx
lea ebp, [esp + 0x24]
cmp eax, ebx
je 0x4054df
lea edx, [esp + 0x30]
dec edx
mov cl, byte [edx + esi]
cmp cl, byte [edx + eax]
je 0x4054df
mov eax, dword [esp + eax*4 + 0x20]
jmp 0x4054fd
inc esi
add ebp, 4
lea edx, [esp + 0x30]
inc eax
dec edx
mov cl, byte [edx + esi]
cmp cl, byte [edx + eax]
je 0x4054f6
mov dword [ebp], eax
jmp 0x4054fd
mov edx, dword [esp + eax*4 + 0x20]
mov dword [ebp], edx
cmp esi, 0xa
jl 0x4054c8
mov esi, 1
xor eax, eax
mov dword [esp + 0x24], ebx
lea ebp, [esp + 0x24]
cmp eax, ebx
je 0x405528
lea edx, [esp + 0x30]
dec edx
mov cl, byte [edx + esi]
cmp cl, byte [edx + eax]
je 0x405528
mov eax, dword [esp + eax*4 + 0x20]
jmp 0x405546
inc esi
add ebp, 4
lea edx, [esp + 0x30]
inc eax
dec edx
mov cl, byte [edx + esi]
cmp cl, byte [edx + eax]
je 0x40553f
mov dword [ebp], eax
jmp 0x405546
mov edx, dword [esp + eax*4 + 0x20]
mov dword [ebp], edx
cmp esi, 0xa
jl 0x405511
mov esi, 1
xor eax, eax
mov dword [esp + 0x24], ebx
lea ebp, [esp + 0x24]
cmp eax, ebx
je 0x405571
lea edx, [esp + 0x30]
dec edx
mov cl, byte [edx + esi]
cmp cl, byte [edx + eax]
je 0x405571
mov eax, dword [esp + eax*4 + 0x20]
jmp 0x40558f
inc esi
add ebp, 4
lea edx, [esp + 0x30]
inc eax
dec edx
mov cl, byte [edx + esi]
cmp cl, byte [edx + eax]
je 0x405588
mov dword [ebp], eax
jmp 0x40558f
mov edx, dword [esp + eax*4 + 0x20]
mov dword [ebp], edx
cmp esi, 0xa
jl 0x40555a
add edi, 4
xor eax, eax
mov ecx, edi
mov byte [ecx], al
inc eax
inc ecx
cmp ax, 0x100
jl 0x40559b
mov byte [edi + 0x100], bl
mov byte [edi + 0x101], bl
mov byte [esp + 0x10], bl
xor esi, esi
mov ebx, edi
mov dword [esp + 0x14], 0x100
mov eax, dword [esp + 0x10]
mov ebp, dword [esp + 0x30]
mov cl, byte [ebx]
and eax, 0xff
xor edx, edx
mov dl, byte [eax + ebp]
mov ebp, ecx
and ebp, 0xff
add esi, edx
add ebp, esi
mov edx, ebp
and edx, 0x800000ff
jns 0x4055f3
dec edx
or edx, 0xffffff00
inc edx
mov byte [esp + 0x18], dl
mov esi, dword [esp + 0x18]
and esi, 0xff
inc eax
mov dl, byte [esi + edi]
mov byte [ebx], dl
mov byte [esi + edi], cl
cdq
idiv dword [esp + 0x34]
mov eax, dword [esp + 0x14]
inc ebx
dec eax
mov dword [esp + 0x14], eax
mov byte [esp + 0x10], dl
jne 0x4055c1
mov eax, dword [esp + 0x1c]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret 8