Recently I have been working on a little project of mine, which is Memory reading/writing in java for native games (C/C++/etc).
At the moment I have a base where I can r
I got it working after a bit of messing around with what Alex posted, and managed to get it working.
for anyone else who wanted to get something like this working, have a look at that project that Alex posted and you will see the required classes you will need. then I just used this:
public int getBaseAddress() {
try {
Pointer hProcess = gethProcess();
List<Module> hModules = PsapiHandler.getInstance().EnumProcessModules(hProcess);
for(Module m: hModules){
if(m.getFileName().contains(exeName)){
misc.log(m.getFileName() + ": 0x" + Long.toHexString(Pointer.nativeValue(m.getEntryPoint())));
return Integer.valueOf("" + Pointer.nativeValue(m.getLpBaseOfDll()));
}
}
} catch (Exception e) { e.printStackTrace(); }
return -1;
}