Function at 0x402780
Capabilities:
Encrypt data using rc4 prga

Disassembly:
sub esp, 8
cmp dword [esp + 0x10], 0
mov eax, dword [esp + 0x14]
mov cl, byte [eax]
mov dl, byte [eax + 1]
mov dword [esp + 4], 0
jle 0x4029cd
push ebx
push ebp
push esi
push edi
movzx ebp, cl
movzx ebx, dl
lea esp, [esp]
lea eax, [ebp + 1]
cdq
mov ecx, 0x143
idiv ecx
mov esi, dword [0x4333d8]
mov edi, 0x143
movzx ebp, dl
movzx eax, byte [esi + ebp]
lea ecx, [esi + ebp]
add eax, ebx
mov byte [esp + 0x12], dl
cdq
idiv edi
movzx ebx, dl
lea eax, [ebx + esi]
mov byte [esp + 0x13], dl
call fcn.00401680
mov ecx, dword [0x4333d8]
movzx edx, byte [ecx + ebp]
movzx eax, byte [ebx + ecx]
add eax, edx
cdq
mov ecx, edi
idiv ecx
push 0x428631
push 0x435da0
mov byte [esp + 0x19], dl
call fcn.00402440
add esp, 8
mov esi, eax
push 0xa
mov ecx, esi
call fcn.00402650
mov edx, dword [esi]
mov eax, dword [edx + 4]
add eax, esi
xor edi, edi
test byte [eax + 8], 6
jne 0x402843
mov eax, dword [eax + 0x28]
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0x30]
call eax
cmp eax, 0xffffffff
jne 0x402843
mov edi, 4
mov ecx, dword [esi]
mov ecx, dword [ecx + 4]
add ecx, esi
test edi, edi
je 0x402864
mov eax, dword [ecx + 8]
or eax, edi
cmp dword [ecx + 0x28], 0
jne 0x40285c
or eax, 4
push 0
push eax
call fcn.004020a0
push 0x428631
push 0x435da0
call fcn.00402440
add esp, 8
mov esi, eax
push 0xa
mov ecx, esi
call fcn.00402650
mov edx, dword [esi]
mov eax, dword [edx + 4]
add eax, esi
xor edi, edi
test byte [eax + 8], 6
jne 0x4028a6
mov eax, dword [eax + 0x28]
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0x30]
call eax
cmp eax, 0xffffffff
jne 0x4028a6
mov edi, 4
mov ecx, dword [esi]
mov ecx, dword [ecx + 4]
add ecx, esi
test edi, edi
je 0x4028c7
mov eax, dword [ecx + 8]
or eax, edi
cmp dword [ecx + 0x28], 0
jne 0x4028bf
or eax, 4
push 0
push eax
call fcn.004020a0
push 0x428631
push 0x435da0
call fcn.00402440
add esp, 8
mov esi, eax
push 0xa
mov ecx, esi
call fcn.00402650
mov edx, dword [esi]
mov eax, dword [edx + 4]
add eax, esi
xor edi, edi
test byte [eax + 8], 6
jne 0x402909
mov eax, dword [eax + 0x28]
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0x30]
call eax
cmp eax, 0xffffffff
jne 0x402909
mov edi, 4
mov ecx, dword [esi]
mov ecx, dword [ecx + 4]
add ecx, esi
test edi, edi
je 0x40292a
mov eax, dword [ecx + 8]
or eax, edi
cmp dword [ecx + 0x28], 0
jne 0x402922
or eax, 4
push 0
push eax
call fcn.004020a0
push 0x428631
push 0x435da0
call fcn.00402440
add esp, 8
mov esi, eax
push 0xa
mov ecx, esi
call fcn.00402650
mov edx, dword [esi]
mov eax, dword [edx + 4]
add eax, esi
xor edi, edi
test byte [eax + 8], 6
jne 0x40296c
mov eax, dword [eax + 0x28]
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0x30]
call eax
cmp eax, 0xffffffff
jne 0x40296c
mov edi, 4
mov ecx, dword [esi]
mov ecx, dword [ecx + 4]
add ecx, esi
test edi, edi
je 0x40298d
mov eax, dword [ecx + 8]
or eax, edi
cmp dword [ecx + 0x28], 0
jne 0x402985
or eax, 4
push 0
push eax
call fcn.004020a0
movzx edx, byte [esp + 0x11]
mov eax, dword [0x4333d8]
mov cl, byte [edx + eax]
mov eax, dword [esp + 0x14]
mov esi, dword [esp + 0x1c]
xor byte [eax + esi], cl
inc eax
cmp eax, dword [esp + 0x20]
mov dword [esp + 0x14], eax
jl 0x4027b0
mov eax, dword [esp + 0x24]
mov dl, byte [esp + 0x12]
mov cl, byte [esp + 0x13]
pop edi
pop esi
pop ebp
mov byte [eax], dl
mov byte [eax + 1], cl
pop ebx
add esp, 8
ret
mov byte [eax], cl
mov byte [eax + 1], dl
add esp, 8
ret