Function at 0x402270
Capabilities:
Encrypt data using rc4 prga

Disassembly:
sub esp, 0x50
mov ecx, dword [0x4db04c]
push ebx
push ebp
push esi
push edi
mov eax, 5
call fcn.00413720
mov ebp, eax
mov eax, dword [0x4db04c]
push 6
push eax
mov dword [esp + 0x18], ebp
call dword [0x457380]
mov edi, dword [0x4572c4]
push 0
push 0
mov esi, eax
push 0x1004
push esi
call edi
push 0
push 0
push 0xb
push esi
mov ebx, eax
mov dword [esp + 0x34], 1
call edi
mov ecx, dword [0x4b9de8]
lea edx, [ebp + ecx*8]
movzx ebp, word [edx*2 + 0x4a4a38]
cmp ebx, ebp
jbe 0x4022f1
lea eax, [ebp - 1]
cmp eax, ebx
jae 0x402325
sub ebx, eax
push 0
push ebp
push 0x1008
push esi
call edi
dec ebx
jne 0x4022e1
jmp 0x402325
xor eax, eax
mov dword [esp + 0x28], 0x7fffffff
mov dword [esp + 0x2c], eax
mov dword [esp + 0x38], eax
cmp ebx, ebp
jae 0x402325
mov eax, ebp
sub eax, ebx
mov dword [esp + 0x14], eax
nop
lea eax, [esp + 0x24]
push eax
push 0
push 0x104d
push esi
call edi
dec dword [esp + 0x14]
jne 0x402310
xor ebx, ebx
mov dword [esp + 0x14], ebx
test ebp, ebp
je 0x40243b
jmp 0x402340
mov ecx, dword [esp + 0x10]
mov eax, dword [ecx*4 + 0x4d3210]
or dword [esp + 0x24], 4
xor edx, edx
lea ecx, [eax + ebx*4]
mov dword [esp + 0x28], ebx
mov dword [esp + 0x2c], edx
movzx eax, word [ecx]
mov dword [esp + 0x44], eax
cmp eax, edx
je 0x4023c0
mov edx, dword [0x4b9de8]
movzx edx, word [edx*2 + 0x4a0458]
xor eax, eax
test edx, edx
je 0x4023a1
movzx ebx, word [ecx]
mov ecx, dword [0x4b9de8]
mov ecx, dword [ecx*4 + 0x4b9dcc]
lea esp, [esp]
cmp word [ecx], bx
je 0x4023f1
inc eax
add ecx, 2
cmp eax, edx
jb 0x402390
mov ebx, dword [esp + 0x14]
or eax, 0xffffffff
mov ecx, dword [0x4b9de8]
lea edx, [ecx + ecx*2]
mov ecx, dword [0x52bbd0]
lea edx, [ecx + edx*2]
mov ecx, dword [edx*4 + 0x4d3198]
mov edx, dword [ecx + eax*4]
lea eax, [esp + 0x24]
push eax
push 0
push 0x104c
push esi
mov dword [esp + 0x48], edx
call edi
xor dword [esp + 0x24], 4
cmp dword [esp + 0x44], 0
mov dword [esp + 0x2c], 1
jne 0x4023f7
mov dword [esp + 0x38], 0
jmp 0x40241f
mov ebx, dword [esp + 0x14]
jmp 0x4023a4
mov edx, dword [esp + 0x10]
mov eax, dword [edx*4 + 0x4d3210]
push 0xa
lea ecx, [esp + 0x1c]
push ecx
movzx ecx, word [eax + ebx*4 + 2]
push ecx
call fcn.004497d4
lea edx, [esp + 0x24]
add esp, 0xc
mov dword [esp + 0x38], edx
lea eax, [esp + 0x24]
push eax
push 0
push 0x104c
push esi
call edi
inc ebx
mov dword [esp + 0x14], ebx
cmp ebx, ebp
jb 0x402340
push 0
push 1
push 0xb
push esi
call edi
push 0xfffffffffffffffe
push 1
push 0x101e
push esi
call edi
push 0
push 0
push 0x1027
push esi
call edi
xor esi, esi
mov ebx, eax
cmp ebp, 0xe
jae 0x4024ce
test ebp, ebp
je 0x4024a8
lea esp, [esp]
mov ecx, dword [esp + 0x10]
mov edx, dword [ecx*4 + 0x4d3230]
mov ecx, dword [esi*4 + 0x4de374]
add edx, esi
movzx eax, byte [edx + ebx]
push 0
push eax
push 0xf1
push ecx
call edi
mov edx, dword [esi*4 + 0x4de374]
push 8
push edx
call dword [0x45738c]
inc esi
cmp esi, ebp
jb 0x402470
mov esi, ebp
lea ebx, [ebx]
mov eax, dword [esi*4 + 0x4de374]
push 0
push eax
call dword [0x45738c]
inc esi
cmp esi, 0xe
jb 0x4024b0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x50
ret
mov ebp, dword [0x45738c]
mov ecx, dword [esp + 0x10]
mov edx, dword [ecx*4 + 0x4d3230]
mov ecx, dword [esi*4 + 0x4de374]
add edx, esi
movzx eax, byte [edx + ebx]
push 0
push eax
push 0xf1
push ecx
call edi
mov edx, dword [esi*4 + 0x4de374]
push 8
push edx
call ebp
inc esi
cmp esi, 0xe
jb 0x4024d4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x50
ret