Skip to content

Patcher is a gameguardian library for patching memory address, it provides a simple interface and handle on/off state of patching.

Notifications You must be signed in to change notification settings

RaizyDaizy/GameGuardian-Patcher-IL2CPP

 
 

Repository files navigation

Patcher

Patcher is a gameguardian library for patching memory address, it provides a simple interface and handle on/off state of patching.

Installation

Download the latest version of patcher from here and add it to your project.

You can also load the latest version of Patcher from the cdn using the following code.

local _, Patcher = pcall(load(gg.makeRequest("https://pastebin.com/raw/wz1sfmWF").content))

Usage

Make sure to place the Patcher.lua file in the same directory as your script.

local Patcher = require("Patcher")

local il2cpp    = Patcher.getBaseAddr("libil2cpp.so")
local libunity  = Patcher.getBaseAddr("libunity.so")

local p = Patcher.new({
  title = "Custom Title",
})

p:add({
  name    = "Damage Multiplier",
  address = il2cpp + 0x18643A8,
  patch   = "01 04 A0 E3 1E FF 2F E1r",
})

p:add({
  name    = "HP Multiplier",
  address = libunity + 0x1864F88,
  patch   = "01 04 A0 E3 1E FF 2F E1r"
})

p:run()

Class Members

Note: See more in depth examples here

Note: Arguments and table field marked with ? are optional.

Patcher.getVersions()

Get the current version of Patcher.

Parameters

  • return (number) - The current numeric version of Patcher.
  • return (string) - The current version name of Patcher.

Example:

local Patcher = require("Patcher")

local version, name = Patcher.getVersions()
print(version, name)

Patcher.require(version)

Check if the Patcher version is greater than or equal to the specified version.

Parameters

  • version (number) - The version to check.

Example:

local Patcher = require("Patcher")

Patcher.require(210)

Note: This function will throw an error if the version is not supported.


Patcher.getBaseAddr(filter)

Get the base address of a library in memory Xa - CodeApp

Parameters

  • filter (string) - The library name to filter. see
  • return (number) - The base address of the library, or nil if the library is not found.

Example:

local Patcher = require("Patcher")

local ue4       = Patcher.getBaseAddr("libUE4.so")
local libunity  = Patcher.getBaseAddr("libunity.so")
local il2cpp    = Patcher.getBaseAddr("libil2cpp.so")

Note: This function will throw an error if the library is not found.


Patcher.new(config)

Create a new Patcher instance.

Parameters

  • config (table) - The configuration table.

    • ?title (string) - The title to show in the menu.

    • ?on (string) - The text to display when the patch is enabled.

    • ?off (string) - The text to display when the patch is disabled.

    • ?showUiButton (boolean) - Show the UI button in the menu (default: false). see

    • ?menuBuilder(value, config) (function) - A function to build the menu for the value (default: nil).

      • value (table) - The value table. with all the fields from Patcher:add(value) method and gg.getValues() result. see

      • config (table) - The configuration table with all the fields from Patcher:new(config) method.

      • return (string) - The menu string to display in the menu.

  • return (Patcher) - The Patcher instance.

Example:

local Patcher = require("Patcher")

local p = Patcher.new({
  title = "Custom Title",
})

Patcher:add(value)

Add a new value to the patcher instance.

Parameters

  • value (table) - The value table.
    • name (string) - The name of the value to display in the menu.
    • address (number) - The address of the value.
    • patch (string) - The patch to apply to the value when enabled.
    • ?freeze (boolean) - Freeze the value (default: false)
    • ?state (boolean) - The initial state of the value (default: false).
    • ?processPause (boolean) - Pause the process before applying the patch and resume it after applying the patch (default: false). see
    • ?patchOnStart (boolean) - Apply the patch when the script is started (default: false).

Example:

local Patcher = require("Patcher")

local il2cpp = Patcher.getBaseAddr("libil2cpp.so")

local p = Patcher.new({
  title = "Custom Title",
})

p:add({
  name    = "Damage Multiplier",
  address = il2cpp + 0x18643A8,
  patch   = "01 04 A0 E3 1E FF 2F E1r",
})

Note: The patch field value must be a valid hexadecimal string ending with r or h to indicate the endianness of the value. (whitespace is ignored)

Example: 01 04 A0 E3 1E FF 2F E1r

Example: 01 04 A0 E3 1E FF 2F E1h

Note: Patcher support patching for hexadecimals values longer than 8 bytes. (whitespace is ignored)

Example: F0 48 2D E9 10 B0 8D E2 08 D0 4D E2 00 40 A0 E1r


Patcher:run()

Run the patcher instance.

Example:

local Patcher = require("Patcher")

local il2cpp = Patcher.getBaseAddr("libil2cpp.so")

local p = Patcher.new({
  title = "Custom Title",
})

p:add({
  name    = "Damage Multiplier",
  address = il2cpp + 0x18643A8,
  patch   = "01 04 A0 E3 1E FF 2F E1r",
})

p:run()

Patcher.patch(address, hex, freeze, processPause)

Apply a patch to the specified address and freeze the value if specified. (without adding the value to the patcher instance and wont keep track of the value)

Parameters

  • address (number) - The address of the value.
  • hex (string) - The patch to apply to the value.
  • ?freeze (boolean) - Freeze the value (default: false)
  • ?processPause (boolean) - Pause the process before applying the patch and resume it after applying the patch (default: false). see

Example:

local Patcher = require("Patcher")

local il2cpp = Patcher.getBaseAddr("libil2cpp.so")

Patcher.patch(il2cpp + 0x18643A8, "01 04 A0 E3 1E FF 2F E1r")
Patcher.patch(il2cpp + 0x18643A8, "01 04 A0 E3 1E FF 2F E1r", true)
Patcher.patch(il2cpp + 0x18643A8, "01 04 A0 E3 1E FF 2F E1r", false, true)

Patcher.getHex(address, bitSize)

Get the hexadecimal value of the specified address. (the byte count is determined by the bitSize parameter)

Parameters

  • address (number) - The address of the value.
  • ?bitSize (number) - The bit size of the value (default: 8).

Note: The bitSize parameter must be a multiple of 8.

Example:

local Patcher = require("Patcher")

local il2cpp = Patcher.getBaseAddr("libil2cpp.so")

local hex   = Patcher.getHex(il2cpp + 0x18643A8)
local hex2  = Patcher.getHex(il2cpp + 0x18643A8, 4)

print(hex) -- 01 04 A0 E3 1E FF 2F E1
print(hex2) -- 01 04 A0 E3

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate and follow the Code of Conduct.

To build the project you will need to have nodejs installed, or you can use your own build script for building the project.

  • Fork the repository
  • Clone the repository
  • Make your changes
  • Commit and push your changes
  • Create a pull request

Steps to build the project

  • Run npm install to install the dependencies.
  • Run npm run build to build the project.

License

MIT

This project is not affiliated with GameGuardian or any of its developers in any way and is not endorsed by them in any way or form whatsoever and is not intended to be used for any illegal purposes whatsoever and is intended for educational purposes only and the author of this project is not responsible for any misuse of this project or any damage caused by this project in any way or form whatsoever.

Credits

  • GameGuardian - For the awesome GameGuardian app.
  • BadCase - For recommendation and testing.
  • Lover1500 - For recommendation and testing.
  • CmP - For recommendation and testing.
  • mikacyber - For recommendation and testing.

Contact

About

Patcher is a gameguardian library for patching memory address, it provides a simple interface and handle on/off state of patching.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 93.0%
  • JavaScript 7.0%