Skip to content

Dll injection playground for Spelunky 2

License

Notifications You must be signed in to change notification settings

C-ffeeStain/Playlunky

 
 

Repository files navigation

Playlunky

This is mainly a personal playground to learn the tricks and trades of video game reverse engineering/hacking. It currently is only a wrapper around launching Spelunky 2 with an injected dll which loads resources from disk and injects ScyllaHide but hopefully will become more in the future.

Credits

A huge thanks to the modlunky2 team for their input, suggestions, support and for making all their hard work open source. Special thanks to gmosjack, Dregu and iojonmbnmb that made it possible for this tool to exist.

Build

Only Windows build is supported:

git clone git@github.com:spelunky-fyi/Playlunky.git
cd playlunky
git submodule update --init --recursive
mkdir build
cd build
cmake ..
cmake --build . --config Release
cmake --install .

Build artifacts are found in the publish folder.

Debugging

If you have installed Spelunky 2 then the install folder should be found during configuration of the project and starting a debugging session will launch Spelunky 2 with the playlunky64.dll injected. If you want to debug the game itself as well as the playlunky64.dll it is highly recommended to get the Microsoft Child Process Debugging Power Tool extension and enable child process debugging in DebugOther Debug TargetsChild Process Debugging Settings...

Furthermore, if the game employs any anti-debugging strategies it is supported to inject ScyllaHide into the game process. To do this download ScyllaHide from Github and extract it into a ScyllaHide subfolder right next to the game. The playlunky64.dll will do the rest.

Requirements

  • MSVC 2019 (for C++20)
  • python
    • cmake
    • conan

Usage

Copy all build artifacts into your Spelunky 2 folder, from there you can launch playlunky_launcher.exe to launch the game with the dll injected.

Features

  • Loose loading of resources
    • The game still loads files packed in the exe
    • Prioritizes loose files over files packed in the exe
  • Anti-anti-debug injection
    • If ScyllaHide exists next to the exe it will inject that to circumvent any anti-debugging measures that might exist in the exe (there appear to be none in this version, but there were in pervious versions)
    • Only tries to inject ScyllaHide if a debugger is attached to the exe on boot
  • Logging to console
    • Creates a console window if started with --console that grabs all of the games logging output for easier debugging
  • Mod Management
    • Loads mods from the Mods/Packs folder, where each folder is one mod
    • Users can specify priority of mods using the Mods/Packs/load_order.txt file (useful in case multiple mods replace the same asset)
    • On first load:
      • zip files get extracted into their own mod folders
      • the files in the mod folder are reorganized to align with the games original structure
      • all png files are automatically converted to dds, so mods can be distributed as usual (mods store a small database to catch when they get updated)
      • stickers and journal entries are generated from character mods

About

Dll injection playground for Spelunky 2

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 92.1%
  • CMake 7.7%
  • C 0.2%