Riz-ve / Xeno

Xeno: An external script executor for Roblox made entirely in C++. It uses a working but detected method of overwriting the bytecode of a corescript to manage script execution
https://rizve.us.to/Xeno/
Apache License 2.0
67 stars 30 forks source link

Contributions to the Init #3

Closed astacodes closed 2 months ago

astacodes commented 2 months ago

Combined these should bring UNC up from 67% to 72%

Extra Functions

function Xeno.getcustomasset(assetID)
    if type(assetID) ~= "string" or assetID == "" then
        return ""  
    end
    return "rbxasset://" .. assetID
end

function Xeno.isscriptable(object, property)
    if object and typeof(object) == 'Instance' then
        local success, result = pcall(function()
            return object[property] ~= nil
        end)
        return success and result
    end
    return false
end

function Xeno.getscriptclosure(script)
    return function()
        return table.clone(require(script))
    end
end
Xeno.getscriptfunction = Xeno.getscriptclosure

Fixed Cloneref

function Xeno.cloneref(reference)
    if game:FindFirstChild(reference.Name)  or reference.Parent == game then 
        return reference
    else
        local class = reference.ClassName
        local cloned = Instance.new(class)
        local mt = {
            __index = reference,
            __newindex = function(t, k, v)

                if k == "Name" then
                    reference.Name = v
                end
                rawset(t, k, v)
            end
        }
        local proxy = setmetatable({}, mt)
        return proxy
    end
end
Riz-ve commented 2 months ago

heyy appreciate it man ill add it to the next commit

edit: I'm not going to fake "getcustomasset" ill try to make it a legit function

also i have to use "workspace.Parent" instead of "game" is because it interferes with the executed scripts and causes a crash

astacodes commented 2 months ago

👍