-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
18,510 additions
and
17,941 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.DEFAULT_GOAL := all | ||
|
||
%: | ||
$(MAKE) -C generate $@ $? | ||
$(MAKE) -C ps4/binary/ps4link $@ $? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Elf loader | ||
|
||
Runs ps4sdk elf files in-process on your PS4. | ||
|
||
## Prerequisites | ||
* clang 4.x for ps4 part | ||
* make | ||
* [ps4sdk](https://github.com/ps4dev/ps4sdk) | ||
* node.js to run server.js (or any alternative to serve /local) | ||
* ps4sh if you want to use ps4link loader | ||
* user loader is available but it is commented on Makefile if you choose use it compile ps4link elf mode instead loader mode and you can load following [user](https://github.com/ps4dev/elf-loader/blob/master/README.md) | ||
|
||
## Important | ||
|
||
The elf loader does not support dynamically linked executables. All libraries need to be statically linked into the executable. [ps4sdk](https://github.com/ps4dev/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 | ||
```bash | ||
#Populate ps4link main source | ||
./copy_ps4link_sources.sh | ||
# 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 | ||
|
||
# Start socat to check output | ||
socat udp-recv:18194 stdout | ||
|
||
# Browse ps4 browser to local server (<local>:5350) | ||
# Wait until the browser hangs in 'step 5' | ||
# Repeat again if you get out of memory problem | ||
#Output expected | ||
[PS4][INFO]: debugnet initialized | ||
[PS4][INFO]: Copyright (C) 2010,2016 Antonio Jose Ramos Marquez aka bigboss @psxdev | ||
[PS4][INFO]: ready to have a lot of fun... | ||
[PS4][DEBUG]: getuid() : 1 | ||
[PS4][DEBUG]: executing privilege scalation | ||
[PS4][DEBUG]: ps4KernelExecute ret=0 | ||
[PS4][DEBUG]: getuid() : 0 | ||
[PS4][DEBUG]: [PS4LINK] Server request thread UID: 0x804AE480 | ||
[PS4][DEBUG]: [PS4LINK] Server command thread UID: 0x804AD640 | ||
[PS4][DEBUG]: [PS4LINK] Created ps4link_requests_sock: 82 | ||
[PS4][DEBUG]: [PS4LINK] bind to ps4link_requests_sock done | ||
[PS4][DEBUG]: [PS4LINK] Ready for connection 1 | ||
[PS4][DEBUG]: [PS4LINK] Waiting for connection | ||
[PS4][DEBUG]: [PS4LINK] Command Thread Started. | ||
[PS4][DEBUG]: [PS4LINK] Created ps4link_commands_sock: 84 | ||
[PS4][DEBUG]: [PS4LINK] Command listener waiting for commands... | ||
# Thread number and sockets number can be different in your environment | ||
|
||
#Check that no bind error present in log | ||
|
||
# If all is fine you can use ps4sh to connect and send commands | ||
``` | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
mkdir -p ps4/binary/ps4link/source | ||
cp ../ps4link/source/main.c ps4/binary/ps4link/source |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
ifndef Ps4Sdk | ||
ifdef ps4sdk | ||
Ps4Sdk := $(ps4sdk) | ||
endif | ||
ifdef PS4SDK | ||
Ps4Sdk := $(PS4SDK) | ||
endif | ||
ifndef Ps4Sdk | ||
$(error Neither PS4SDK, Ps4Sdk nor ps4sdk set) | ||
endif | ||
endif | ||
|
||
|
||
|
||
ldrgen ?= true | ||
OutPath ?= bin | ||
|
||
|
||
compileAndLinkLdrGen = gcc $? -std=c11 -O3 -Wall -pedantic -Iinclude -o $@ | ||
|
||
################################### | ||
|
||
|
||
.PHONY:: generate | ||
|
||
$(OutPath)/generate: source/main.c | ||
ifneq ($(ldrgen), false) | ||
$(dirp) | ||
mkdir -p bin | ||
$(compileAndLinkLdrGen) | ||
endif | ||
|
||
generate: $(OutPath)/generate | ||
|
||
all:: $(OutPath)/generate | ||
|
||
clean: | ||
@rm -fR bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.