Function at 0x407da0
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, ecx
push edi
mov edi, edx
push esi
push ebx
sub esp, 0x3c
mov dword [esp], edx
mov dword [esp + 0x1c], eax
call sym._luaH_realasize
movzx ecx, byte [edi + 7]
mov esi, eax
mov eax, 1
shl eax, cl
mov dword [esp + 0x18], eax
test esi, esi
je 0x407fe5
xor ebx, ebx
mov dword [esp + 0x24], 0
mov dword [esp + 0x20], ecx
jmp 0x407de7
add ebx, 1
cmp esi, ebx
je 0x407e15
mov eax, ebx
shl eax, 4
add eax, dword [edi + 0xc]
test byte [eax + 8], 0x40
je 0x407de0
mov edx, dword [eax]
test byte [edx + 5], 0x18
je 0x407de0
mov eax, dword [esp + 0x1c]
add ebx, 1
call sym._reallymarkobject
mov dword [esp + 0x24], 1
cmp esi, ebx
jne 0x407de7
mov ecx, dword [esp + 0x20]
mov ebx, dword [esp + 0x18]
test ebx, ebx
je 0x407fb5
mov eax, 0x18
xor esi, esi
mov dword [esp + 0x28], 0
shl eax, cl
mov dword [esp + 0x2c], 0
sub eax, 0x18
mov dword [esp + 0x20], eax
jmp 0x407e7a
imul eax, esi, 0xffffffe8
add eax, dword [esp + 0x20]
add ebx, eax
movzx eax, byte [ebx + 9]
movzx ecx, byte [ebx + 8]
and eax, 0x40
test cl, 0xf
jne 0x407e97
test al, al
je 0x407e71
mov byte [ebx + 9], 0xb
add esi, 1
cmp dword [esp + 0x18], esi
je 0x407ef0
mov ebx, dword [edi + 0x10]
test ebp, ebp
jne 0x407e50
lea eax, [esi + esi*2]
lea ebx, [ebx + eax*8]
movzx eax, byte [ebx + 9]
movzx ecx, byte [ebx + 8]
and eax, 0x40
test cl, 0xf
je 0x407e69
test al, al
je 0x407f20
mov edx, dword [ebx + 0x10]
test edx, edx
je 0x407f20
movzx eax, byte [edx + 4]
and eax, 0xf
cmp al, 4
je 0x407f50
movzx eax, byte [edx + 5]
and eax, 0x18
and ecx, 0x40
test eax, eax
je 0x407f23
mov dword [esp + 0x2c], 1
test cl, cl
je 0x407e71
mov eax, dword [ebx]
test byte [eax + 5], 0x18
mov eax, 1
cmove eax, dword [esp + 0x28]
add esi, 1
mov dword [esp + 0x28], eax
cmp dword [esp + 0x18], esi
jne 0x407e7a
lea esi, [esi]
mov eax, dword [esp + 0x1c]
cmp byte [eax + 0x4d], 0
jne 0x407f62
mov edx, dword [esp + 0x1c]
mov eax, dword [edx + 0x68]
mov dword [edi + 0x1c], eax
mov dword [edx + 0x68], edi
and byte [edi + 5], 0xc7
mov eax, dword [esp + 0x24]
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret
and ecx, 0x40
test cl, cl
je 0x407e71
mov edx, dword [ebx]
test byte [edx + 5], 0x18
je 0x407e71
mov eax, dword [esp + 0x1c]
call sym._reallymarkobject
mov dword [esp + 0x24], 1
jmp 0x407e71
mov eax, dword [esp + 0x1c]
call sym._iscleared.part.1
movzx ecx, byte [ebx + 8]
jmp 0x407ebc
mov edx, dword [esp + 0x28]
test edx, edx
je 0x407f90
mov ecx, dword [esp + 0x1c]
mov eax, dword [ecx + 0x70]
mov dword [edi + 0x1c], eax
mov eax, dword [esp + 0x24]
mov dword [ecx + 0x70], edi
and byte [edi + 5], 0xc7
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x407fc3
mov ecx, dword [esp + 0x1c]
mov eax, dword [ecx + 0x74]
mov dword [edi + 0x1c], eax
mov eax, dword [esp + 0x24]
mov dword [ecx + 0x74], edi
and byte [edi + 5], 0xc7
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [esp + 0x1c]
cmp byte [eax + 0x4d], 0
je 0x407efa
movzx eax, byte [edi + 5]
mov edx, eax
and edx, 7
cmp dl, 5
je 0x407ff2
cmp dl, 6
jne 0x407f0b
xor eax, 2
mov byte [edi + 5], al
jmp 0x407f0b
mov dword [esp + 0x24], 0
jmp 0x407e19
mov eax, dword [esp + 0x1c]
mov edx, edi
call sym._genlink.part.2
jmp 0x407f0b