Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Improved Lua Script
- Features: Encoding/Decoding, File Handling, Key Management, Memory Patching
- Author: [Xosski/Shestus]
- Date: [1.1.25]
- --]]
- -- Utility Functions
- local function wrapAround(code)
- return (code % 256)
- end
- local function encodeChar(char, shift)
- local code = string.byte(char)
- local newCode = wrapAround(code + shift)
- return string.char(newCode)
- end
- local function decodeChar(char, shift)
- local code = string.byte(char)
- local newCode = wrapAround(code - shift)
- return string.char(newCode)
- end
- local function transformString(input, shift, operation)
- local result = {}
- for i = 1, #input do
- local char = input:sub(i, i)
- if operation == "encode" then
- result[i] = encodeChar(char, shift)
- else
- result[i] = decodeChar(char, shift)
- end
- end
- return table.concat(result)
- end
- local function encode(input)
- return transformString(input, 1, "encode")
- end
- local function decode(input)
- return transformString(input, 1, "decode")
- end
- -- File Handling Functions
- local function fileExists(path)
- local file = io.open(path, "r")
- if file then
- file:close()
- return true
- else
- return false
- end
- end
- local function writeFile(path, content)
- local file = io.open(path, "w")
- if file then
- file:write(content)
- file:close()
- return true
- else
- return false
- end
- end
- local function readFile(path)
- local file = io.open(path, "r")
- if file then
- local content = file:read("*all")
- file:close()
- return content
- else
- return nil
- end
- end
- -- Key Management
- local function generateRandomPassword(length)
- local chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
- local password = ""
- math.randomseed(os.time())
- for i = 1, length do
- local index = math.random(1, #chars)
- password = password .. chars:sub(index, index)
- end
- return password
- end
- local function manageKey(filePath)
- if not fileExists(filePath) then
- local password = generateRandomPassword(9)
- local encodedPassword = encode(password)
- writeFile(filePath, encodedPassword)
- print("New key generated and saved:", password)
- else
- local encodedPassword = readFile(filePath)
- if encodedPassword then
- local password = decode(encodedPassword)
- print("Existing key:", password)
- else
- print("Error reading the key file.")
- end
- end
- end
- -- Memory Patching Functions (Example)
- local function patchMemory(address, value)
- -- Simulated memory patching (for demonstration purposes)
- print(string.format("Patching memory at address 0x%X with value: %s", address, value))
- -- Implement your actual memory patching logic here, if needed.
- end
- local function performMemoryPatches()
- local patches = {
- {address = 0x1000, value = "0xFF"},
- {address = 0x2000, value = "0xAB"},
- {address = 0x3000, value = "0x45"}
- }
- for _, patch in ipairs(patches) do
- patchMemory(patch.address, patch.value)
- end
- end
- -- Main Execution
- local keyFilePath = "/sdcard/DCIM/.keyfile"
- manageKey(keyFilePath)
- performMemoryPatches()
- /////////////
- Game guardian
- -- GameGuardian Script with User Menu and Search Example
- -- Function to generate a unique hardware ID (HWID)
- function generate_hwid()
- local chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
- local hwid = ""
- for i = 1, 16 do
- local rand = math.random(1, #chars)
- hwid = hwid .. chars:sub(rand, rand)
- end
- return hwid
- end
- -- HWID generation
- local hwid = generate_hwid()
- gg.toast("Generated HWID: " .. hwid)
- -- Main menu function
- function main_menu()
- local menu = gg.choice({
- "1. Search and Modify Value",
- "2. Exit"
- }, nil, "GameGuardian Script Menu")
- if menu == 1 then
- search_and_modify()
- elseif menu == 2 then
- gg.toast("Exiting script.")
- os.exit()
- else
- gg.toast("Invalid choice. Please try again.")
- main_menu()
- end
- end
- -- Function to search and modify a value in memory
- function search_and_modify()
- gg.toast("Starting search...")
- -- Input for the value to search
- local value = gg.prompt({"Enter the value to search:"}, {[1] = 0}, {[1] = "number"})
- if value == nil or value[1] == 0 then
- gg.toast("Invalid input or canceled. Returning to menu.")
- main_menu()
- end
- -- Search for the value
- gg.searchNumber(value[1], gg.TYPE_DWORD)
- local results = gg.getResultsCount()
- if results == 0 then
- gg.toast("No results found for value: " .. value[1])
- main_menu()
- else
- gg.toast("Found " .. results .. " results for value: " .. value[1])
- -- Modify the values
- local modify = gg.prompt({"Enter the new value:"}, {[1] = 0}, {[1] = "number"})
- if modify == nil or modify[1] == 0 then
- gg.toast("Invalid input or canceled. Returning to menu.")
- main_menu()
- end
- gg.getResults(results)
- gg.editAll(modify[1], gg.TYPE_DWORD)
- gg.toast("Modified all results to: " .. modify[1])
- end
- main_menu()
- end
- -- Start the script by calling the main menu
- main_menu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement