Java WriteProcessMemory

I tried researching the write process memory side of Java. But never found anything that would help me. Of course I’m new to the language, as well programming “was a scripter”.

How do I go about writeprocessmemory in java by sending exact values using offsets to that region?

 public static byte[] writeProcessMemory(String szWindowName, long lpBaseAddress, int offsets, int nSize, int data) throws MemoryException {
  WinNT.HANDLE hProcess = openProcess(process.get(szWindowName).wProcessID);
  Memory mToken = new Memory(data);
  long lpPointerAddress = ((lpBaseAddress + offsets));

  //System.out.println(Kernel32.INSTANCE.ReadProcessMemory(hProcess, new Pointer(lpPointerAddress), mToken, nSize, null));
  boolean success = Kernel32.INSTANCE.WriteProcessMemory(hProcess, new Pointer(lpPointerAddress), mToken, nSize, null);
  return success ? mToken.getByteArray(0, nSize) : null;

I attempted to ask other places, discord servers disapprove of helping due to ToS. I asked in cheat engine forum and apparently the forums are dead when I watched activity. There’s more code there if anything.

I’m completely new to the programming side trying to keep myself interested by fiddling with stuff, eventually I want to learn assembly to use alongside for reverse engineering. So if I could receive help on a easy noob level that would be highly appreciated and awesome! I’ve been at this for some time


Additional Data Offer Plans From Airtel and Jio

provide unicode information on runes