SO WHAT IS IT?
Well as the title implies: it is a memory editing library for use with java on windows systems. It makes use of user32,win32 and kernel32 through the JNAlibs.
WHAT CAN IT DO?
Not much other than basic memory reading and writing. Also has some input functionality to send virtual input to background windows/processes.
BUT WHY?
Well I recently started getting into reading and writing memory out of curiosity and found that my programming language(JAVA) of choice is less than ideal for this sort of thing. Leave it to me to keep trying anyways After all it was kind of a fun thing to learn to do. The lib was made with creating a bot program in mind and since most of the java bots presented on this sight are more of pixel readers i decided to try and go deeper than that. I know this sort of thing is easier in other lower level languages but like i said java is my language of choice(its one of the ones I started learning on) and so it still appeals to me very much.
HOW TO USE
Simply add the WGtools.jar to your build path and then create a WGTools Instance, simple as that.Make sure you are executing your code with admin writes so that it is able to read and write to memory. in development this can be done simply by opening your ide as admin. To make a runnable jar work you must open it with a .bat that is run as admin or pack it into an exe that requires admin.
EXAMPLE
simple example class
Code:
import com.wgtools.input.Input.Key;
import com.wgtools.jna.JnaUtils;
import com.wgtools.mem.WGTools;
public class example {
public static void main(String args[]){
WGTools tools = new WGTools(); //create an instance of the tools
//JnaUtils.getWinHwnd() returns an array or Hwnds with the first value(0)
//always being the foremost
tools.open(JnaUtils.getWinHwnd("Program window name").get(0)); //open the process of the given window
tools.input().keyDown(Key.UP); //send keyup(hex keycode) to the specified window
tools.sleep(10000); //sleep for 10 seconds
tools.input().keyUp(Key.UP); //send keydown
tools.input.simulateKeyPress(Key.ENTER,Key.SHIFT,10); //simulate a keypress(keytopress,modifier,timepressed)
int exampleint = tools.readInt(0xAF00FFF); //read an int from the given window/proccess
System.out.println(exampleint); //print out the result
tools.close(); //close process used and dispose of tools
}
}
Any feedback is appreciated. Also feel free to post questions i will answer to the best of my ability.
Looks like a great little project, would've come in handy when I was still developing bots with Java. It's funny though, I was actually once like you. I used Java as my go to language for almost every project. For the same reason as you in fact. Though I sorta grew out of it you could say. Went to C# before finally settling on C++ and JavaScript. Either way, best of luck to you and never stop exploring new technologies!
Thank you torpedoes!, I have done a few things in c and c# recently involving this sort of thing. I just thought it would be cool to try it in java I might be one of the few who actually like it hehe even if it is not the cleanest language.
Very interesting! I have to use Java during the day so it's probably the language I'm most familiar with, although my favourite is probably c# because of its flexibility and friendliness
unfortunately i dont think there is an easy way to do this unless you actually know what you are doing with my lib. And i dont know how to do it myself at this moment.
Currently the only way to inject assembly is by injecting a bytebuffer into allocated memory and this is very cumbersome since you have to manually input opcodes. Currently all you can do is do simple memory reads and writes and idk if you can unlock lua with just this.
I will try to look into this more maybe i can whip something up.
Any chance you'd release the source code for it? I wouldn't mind playing around with this.
yeah i just wiped my computer recently because of a failed windows 10 update, but i think i still have the source on a box account somewhere. Ill put up a zip soon as i can.