Giter Site home page Giter Site logo

elf-loader's Introduction

Elf loader

Runs ps4sdk elf files in-process on your PS4.

Prerequisites

  • clang (not the OSX version though)
  • make
  • ps4sdk
  • node.js to run server.js (or any alternative to serve /local)
  • socat, netcat, etc. to send files and to communicate with the standard IO

Important

The elf loader does not support dynamically linked executables. All libraries need to be statically linked into the executable. ps4sdk provides a variaty of position independant, statically linkable libraries, such as a libc, for the PS4. Depending on their build system and requirenments, you can compile third party libraries using the ps4-lib target of the sdk. Alternatively you will have to alter their build system to compile them as PIC statically linked libraries.

Example

# Build as raw binary to bin/ and then convert to ldr.js in /local (you can 'make keepelf=1' to debug)
make clean && make

# Start server
cd local
node server.js

# Browse ps4 browser to local server (<local>:5350)
# Wait until the browser hangs in 'step 5'

# Connect debug/stdio channel
socat - TCP:<ps4>:5052

# Send elf file to the user space process for execution
socat -u FILE:ps4sdk-examples/libless/stress/bin/stress TCP:<ps4>:5053
# OR Send kernel elf file (mode for long-running code, or module-like code)
socat -u FILE:ps4sdk-examples/kernel/function-hook/bin/function-hook TCP:<ps4>:5055
# OR Send kernel elf file (runs in the browsers process, but is loaded and executed into the kernel)
socat -u FILE:ps4sdk-examples/kernel/cache/bin/cache TCP:<ps4>:5054

# Some examples (esp. kernel) use a second socket for their comminication. The default choice is 5088
# Connect to it after the upload to trigger the execution of the code - please see the examples sources for more
socat - TCP:<ps4>:5088

Docker images

A stand alone elf-loader container is available (but currently a bit large):

# Make sure newest container is used (only do this as needed)
docker pull ps4dev/elf-loader
# Run the elf loader (listens on port 5350)
docker run -p 5350:5350 --rm ps4dev/elf-loader&
# Stop elf loader
docker kill $(docker ps -q -f ancestor=ps4dev/elf-loader)

elf-loader's People

Contributors

hitodama avatar

Watchers

 avatar  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.