Function at 0x402830
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
mov eax, dword [0x4720c8]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x18]
push ebx
mov ebx, dword [ebp + 8]
push edi
mov edi, dword [eax + 4]
mov dword [ebp - 0x2c], ebx
test edi, edi
jns 0x402880
cmp dword [eax], 0
jg 0x402880
push dword [ebp + 0xc]
mov ecx, dword [ebp + 0x14]
mov edx, dword [ebp + 0x10]
add ecx, edx
push ecx
push edx
call fcn.00401280
add esp, 0xc
mov dword [ebx], edx
mov eax, ebx
pop edi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00424555
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 0x10]
lea edx, [ebp - 0xc]
mov ecx, dword [ebp + 0x14]
push esi
add ecx, eax
mov dword [ebp - 8], 0
push edx
push ecx
push eax
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x10], 0
mov dword [ebp - 0xc], 0
call fcn.0040cce0
mov ebx, dword [ebp - 0x18]
add esp, 0xc
xor esi, esi
mov dword [ebp - 0x10], eax
mov byte [ebp - 8], 0
cmp ebx, dword [ebp - 0x14]
je 0x40291f
mov dword [ebp - 0x20], esi
cmp esi, edi
jne 0x4028d1
test edi, edi
jns 0x40291f
mov edx, dword [ebp - 0xc]
mov ecx, 1
mov eax, 0x4479c0
nop
cmp edx, dword [eax]
jb 0x4028f6
add eax, 4
xor ecx, 3
cmp eax, 0x447a30
jne 0x4028e0
mov ecx, 1
mov eax, 0x7fffffff
sub eax, ecx
cmp eax, esi
jl 0x402987
add esi, ecx
cmp esi, edi
jle 0x40290f
test edi, edi
jns 0x402982
lea ecx, [ebp - 0x18]
call fcn.0040b750
mov ebx, dword [ebp - 0x18]
cmp ebx, dword [ebp - 0x14]
jne 0x4028c6
mov dword [ebp - 0x24], ebx
mov eax, dword [ebp + 0x10]
xor edi, edi
mov ecx, dword [ebp + 0xc]
xor ebx, ebx
mov dword [ebp - 0x28], eax
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x1c], 1
mov dword [ebp - 0x20], edi
mov al, byte [eax + 9]
test al, al
movzx edx, al
cmove edx, dword [ebp - 0x1c]
mov dword [ebp - 0x1c], edx
mov edx, dword [ebp + 0x18]
mov edx, dword [edx]
cmp esi, edx
jge 0x402996
mov eax, dword [ebp - 0x1c]
movzx eax, al
sub eax, 1
je 0x4029ca
sub eax, 1
je 0x402992
sub eax, 1
jne 0x402996
mov eax, edx
sub eax, esi
cdq
sub eax, edx
mov ebx, eax
mov eax, dword [ebp + 0x18]
sar ebx, 1
mov edi, dword [eax]
sub edi, ebx
sub edi, esi
mov dword [ebp - 0x20], edi
jmp 0x402999
mov esi, dword [ebp - 0x20]
jmp 0x40291f
test edi, edi
jns 0x40291f
mov esi, 0x7fffffff
jmp 0x402922
mov ebx, edx
sub ebx, esi
mov eax, dword [ebp + 0x18]
lea esi, [eax + 0xf]
movzx eax, byte [eax + 0xe]
mov edx, esi
test ebx, ebx
jle 0x4029da
lea edi, [esi + eax]
mov dword [ebp - 0x1c], edi
nop dword [eax]
push ecx
push edi
push esi
call fcn.00401280
dec ebx
add esp, 0xc
mov ecx, edx
test ebx, ebx
jg 0x4029b0
mov edi, dword [ebp - 0x20]
mov ebx, dword [ebp - 0x1c]
jmp 0x4029dd
mov eax, dword [ebp + 0x18]
mov edi, edx
sub edi, esi
lea esi, [eax + 0xf]
movzx eax, byte [eax + 0xe]
mov edx, esi
lea ebx, [eax + edx]
mov eax, dword [ebp - 0x28]
mov edx, dword [ebp - 0x24]
sub edx, eax
push ecx
add edx, eax
push edx
push eax
call fcn.00401280
add esp, 0xc
test edi, edi
jle 0x402a06
push edx
push ebx
push esi
call fcn.00401280
dec edi
add esp, 0xc
test edi, edi
jg 0x4029f6
mov eax, dword [ebp - 0x2c]
mov ecx, dword [ebp - 4]
pop esi
pop edi
xor ecx, ebp
mov dword [eax], edx
pop ebx
call fcn.00424555
mov esp, ebp
pop ebp
ret