Git Product home page Git Product logo

ps2plugininjector's Introduction

ps2plugininjector

An experimental attempt to add PCSX2 Fork With Plugins plugin functionality on a real PlayStation 2.

Plugins allow to expand game code with new C functions that either replace originals or add ot them, this allows for more advanced mods and more!

How it works?

A new section is added to the ELF executable containing plugin code, then the first EI call is replaced with a jump to the invoker function of the injected plugin.

Disclaimer

Due to the fact that PS2 has a limited amount of ram (32MB), some games might be already using it all and leave no place for any new code to be injected! Keep that in mind that "supported" games might be few.

Usage

Run the executable without any params to get argument list

Example command line

ps2plugininjector -i MKDHookPS2.elf -o modded_mkd.elf SLUS_208.81

Samples

MKDHookPS2 - a plugin for MK Deception

RandomLaddersMKA - a plugin for MK Armageddon

Writing plugins

Plugins can only be written in pure C, C++ is not recommended and will definitely break your game.

Guidelines

Base Address

You need to find empty/unused space in memory and set that address as base address in the plugin make file, usually end of original executable + 0x10000 or 0x20000 should be just about enough - to be sure, check with PCSX2 memory view if your selected address is truly unused.

Variables

Every variable needs to be initialized, do not leave uninitialized variables.

Arrays, allocations

Static arrays have been tested and will work, any memory allocations have not been tested yet and theres a high chance they will break games, do it at your own risk

Summary

Basically you need to write plugins with code that only resides in .text section, that's the only section used for injecting - other sections are simply nullified/ignored on the PS2.

Compatibility

A simple list of games that were tested and can (or not) have injected code - doesn't mean the amount of it is infinite.

Name Serial Status
Mortal Kombat Deception SLUS-20881 ✅ Works
Mortal Kombat Armageddon SLUS-21410 ✅ Works
Mortal Kombat Shaolin Monks SLUS-21087 ✅ Works

ps2plugininjector's People

Contributors

ermaccer avatar isamorphic avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.