11/20/2023 0 Comments Super hexagon bot![]() I've added some comments in the source file about the width of a wall. I hope this picture clears some things up: Note that the actual game field is much larger than what is visible, and more walls are loaded than you can see. Print 'Player angle: %3d' % playerAngle.valueĪs a reference, in my original code I read out the appBase with ReadProcessMemory (well, a function that wraps around it) as well: įirstWall is the first loaded wall that can be read out from memory it says nothing about the walls position or distance, and numWalls tells you how many walls are currently loaded in memory. ReadProcessMemory(processHandle, appBase.value + 0x2958, byref(playerAngle), 4, byref(numRead)) ReadProcessMemory(processHandle, 0圆94B00, byref(appBase), 4, byref(numRead)) # Read out the app base (this is not the program / module base, the 'app' is just a huge object): GetWindowThreadProcessId(windowHandle, byref(processId)) # Get the process id from the window handle: WindowHandle = FindWindowA(0, 'Super Hexagon') # Find the Super Hexagon window by title (any window with that title might be returned): # Warning: absolutely no error checking, leaking handles. ![]() If this doesn't clear things up I'll try to whip up some python code to illustrate this better. Instead of attaching Cheat Engine and reading out the value that you get from 0圆94B00, you can do that in your bot, and then use this as the app base to get the information you need. You will always need to perform the read from address 0圆94B00 to find where the 'app' has been allocated, and then use the other offsets relative to that read out value (appBase). You can do something along these lines (pseudocode):ĪppBase := ReadInt32(0圆94B00) # the value of 'appBase' might be different after every execution, but we don't care we know that at appBase + offset we can find what we want However, ASLR (address space layout randomization) is disabled and the game stores a reference to the 'app' at a known location that will never change. Indeed, these things are usually dynamically allocated and may be at different addresses in successive executions. If so, I would assume that on the stackoverflow page that "pid" would be the superhexagon process and would the "address" location be the offsets that I've seen in your bot? I was wondering if you have any insight as to whether this would work or not. I've found this about reading memory in python: I've decided to try a similar technique to what you've done by reading the memory but I've never done something like this with python. It's only able to screenshot the game and parse the positions of everything at 6 FPS which is not fast enough to keep up with the speed of Super Hexagon. I started out trying to use SimpleCV to parse the shapes and control the player position based on that, but SimpleCV just can't do it fast enough. I've been learning python and I've also been playing Super Hexagon recently, so I figured I would try my hand at creating a bot for it. First I'd like to apologize for creating an issue to get in contact with you, but I couldn't find another way to do so.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |