Function at 0x479380
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x14
push ebx
push esi
mov esi, ecx
xor ebx, ebx
push edi
cmp dword [esi + 0x10], 2
lea edi, [esi + 0x28]
mov ecx, dword [esi + 0x30]
mov edx, dword [esi + 0x2c]
setne bl
mov dword [esp + 0x10], edi
cmp ecx, edx
jb 0x479404
mov ecx, dword [esi]
push 0
push 0x800
push dword [edi]
mov eax, dword [ecx]
mov eax, dword [eax + 4]
mov ecx, dword [eax + ecx + 0x38]
mov eax, dword [ecx]
mov eax, dword [eax + 0x20]
call eax
xor ecx, ecx
mov dword [esi + 0x2c], eax
mov dword [esi + 0x30], 0
test eax, eax
jne 0x4793f9
mov edx, dword [esi]
push 0
mov eax, dword [edx]
mov ecx, dword [eax + 4]
xor eax, eax
add ecx, edx
cmp dword [ecx + 0x38], eax
sete al
lea eax, [eax*4 + 1]
or eax, dword [ecx + 0xc]
push eax
call fcn.00407180
mov ecx, dword [esi + 0x30]
mov edx, dword [esi + 0x2c]
test edx, edx
jne 0x479404
xor al, al
jmp 0x479411
mov eax, dword [edi]
mov dword [esp + 0x10], edi
mov al, byte [ecx + eax]
inc ecx
mov dword [esi + 0x30], ecx
mov byte [esp + 0xc], al
cmp ecx, edx
jb 0x47946f
mov ecx, dword [esi]
push 0
push 0x800
push dword [edi]
mov eax, dword [ecx]
mov eax, dword [eax + 4]
mov ecx, dword [eax + ecx + 0x38]
mov eax, dword [ecx]
mov eax, dword [eax + 0x20]
call eax
mov dword [esi + 0x2c], eax
mov dword [esi + 0x30], 0
test eax, eax
jne 0x479465
mov edx, dword [esi]
push 0
mov eax, dword [edx]
mov ecx, dword [eax + 4]
xor eax, eax
add ecx, edx
cmp dword [ecx + 0x38], eax
sete al
lea eax, [eax*4 + 1]
or eax, dword [ecx + 0xc]
push eax
call fcn.00407180
cmp dword [esi + 0x2c], 0
jne 0x47946f
xor dl, dl
jmp 0x47947d
mov ecx, dword [esi + 0x30]
mov eax, dword [edi]
mov dl, byte [ecx + eax]
lea eax, [ecx + 1]
mov dword [esi + 0x30], eax
mov ecx, dword [esi]
mov byte [esp + 0xd], dl
mov eax, dword [ecx]
mov eax, dword [eax + 4]
cmp dword [eax + ecx + 0xc], 0
jne 0x47965f
lea eax, [esp + 0xc]
add eax, ebx
lea ecx, [esp + 0xc]
xor ebx, 1
mov dword [esp + 0x14], eax
add ecx, ebx
mov dword [esp + 0x18], ecx
movzx ebx, byte [eax]
shl ebx, 8
movzx eax, byte [ecx]
or ebx, eax
lea eax, [ebx - 0xdc00]
cmp eax, 0x3ff
jbe 0x479652
lea eax, [ebx - 0xd800]
cmp eax, 0x3ff
ja 0x47962f
mov ecx, dword [esi + 0x30]
mov edx, dword [esi + 0x2c]
cmp ecx, edx
jb 0x47953d
mov ecx, dword [esi]
push 0
push 0x800
push dword [edi]
mov eax, dword [ecx]
mov eax, dword [eax + 4]
mov ecx, dword [eax + ecx + 0x38]
mov eax, dword [ecx]
mov eax, dword [eax + 0x20]
call eax
xor ecx, ecx
mov dword [esi + 0x2c], eax
mov dword [esi + 0x30], 0
test eax, eax
jne 0x479532
mov edx, dword [esi]
push 0
mov eax, dword [edx]
mov ecx, dword [eax + 4]
xor eax, eax
add ecx, edx
cmp dword [ecx + 0x38], eax
sete al
lea eax, [eax*4 + 1]
or eax, dword [ecx + 0xc]
push eax
call fcn.00407180
mov ecx, dword [esi + 0x30]
mov edx, dword [esi + 0x2c]
test edx, edx
jne 0x47953d
xor al, al
jmp 0x479546
mov eax, dword [edi]
mov al, byte [ecx + eax]
inc ecx
mov dword [esi + 0x30], ecx
mov byte [esp + 0xc], al
cmp ecx, edx
jb 0x4795a9
mov ecx, dword [esi]
push 0
push 0x800
push dword [edi]
mov eax, dword [ecx]
mov eax, dword [eax + 4]
mov ecx, dword [eax + ecx + 0x38]
mov eax, dword [ecx]
mov eax, dword [eax + 0x20]
call eax
xor ecx, ecx
mov dword [esi + 0x2c], eax
mov dword [esi + 0x30], 0
test eax, eax
jne 0x47959f
mov edx, dword [esi]
push 0
mov eax, dword [edx]
mov ecx, dword [eax + 4]
xor eax, eax
add ecx, edx
cmp dword [ecx + 0x38], eax
sete al
lea eax, [eax*4 + 1]
or eax, dword [ecx + 0xc]
push eax
call fcn.00407180
mov ecx, dword [esi + 0x30]
cmp dword [esi + 0x2c], 0
jne 0x4795a9
xor dl, dl
jmp 0x4795b4
mov eax, dword [edi]
mov dl, byte [ecx + eax]
lea eax, [ecx + 1]
mov dword [esi + 0x30], eax
mov ecx, dword [esi]
mov byte [esp + 0xd], dl
mov eax, dword [ecx]
mov eax, dword [eax + 4]
cmp dword [eax + ecx + 0xc], 0
jne 0x479652
mov eax, dword [esp + 0x14]
movzx edi, byte [eax]
mov eax, dword [esp + 0x18]
shl edi, 8
movzx eax, byte [eax]
or edi, eax
cmp edi, 0xdc00
jb 0x4795ed
cmp edi, 0xe000
jb 0x479618
lea eax, [esi + 0x14]
mov edx, 0xfffd
mov ecx, eax
mov dword [esp + 0x1c], eax
call fcn.00478d60
lea eax, [edi - 0xd800]
cmp eax, 0x7ff
ja 0x479640
mov ebx, edi
mov edi, dword [esp + 0x10]
jmp 0x4794d7
and ebx, 0x3ff
and edi, 0x3ff
shl ebx, 0xa
or ebx, edi
add ebx, 0x10000
mov edx, ebx
lea ecx, [esi + 0x14]
call fcn.00478d60
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 0x1c]
mov edx, ebx
call fcn.00478d60
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, 0xfffd
lea ecx, [esi + 0x14]
call fcn.00478d60
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret