Package lu.die.fozacompatibility
Class FozaMemoryManager
java.lang.Object
lu.die.fozacompatibility.FozaMemoryManager
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA memory control handler, which need to close after you complete the memory modification -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbeginModifyMemory(String soLibrary, int gamePid, boolean isModifyBssSegment) beginModifyMemory(String soLibrary, String gamePid, boolean isModifyBssSegment) Obtain a memory handler from a specific processstatic voidClose a memory controller handlerstatic intgetPidByPackages(String[] games) Get a best match pid from the specific package names or process names.static byte[]readMemory(FozaMemoryManager.MemoryControllerHandler handler, long offset, int size) Read bytes from a specific process's memory with a memory handler.static voidwriteMemory(FozaMemoryManager.MemoryControllerHandler handler, long offset, byte[] ba) Write a specific process memory with a memory handler.
-
Constructor Details
-
FozaMemoryManager
public FozaMemoryManager()
-
-
Method Details
-
getPidByPackages
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 bybeginModifyMemory(String, String, boolean)offset- offset based on the base addressba- 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 bybeginModifyMemory(String, String, boolean)offset- offset based on the base addresssize- read memory segment length- Returns:
- bytes, length base on the size that given.
-
closeHandle
Close a memory controller handler- Parameters:
handler- MemoryControllerHandler which obtained bybeginModifyMemory(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.
-