Function at 0x407fb0
Capabilities:
Encode data using xor
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x528
mov edx, dword [ebp + 8]
push ebx
push esi
push edi
test edx, edx
jle 0x40823d
cmp edx, 3
jg 0x40823d
mov esi, dword [ebp + 0x10]
mov ecx, 0x145
xor eax, eax
lea edi, [ebp - 0x528]
rep stosd dword es:[edi], eax
lea eax, [esi + esi]
lea ecx, [esi + esi*2]
mov dword [ebp - 0x520], eax
mov al, byte [ebp + 0x24]
mov byte [ebp - 0x418], al
mov eax, dword [ebp + 0x28]
mov byte [ebp - 0x417], al
and eax, 0xff
mov bl, al
mov dword [ebp - 0xc], eax
mov bh, bl
mov dword [ebp - 0x51c], ecx
mov eax, ebx
mov ecx, 0x40
shl eax, 0x10
lea edi, [ebp - 0x518]
mov ax, bx
mov dword [ebp - 0x524], esi
mov edx, dword [edx*4 + 0x498c3c]
rep stosd dword es:[edi], eax
mov cl, byte [ebp + 0x24]
mov eax, dword [0x498c3c]
mov byte [ebp - 0x518], cl
mov ecx, 0x100
lea edi, [ebp - 0x414]
mov dword [ebp + 0x10], esi
rep stosd dword es:[edi], eax
mov eax, dword [ebp + 0x1c]
mov dword [ebp - 0x414], edx
cmp esi, eax
jl 0x408062
mov dword [ebp + 0x10], eax
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp + 0x20]
cmp eax, ecx
mov dword [ebp + 0x20], eax
jl 0x408072
mov dword [ebp + 0x20], ecx
mov edx, dword [ebp + 0x10]
mov eax, dword [ebp + 0x20]
lea ebx, [edx + 0xa]
lea esi, [eax + 0xa]
imul esi, ebx
cmp esi, 0x80000
mov dword [ebp - 0x10], esi
jle 0x40809a
push esi
call fcn.00489704
add esp, 4
mov dword [ebp + 0x14], eax
jmp 0x4080a9
mov eax, esi
add eax, 3
and al, 0xfc
call fcn.00453a70
mov dword [ebp + 0x14], esp
mov eax, dword [ebp + 0x24]
mov dword [ebp - 4], ebx
and eax, 0xff
mov edi, dword [ebp + 0x14]
mov bl, al
mov dword [ebp - 0x14], eax
mov bh, bl
mov ecx, esi
mov eax, ebx
mov edx, ecx
shl eax, 0x10
mov ax, bx
mov ebx, dword [ebp - 4]
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov ecx, dword [ebp + 0x20]
test ecx, ecx
jle 0x408120
mov eax, dword [ebp + 0x10]
mov edx, dword [ebp + 0x14]
mov esi, dword [ebp + 0x18]
add eax, 0xb
mov dword [ebp - 8], esi
mov dword [ebp - 4], ecx
lea edx, [edx + eax*4]
add eax, edx
mov ecx, dword [ebp + 0x10]
mov edi, eax
mov edx, ecx
add eax, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov edx, dword [ebp + 0x1c]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [ebp - 8]
mov ecx, dword [ebp - 4]
add esi, edx
dec ecx
mov dword [ebp - 8], esi
mov dword [ebp - 4], ecx
jne 0x4080f7
mov eax, dword [ebp + 8]
lea edx, [ebx + ebx*2]
mov dword [ebp - 0x51c], edx
lea ecx, [ebx + ebx]
mov esi, dword [eax*4 + 0x498c3c]
mov al, byte [ebp + 0x24]
mov byte [ebp - 0x418], al
mov al, byte [ebp - 0xc]
mov dl, al
mov dword [ebp - 0x520], ecx
mov cl, byte [ebp + 0x28]
mov dh, dl
mov eax, edx
mov byte [ebp - 0x417], cl
shl eax, 0x10
mov ecx, 0x40
lea edi, [ebp - 0x518]
mov ax, dx
mov edx, dword [ebp + 0x20]
mov dword [ebp - 0x524], ebx
rep stosd dword es:[edi], eax
mov al, byte [ebp + 0x24]
mov ecx, 0x100
mov byte [ebp - 0x518], al
mov eax, dword [0x498c3c]
lea edi, [ebp - 0x414]
rep stosd dword es:[edi], eax
test edx, edx
mov dword [ebp - 0x414], esi
jle 0x408214
mov ecx, dword [ebp + 0x10]
mov edi, dword [ebp + 0x14]
mov esi, dword [ebp + 0x18]
mov dword [ebp + 0x18], edx
lea eax, [ecx + 0xb]
mov dword [ebp + 0x28], esi
lea edi, [edi + eax*4]
add eax, edi
mov dword [ebp + 8], eax
test ecx, ecx
mov dword [ebp - 0x528], eax
jle 0x4081fb
mov dword [ebp + 0x24], ecx
mov edx, dword [ebp - 0x528]
mov eax, dword [ebp - 0x14]
xor ecx, ecx
mov cl, byte [edx]
xor ecx, eax
lea eax, [ebp - 0x528]
push eax
call dword [ebp + ecx*4 - 0x414]
mov edx, dword [ebp - 0x528]
mov byte [esi], al
mov eax, dword [ebp + 0x24]
inc edx
inc esi
dec eax
mov dword [ebp - 0x528], edx
mov dword [ebp + 0x24], eax
jne 0x4081bf
mov esi, dword [ebp + 0x28]
mov ecx, dword [ebp + 0x10]
mov eax, dword [ebp + 8]
mov edi, dword [ebp + 0x1c]
mov edx, dword [ebp + 0x18]
add eax, ebx
add esi, edi
dec edx
mov dword [ebp + 8], eax
mov dword [ebp + 0x28], esi
mov dword [ebp + 0x18], edx
jne 0x4081b2
cmp dword [ebp - 0x10], 0x80000
jle 0x408229
mov ecx, dword [ebp + 0x14]
push ecx
call fcn.0048972d
add esp, 4
mov eax, 1
lea esp, [ebp - 0x534]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x24
xor eax, eax
lea esp, [ebp - 0x534]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x24