Function at 0x402170
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x1c
mov edi, dword [ecx]
xor eax, eax
cmp byte [edi], 0x22
jne 0x402438
mov esi, edi
jmp 0x40219f
lea esi, [ebx + 2]
mov dword [ecx], esi
cmp byte [ebx + 2], 0
je 0x402438
mov ebx, esi
inc esi
mov dword [ecx], esi
movzx ebp, byte [ebx + 1]
cmp ebp, 0x5c
je 0x402190
test ebp, ebp
je 0x402438
cmp ebp, 0x22
jne 0x40219f
mov dword [esp + 0xc], edx
add ebx, 2
mov dword [ecx], ebx
sub ebx, edi
mov ebp, ebx
xor ebp, 2
add ebx, ebx
and ebx, 0xfffffffa
mov eax, ebx
sub eax, ebp
mov dword [esp + 0x10], eax
inc eax
push eax
call dword [0x441004]
add esp, 4
mov edx, eax
test eax, eax
je case.0x402227.35
mov esi, edx
cmp ebx, ebp
je 0x4023ec
movzx eax, byte [edi + 1]
mov esi, edx
test al, al
je 0x4023ec
inc edi
mov esi, edx
mov ebp, edi
mov dword [esp], edx
nop
nop
nop
nop
cmp al, 0x5c
jne 0x402240
movzx eax, byte [ebp + 1]
add eax, 0xffffffde
cmp eax, 0x53
ja case.0x402227.35
lea ebx, [ebp + 1]
jmp dword [eax*4 + 0x43e6bc]
mov byte [esi], 0x22
jmp 0x40224c
cmp al, 0x20
jb case.0x402227.35
mov byte [esi], al
mov ebx, ebp
inc esi
movzx eax, byte [ebx + 1]
test al, al
je 0x4023ec
inc ebx
mov ecx, ebx
sub ecx, edi
mov ebp, ebx
cmp ecx, dword [esp + 0x10]
jb 0x402210
jmp 0x4023ec
mov byte [esi], 0xa
jmp 0x40224c
mov byte [esi], 0x2f
jmp 0x40224c
mov byte [esi], 8
jmp 0x40224c
lea ecx, [ebp + 2]
lea edx, [esp + 0x18]
call fcn.00402440
test eax, eax
jne 0x402429
mov ecx, dword [esp + 0x18]
cmp ecx, 0x7f
ja 0x4022bc
mov byte [esi], cl
mov eax, 1
add ebx, eax
add ebx, 3
mov edx, dword [esp]
jmp 0x40224c
mov byte [esi], 0x5c
jmp 0x40224c
mov byte [esi], 0xd
jmp 0x40224c
mov byte [esi], 0xc
jmp 0x40224c
mov byte [esi], 9
jmp 0x40224c
cmp ecx, 0x7ff
mov edx, dword [esp]
ja 0x4022dc
mov eax, ecx
shr eax, 6
or al, 0xc0
mov byte [esi], al
and cl, 0x3f
or cl, 0x80
mov byte [esi + 1], cl
inc esi
jmp 0x402315
lea eax, [ecx - 0xe000]
cmp eax, 0xfffff7ff
ja 0x402324
mov ebp, ecx
shr ecx, 0xc
mov eax, ecx
not eax
or eax, 0xf
add eax, ecx
inc al
or al, 0xe0
mov byte [esi], al
mov eax, ebp
shr eax, 6
and al, 0x3f
or al, 0x80
mov byte [esi + 1], al
mov eax, ebp
and al, 0x3f
or al, 0x80
mov byte [esi + 2], al
add esi, 2
mov eax, 1
add ebx, eax
add ebx, 3
jmp 0x40224c
cmp ecx, 0xdbff
ja 0x402429
cmp byte [ebp + 6], 0x5c
jne 0x402429
cmp byte [ebp + 7], 0x75
jne 0x402429
add ebp, 8
mov dword [esp + 8], ecx
mov ecx, ebp
lea edx, [esp + 0x14]
call fcn.00402440
mov ecx, dword [esp + 8]
test eax, eax
jne 0x402429
mov eax, dword [esp + 0x14]
cmp eax, 0xdc00
jb 0x402429
cmp eax, 0xdfff
ja 0x402429
mov edx, 0x3ff
sub edx, ecx
not edx
or edx, ecx
and edx, 0x3ff
shl edx, 0xa
mov ebp, eax
mov dword [esp + 4], eax
and ebp, 0x3ff
lea ecx, [edx + ebp]
lea eax, [edx + ebp]
add eax, 0x10000
mov edx, eax
shr edx, 0x12
or dl, 0xf0
mov byte [esi], dl
shr eax, 0xc
and al, 0x3f
or al, 0x80
mov byte [esi + 1], al
shr ecx, 6
and cl, 0x3f
or cl, 0x80
mov byte [esi + 2], cl
mov ecx, 0x7f
mov eax, dword [esp + 4]
sub ecx, eax
or ecx, 0x3f
add ecx, eax
inc cl
or cl, 0x80
mov byte [esi + 3], cl
add esi, 3
mov eax, 7
jmp 0x40229e
mov byte [esi], 0
sub esi, edx
lea edi, [esi + 1]
push edi
mov ebx, edx
call dword [0x441004]
mov edx, ebx
add esp, 4
test eax, eax
je case.0x402227.35
push edi
push edx
push eax
mov edi, eax
mov ebx, edx
call fcn.004081e0
add esp, 0xc
mov eax, dword [esp + 0xc]
mov dword [eax], esi
push ebx
call dword [section..data]
add esp, 4
mov eax, edi
jmp 0x402438
mov edx, dword [esp]
push edx
call dword [section..data]
add esp, 4
xor eax, eax
add esp, 0x1c
pop esi
pop edi
pop ebx
pop ebp
ret