Function at 0x40a020
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4507d8
mov eax, dword fs:[0]
push eax
sub esp, 0x34
mov eax, dword [0x46b070]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, dword [ebp + 0x14]
xor ecx, ecx
mov edi, dword [ebp + 8]
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x30], edi
movzx esi, word [ebx]
mov dword [ebp - 0x40], eax
test si, si
je 0x40a090
mov edi, dword [ebp + 0x10]
mov edx, esi
nop dword [eax]
cmp dx, si
lea eax, [edi + 1]
movzx edx, word [ebx + ecx*2 + 2]
lea ecx, [ecx + 1]
cmovne eax, edi
mov edi, eax
test dx, dx
jne 0x40a070
mov dword [ebp - 0x3c], edi
mov edi, dword [ebp - 0x30]
jmp 0x40a096
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x3c], eax
push 0
push eax
lea ecx, [ebp - 0x28]
mov dword [ebp - 0x14], 0xf
mov dword [ebp - 0x18], 0
mov byte [ebp - 0x28], 0
call fcn.0040c7b0
mov dword [ebp - 4], 0
mov eax, 0xfffffffe
mov dword [ebp - 0x34], 1
xor edx, edx
mov dword [ebp - 0x38], eax
xor esi, esi
mov byte [ebp - 0x29], 0
mov dword [ebp - 0x30], edx
cmp dword [ebp - 0x3c], edx
jbe 0x40a27f
nop dword [eax]
movzx eax, word [ebx + esi*2]
test ax, ax
je 0x40a100
movzx ecx, word [ebx]
nop dword [eax]
cmp ax, cx
je 0x40a100
movzx eax, word [ebx + esi*2 + 2]
inc esi
test ax, ax
jne 0x40a0f0
mov ecx, dword [ebp - 0x14]
lea eax, [ebp - 0x28]
cmp ecx, 0x10
cmovae eax, dword [ebp - 0x28]
cmp byte [eax + edx], 0
je 0x40a12b
cmp ecx, 0x10
lea eax, [ebp - 0x28]
cmovae eax, dword [ebp - 0x28]
movsx eax, byte [eax + edx]
add esi, eax
mov eax, dword [ebp - 0x38]
jmp 0x40a1fe
add esi, dword [ebp - 0x34]
movzx eax, word [ebx + esi*2]
cmp ax, word [ebx]
je 0x40a1d8
test ax, ax
je 0x40a1d8
push dword [ebp - 0x40]
mov ecx, edi
call fcn.0040a560
test al, al
jne 0x40a1af
cmp byte [edi + 4], al
jne 0x40a198
mov ecx, dword [edi]
test ecx, ecx
je 0x40a18e
mov eax, dword [ecx + 0x1c]
mov edx, dword [eax]
test edx, edx
je 0x40a173
mov eax, dword [ecx + 0x2c]
cmp dword [eax], 0
jle 0x40a173
movzx eax, word [edx]
jmp 0x40a17b
mov eax, dword [ecx]
call dword [eax + 0x18]
movzx eax, ax
movzx eax, ax
mov ecx, 0xffff
cmp cx, ax
je 0x40a18e
mov word [edi + 6], ax
jmp 0x40a194
mov dword [edi], 0
mov byte [edi + 4], 1
mov ax, word [ebx + esi*2]
cmp ax, word [edi + 6]
jne 0x40a1af
mov edx, dword [ebp - 0x30]
mov cl, 1
mov eax, dword [ebp - 0x38]
mov byte [ebp - 0x29], cl
jmp 0x40a201
cmp dword [ebp - 0x14], 0x10
lea edx, [ebp - 0x28]
mov eax, dword [ebp - 0x34]
mov ecx, 0x7f
cmovae edx, dword [ebp - 0x28]
cmp dword [ebp - 0x34], ecx
movzx eax, al
cmovb ecx, eax
mov eax, dword [ebp - 0x30]
mov byte [edx + eax], cl
mov edx, eax
mov eax, dword [ebp - 0x38]
jmp 0x40a1fe
mov eax, dword [ebp - 0x34]
lea edx, [ebp - 0x28]
cmp ecx, 0x10
movzx eax, al
mov ecx, 0x7f
cmovae edx, dword [ebp - 0x28]
cmp dword [ebp - 0x34], ecx
cmovb ecx, eax
mov eax, dword [ebp - 0x30]
mov dword [ebp - 0x38], eax
mov byte [edx + eax], cl
mov edx, eax
mov cl, byte [ebp - 0x29]
inc edx
mov dword [ebp - 0x30], edx
cmp edx, dword [ebp - 0x3c]
jb 0x40a0e0
test cl, cl
je 0x40a27f
push dword [ebp - 0x40]
mov ecx, edi
call fcn.0040a560
test al, al
jne 0x40a27c
inc dword [ebp - 0x34]
mov ecx, dword [edi]
test ecx, ecx
je 0x40a26a
mov eax, dword [ecx + 0x1c]
cmp dword [eax], 0
je 0x40a24c
mov edx, dword [ecx + 0x2c]
mov eax, dword [edx]
test eax, eax
jle 0x40a24c
dec eax
mov dword [edx], eax
mov ecx, dword [ecx + 0x1c]
mov edx, dword [ecx]
lea eax, [edx + 2]
mov dword [ecx], eax
movzx eax, word [edx]
jmp 0x40a254
mov eax, dword [ecx]
call dword [eax + 0x1c]
movzx eax, ax
mov ecx, 0xffff
cmp cx, ax
je 0x40a26a
mov byte [edi + 4], 0
or eax, 0xffffffff
jmp 0x40a0c6
mov dword [edi], 0
or eax, 0xffffffff
mov byte [edi + 4], 1
jmp 0x40a0c6
mov eax, dword [ebp - 0x38]
mov ecx, dword [ebp - 0x14]
cmp ecx, 0x10
jb 0x40a297
inc ecx
push ecx
push dword [ebp - 0x28]
lea ecx, [ebp - 0x28]
call fcn.0040d330
mov eax, dword [ebp - 0x38]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004330a2
mov esp, ebp
pop ebp
ret