Finding base address of a process in Java

0

What's the right way of finding the base address of a process in Java? I know it could be done "easier" in languages like C++ but I'm in need to obtain base address in Java.

Code below is my try but it fails.

String exeName = "Path of Building.exe";
int pid = 0x00000184;

for(Tlhelp32.MODULEENTRY32W m : Kernel32Util.getModules(pid)) {
  if(m.szModule().equals(exeName)) {
    System.out.println(m.modBaseAddr);
  }
}

console output is:native@0x610000

if instead of m.modBaseAddr would be m.modBaseAddr.getLong(0) I'm getting Invalid memory access error

java
asked on Stack Overflow Jan 10, 2020 by Miłosz Tomkiel • edited Jan 10, 2020 by Miłosz Tomkiel

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0