Class FozaMemoryManager

java.lang.Object
lu.die.fozacompatibility.FozaMemoryManager

public class FozaMemoryManager extends Object
Manage the over heap memory, can modify the app memory page.
Since:
Foza API 3

var handler = FozaMemoryManager.beginModifyMemory("libil2cpp.so", "self", false)
FozaMemoryManager.writeMemory(handler, 0x7E8B3, ba \/* data of 9999999 *\/)

Version:
1.0
Author:
king@62v.net
  • Constructor Details

    • FozaMemoryManager

      public FozaMemoryManager()
  • Method Details

    • getPidByPackages

      public static int getPidByPackages(String[] games)
      Get a best match pid from the specific package names or process names. var gameOrAppProcessNames = new String[] {"com.roblox.client", "com.roblox.client:service"}; var pid = FozaMemoryManager.getPidByPackages(gameOrAppProcessNames);
      Parameters:
      games - package names or process names array
      Returns:
      best match pid, 0 if not found
    • writeMemory

      public static void writeMemory(FozaMemoryManager.MemoryControllerHandler handler, long offset, byte[] ba)
      Write a specific process memory with a memory handler.
      Parameters:
      handler - MemoryControllerHandler which obtained by beginModifyMemory(String, String, boolean)
      offset - offset based on the base address
      ba - data want to write, size is the byte array length
    • readMemory

      public static byte[] readMemory(FozaMemoryManager.MemoryControllerHandler handler, long offset, int size)
      Read bytes from a specific process's memory with a memory handler.
      Parameters:
      handler - MemoryControllerHandler which obtained by beginModifyMemory(String, String, boolean)
      offset - offset based on the base address
      size - read memory segment length
      Returns:
      bytes, length base on the size that given.
    • closeHandle

      public static void closeHandle(FozaMemoryManager.MemoryControllerHandler handler)
      Close a memory controller handler
      Parameters:
      handler - MemoryControllerHandler which obtained by beginModifyMemory(String, String, boolean)
    • beginModifyMemory

      public static FozaMemoryManager.MemoryControllerHandler beginModifyMemory(String soLibrary, int gamePid, boolean isModifyBssSegment)
      Parameters:
      gamePid - integer value of the process id (pid)
      See Also:
    • beginModifyMemory

      public static FozaMemoryManager.MemoryControllerHandler beginModifyMemory(String soLibrary, String gamePid, boolean isModifyBssSegment)
      Obtain a memory handler from a specific process
      Parameters:
      soLibrary - Can be empty (""), when empty then base address will be zero, otherwise will be the so base address.
      gamePid - Process ID, can be {@value "self"}.
      isModifyBssSegment - If true then the base address will be the bss segment like [libxxx.so:bss], otherwise the common base address of a ELF file.
      Returns:
      Memory controller handler, nullable.