Internal linux game hack written in Haskell
hs-ac is my little experiment on learning the basics of reverse engineering and game hacking on linux.
Media

Source
You can find the source code here.
Comments
Besides being written in Haskell, this project doesn’t differ at all from the other C++ cheats around the internet for Assault Cube.
The reverse engineering part is literally the same, in the end the difference is that the code for performing the memory operations is generally more declarative than if it was written in C++, and overall there’re less lines of code.
This project was great to have a better understanding of Haskell’s FFI as well as the basics of memory, C and even Assembly. I’m not a low level developer but I risk saying that Haskell’s FFI is extremey good, even more so considering it’s such a high-level language.
There were only two things that made that C wrapper necessary:
- Haskell’s RTS, which needs to be initialized before we can call any function from our Haskell shared lib.
- Haskell’s FFI data marshalling requirements, which only allows us to pass primitive types as values to C.
On a side note, it’s also very possible to use Cheat Engine in Linux, you just have to use ceserver, I won’t go into the details of setting it up but you can easily find more about it in the Cheat Engine repo.