16 minutes, 0 seconds

Reading time (calculated automatically): 16 minutes, 0 seconds

Note: This is by no means complete. Maybe there will be more parts down the road with more information as I learn them. Lots of it here is just info I gathered on the internet myself or learned by experimenting. So.. no TLDR :/

Update February 2020

The original Dockerfile used base image Ubuntu 17.10 which since then went EOL. I've updated it to use Ubuntu 18.04 LTS so compiling works again. Please update your sources.

Info

To even get started using this "guide" you have to have a jailbreakable PS4. At time of writing this is the PS4 System firmware version 5.05 because we are gonna use a OpenSource SDK for the PS4 which is (right now) only available for the Firmware 5.05 (or older) and a public available Kernel Exploit for the PS4.

Whats a kernel exploit?

Basically this triggers the PS4 into thinking its a debug machine - which will then allow code execution.

Setting everything up

We will set it up using a enviroment inside a docker container. If you don't want that, you can obviously just let it all run on your machine without virtualisation. First are the links we're gonna use inside a docker container, then I will show you how I ended up virtualizing all this by using docker.

And here is my docker solution (which I just forked, thanks again https://github.com/ooPo/ps4sdk-docker) on Github: https://github.com/pquerner/ps4sdk-docker.

You start by cloning the repository and then building the image.

Important: Make sure you open the Dockerfile in a texteditor and change the local ip address of your PS4. This is important because ps4sh will be compiled to target that ip address only.

This will take some time as it will compile the SDK and other tools for you. Depending on your machine it can take up to 30 minutes.

git clone https://github.com/pquerner/ps4sdk-docker.git
cd ps4sdk-docker
docker build --rm==false -t ps4sdk-docker .

After thats done, the enviroment is set up and you can start by compiling examples found in this repository https://github.com/orbisdev/liborbis/tree/master/samples. We'll get to that in the next step.

  • [x] SDK installation
  • [ ] Write and compile first own code
  • [ ] Execute on PS4

Write and compile first own code

Now that we have the proper tools to build our tools against an SDK, we shall do so! For this blog post however I use a pre existing example which can be found in the liborbis repository I mentioned earlier. Also I assume you copied the helper script ps4sdk-docker.sh to your $PATH variable to easier access it. So, clone the liborbis repository and cd into a samples folder. I use the "starfield" demo.

git clone https://github.com/orbisdev/liborbis.git
cd liborbis/samples/starfield
ps4sdk-docker.sh make

The command "make" runs the Makefile inside the starfield folder - within the docker container.

After its compiled you'll find 2 new folders: bin and build. The bin folder actually contains the build homebrew.elf - ready to get send to the PS4!

➜  starfield git:(master) ls -lah
total 28K
drwxr-xr-x  6 pascal pascal 4,0K Mär 13 21:10 .
drwxr-xr-x 10 pascal pascal 4,0K Dez 30 12:39 ..
drwxr-xr-x  2 root   root   4,0K Mär 13 21:10 bin
drwxr-xr-x  2 root   root   4,0K Mär 13 21:10 build
drwxr-xr-x  2 pascal pascal 4,0K Dez 30 06:58 include
-rw-r--r--  1 pascal pascal  476 Dez 30 06:58 Makefile
drwxr-xr-x  2 pascal pascal 4,0K Dez 30 06:58 source
➜  starfield git:(master) ls -lah build 
total 24K
drwxr-xr-x 2 root   root   4,0K Mär 13 21:10 .
drwxr-xr-x 6 pascal pascal 4,0K Mär 13 21:10 ..
-rw-r--r-- 1 root   root    11K Mär 13 21:10 main.c.o
-rw-r--r-- 1 root   root   3,4K Mär 13 21:10 starfield.c.o
➜  starfield git:(master) ls -lah bin 
total 676K
drwxr-xr-x 2 root   root   4,0K Mär 13 21:10 .
drwxr-xr-x 6 pascal pascal 4,0K Mär 13 21:10 ..
-rwxr-xr-x 1 root   root   666K Mär 13 21:10 homebrew.elf

Now that we build injectable .elf file we can go to the next step - running it on the PS4.

Note: Some samples try to load media assets. If the assets are not found within the correct folder from where you are sending the homebrew.elf, the app will do nothing and simply show you a blackscreen on your TV screen.

  • [x] SDK installation
  • [x] Write and compile first own code
  • [ ] Execute on PS4

Execute on PS4

We're gonna use the tool ps4sh to "talk" to the PS4 and inject our compiled homebrew.elf with the help of the tool orbislink.

Note: To my knowledge homebrew.elf is hardcoded within orbislink. Therefore you should just stick with that name and dont rename that file. Else it might not work.

First download and install orbislink on your PS4. Bring your PS4 into debug mode (you should know how) and install it.

At time of writing the orbislink tool was released with a hardcoded "server" ip address, therefor the computer you run ps4sh from must have the ip address 192.168.1.3. Best way to do this is give your machine manually the ip address. Either on the machine itself (must disable DHCP for this) or in your router. Consult your routers handbook or the internet.

sh into the docker container by calling the helper script: ps4sh-docker.sh (again, assuming thats in your $PATH or you are within the docker repository directory).

Within the docker container there are several aliases you can use. Consult the Dockerfile or README.txt to get to know them. Copy all needed assets (for example the starfield demo uses an asset called zweifeld.mod - which is a audio file. (I added it to the repository in case you cannot find it on the internet, its just a audio file so you could use a different audio, convert it to .mod and rename the file - or change the filename in the main.c or completely disable that line and recompile it) --> main.c#L258) and the homebrew.elf to the PS4SH directory inside the docker container. (Alias elfcp and enviroment variable $PS4SH may help you.).

This is how my ps4sh directory looks like with the starfield demo:

root@honeycomb:/usr/local/ps4dev/ps4link/ps4sh/bin# ls -lah
total 772K
drwxr-xr-x 1 root root 4.0K Dec 30 01:59 .
drwxr-xr-x 1 root root 4.0K Dec 30 01:59 ..
-rwxr-xr-x 1 root root 666K Dec 30 01:59 homebrew.elf
-rwxr-xr-x 1 root root  59K Dec 30 01:59 ps4sh
-rw-r--r-- 1 root root  34K Dec 30 01:59 zweifeld.mod

Start ps4sh (with alias ps4sh is quickest).

You should see ps4sh started and waiting for commands:

root@honeycomb:~# ps4sh
ps4sh version 1.0
 Verbose mode on

log: [HOST][INFO]: [PS4SH] Ready
ps4sh> 
</pre>
Typing ```help``` shows you all available commands
<pre class="prettyprint">
ps4sh> help
?           ? :: Synonym for `help'..
connect     connect :: Connect to ps4sh..
cd          cd [dir] :: Change ps4sh directory to [dir]..
debug       debug :: Show ps4sh debug messages. ( alt-d ).
exit        exit :: Exits ps4sh ( alt-q ).
help        help :: Display this text..
list        list [dir] :: List files in [dir]..
log         log [file] :: Log messages from PS4 to [file]..
ls          ls [dir] :: Synonym for list.
make        make [argn] ... :: Execute make [argn] ....
gmake       gmake [argn] ... :: Execute gmake [argn] ....
pwd         pwd :: Print the current working directory ( alt-p ).
quit        quit :: Quit pksh ( alt-q ).
setroot     setroot [dir] :: Sets [dir] to be root dir..
status      status :: Display some ps4sh information. ( alt-s ).
execuser    execuser :: Load and exec user elf. ....
execkernel  execkernel :: Load and exec kernel elf. ....
exitps4     exitps4 :: Finish ps4link in ps4 side. ....
execdecrypt  decrypt :: decrypt file in ps4 side and dump to host0. ....
execwhoami  execwhoami :: show uid and gid in ps4 side. ....
execshowdir  execshowdir :: list file from directory in ps4 side. ....
verbose     verbose :: Show verbose ps4sh messages. ( alt-v ).
ps4sh>

If orbislink is running on the PS4 you may connect to it via command connect.

ps4sh> connect
log: [HOST][INFO]: [PS4SH] Connecting to fio ps4link ip 192.168.1.5 
log: [HOST][INFO]: [PS4SH] PlayStation is listening at 192.168.1.5
log: [PS4][INFO]: [PS4LINK] sock ps4link_fileio set 15 connected 1
log: [PS4][DEBUG]: [ORBISLINK] Initialized and connected from pc/mac ready to receive commands
log: [PS4][INFO]: [PS4LINK] Waiting for connection
log: [PS4][DEBUG]: liborbispad sceUserServiceInitialize return 0x       0!
log: [PS4][DEBUG]: liborbispad scePadInit return 0
log: [PS4][DEBUG]: liborbispad scePadOpen return handle 0x 3040500
log: [PS4][DEBUG]: liborbis2d sceVideoOutOpen return video handle 0x4e110100
log: [PS4][DEBUG]: sceKernelCreateEqueue return 0
log: [PS4][DEBUG]: liborbis2d sceVideoOutAddFlipEvent return 0
log: [PS4][DEBUG]: liborbis2d video memory initialized
log: [PS4][DEBUG]: liborbis2d orbis2dMalloc buffer 0, new pointer 210e00000 
log: [PS4][DEBUG]: liborbis2d orbis2dMalloc buffer 1, new pointer 211184000 
log: [PS4][DEBUG]: liborbis2d orbis2dAllocDisplayBuffer done
log: [PS4][DEBUG]: liborbis2d sceVideoOutSetBufferAttribute done
log: [PS4][DEBUG]: liborbis2d sceVideoOutRegisterBuffers return 0x       0
log: [PS4][DEBUG]: liborbis2d initialized
log: [PS4][DEBUG]: [ORBISLINK] orbis2dInit return 1 
log: [PS4][DEBUG]: [orbisAudio] sceAudioOutInit return 0
log: [PS4][DEBUG]: [orbisAudio] initialized!
log: [PS4][DEBUG]: [orbisAudio] buffers 0 for audio 0 d3c820 created
log: [PS4][DEBUG]: [orbisAudio] buffers 1 for audio 0 d3d840 created
log: [PS4][DEBUG]: [orbisAudio] buffers for audio channel 0 created
log: [PS4][DEBUG]: [orbisAudio] sceAudioOutOpen  1024 samples
log: [PS4][DEBUG]: [orbisAudio] sceAudioOutOpen handle  20000007 
log: [PS4][DEBUG]: [orbisAudio] audio channel 0 thread UID: 0x81D05BC0 created
log: [PS4][DEBUG]: orbisAudioChannelThread channel 0
log: [PS4][DEBUG]: orbisAudioChannelThread channel samples 0 1024
log: [PS4][DEBUG]: orbisAudioChannelThread channel samples 1 1024
log: [PS4][DEBUG]: orbisAudioChannelThread buffer 0 d3c820
log: [PS4][DEBUG]: orbisAudioChannelThread buffer 1 d3d840
log: [PS4][DEBUG]: [orbisAudio] orbisAudioChannelThread 0  1 ready to have a lot of fun...
log: [PS4][DEBUG]: [ORBISLINK] orbisAudioInitChannel return 0 
log: [PS4][DEBUG]: liborbiskeyboard is initialized!
log: [PS4][DEBUG]: orbisKeyboardInit 1
log: [PS4][DEBUG]: liborbiskeyboard sceImeKeyboardOpen in
log: [PS4][DEBUG]: liborbiskeyboard orbisKeyboardConf not null 
log: [PS4][DEBUG]: liborbiskeyboard sceImeKeyboardOpen return success 0
log: [PS4][DEBUG]: orbisKeyboardOpen 0
log: [HOST][DEBUG]: [PS4SH] Opening homebrew.elf flags 0
log: [HOST][DEBUG]: [PS4SH] Open return 8
log: [PS4][DEBUG]: [ORBISLINK]Loading homebrew.elf from host
log: [PS4][DEBUG]: [ORBISLINK] orbisExecUserElf called
log: [PS4][DEBUG]: [PS4LINK] file open req (host0:homebrew.elf, 0 0)
log: [PS4][DEBUG]: [PS4LINK] file open reply received (ret 8)
log: [PS4][DEBUG]: [PS4LINK] file lseek req (fd: 8)
log: [HOST][DEBUG]: [PS4SH] 681256 result of lseek 0 offset 2 whence
log: [PS4][DEBUG]: [PS4LINK] ps4link_lseek_file: lseek reply received (ret 681256)
log: [PS4][DEBUG]: [PS4LINK] file lseek req (fd: 8)
log: [HOST][DEBUG]: [PS4SH] 0 result of lseek 0 offset 0 whence
log: [PS4][DEBUG]: [PS4LINK] ps4link_lseek_file: lseek reply received (ret 0)
log: [PS4][DEBUG]: [ORBISLINK] before orbisSysMmap
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: Reply said there's 681256 bytes to read (wanted 681256)
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 0  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 1  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 2  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 3  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 4  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 5  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 6  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 7  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 8  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 9  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 10  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 11  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 12  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 13  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 14  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 15  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 16  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 17  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 18  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 19  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 20  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 21  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 22  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 23  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 24  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 25  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 26  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 27  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 28  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 29  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 30  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 31  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 32  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 33  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 34  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 35  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 36  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 37  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 38  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 39  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 40  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 41  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 42  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 43  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 44  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 45  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 46  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 47  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 48  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 49  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 50  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 51  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 52  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 53  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 54  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 55  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 56  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 57  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 58  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 59  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 60  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 61  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 62  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 63  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 64  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 65  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 66  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 67  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 68  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 69  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 70  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 71  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 153  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 154  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 155  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 156  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 157  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 158  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 159  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 160  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 161  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 162  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 163  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 164  readed 4096
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 165  readed 5416
log: [HOST][DEBUG]: [PS4SH] took 0.460s
log: [PS4][DEBUG]: [PS4LINK] ps4link_file: file close req (fd: 8)
log: [PS4][DEBUG]: [PS4LINK] ps4link_close_file: close reply received (ret 0)
log: [PS4][DEBUG]: [ORBISLINK] orbisExecUserElf ready to run elf
log: [PS4][DEBUG]: [ORBISLINK] orbisUserRun malloc for argument
log: [PS4][DEBUG]: [ORBISLINK] orbisUserRun after malloc for argument
log: [PS4][DEBUG]: [ORBISLINK] orbisUserRun after ps4MemoryProtectedCreate
log: [PS4][DEBUG]: [ORBISLINK] orbisUserRun after ps4MemoryProtectedGetWritableAddress writable=21cea8000
log: [PS4][DEBUG]: [ORBISLINK] orbisUserRun after ps4MemoryProtectedGetExecutableAddress executable=21cea8000
log: [PS4][DEBUG]: [ORBISLINK] elfLoaderInstantiate in segments length=8
log: [PS4][DEBUG]: [ORBISLINK] elfLoaderInstantiate before elfLoaderInstantiate memcpy 21cea8040 21ce00040 448
log: [PS4][DEBUG]: [ORBISLINK] orbisMemoryCopy before memcpy
log: [PS4][DEBUG]: [ORBISLINK] orbisMemoryCopy after memcpy
log: [PS4][DEBUG]: [ORBISLINK] elfLoaderInstantiate after elfLoaderInstantiate memcpy
log: [PS4][DEBUG]: [ORBISLINK] elfLoaderInstantiate before elfLoaderInstantiate memcpy 21cea8200 21ce00200 28
log: [PS4][DEBUG]: [ORBISLINK] orbisMemoryCopy before memcpy
log: [PS4][DEBUG]: [ORBISLINK] orbisMemoryCopy after memcpy
log: [PS4][DEBUG]: [ORBISLINK] elfLoaderInstantiate after elfLoaderInstantiate memcpy
log: [PS4][DEBUG]: [ORBISLINK] elfLoaderInstantiate before elfLoaderInstantiate memcpy 21cea8000 21ce00000 452300
log: [PS4][DEBUG]: [ORBISLINK] orbisMemoryCopy before memcpy
log: [PS4][DEBUG]: [ORBISLINK] orbisMemoryCopy after memcpy
log: [PS4][DEBUG]: [ORBISLINK] elfLoaderInstantiate after elfLoaderInstantiate memcpy
log: [PS4][DEBUG]: [ORBISLINK] elfLoaderInstantiate before elfLoaderInstantiate memcpy 21d116ed0 21ce6eed0 152800
log: [PS4][DEBUG]: [ORBISLINK] orbisMemoryCopy before memcpy
log: [PS4][DEBUG]: [ORBISLINK] orbisMemoryCopy after memcpy
log: [PS4][DEBUG]: [ORBISLINK] elfLoaderInstantiate after elfLoaderInstantiate memcpy
log: [PS4][DEBUG]: [ORBISLINK] elfLoaderInstantiate before elfLoaderInstantiate orbisMemorySet
log: [PS4][DEBUG]: [ORBISLINK] orbisMemorySet before memset
log: [PS4][DEBUG]: [ORBISLINK] orbisMemorySet after memset
log: [PS4][DEBUG]: [ORBISLINK] elfLoaderInstantiate after elfLoaderInstantiate orbisMemorySet
log: [PS4][DEBUG]: [ORBISLINK] elfLoaderInstantiate before elfLoaderInstantiate memcpy 21d116ed0 21ce6eed0 304
log: [PS4][DEBUG]: [ORBISLINK] orbisMemoryCopy before memcpy
log: [PS4][DEBUG]: [ORBISLINK] orbisMemoryCopy after memcpy
log: [PS4][DEBUG]: [ORBISLINK] elfLoaderInstantiate after elfLoaderInstantiate memcpy
log: [PS4][DEBUG]: [ORBISLINK] elfLoaderInstantiate before elfLoaderInstantiate memcpy 21cf12558 21ce6a558 2836
log: [PS4][DEBUG]: [ORBISLINK] orbisMemoryCopy before memcpy
log: [PS4][DEBUG]: [ORBISLINK] orbisMemoryCopy after memcpy
log: [PS4][DEBUG]: [ORBISLINK] elfLoaderInstantiate after elfLoaderInstantiate memcpy
log: [PS4][DEBUG]: [ORBISLINK] elfLoaderInstantiate before elfLoaderInstantiate memcpy 21d116ed0 21ce6eed0 304
log: [PS4][DEBUG]: [ORBISLINK] orbisMemoryCopy before memcpy
log: [PS4][DEBUG]: [ORBISLINK] orbisMemoryCopy after memcpy
log: [PS4][DEBUG]: [ORBISLINK] elfLoaderInstantiate after elfLoaderInstantiate memcpy
log: [PS4][DEBUG]: [ORBISLINK] elfLoaderLoad  after elfLoaderInstantiate return=0
log: [HOST][DEBUG]: [PS4SH] Opening zweifeld.mod flags 0
log: [HOST][DEBUG]: [PS4SH] Open return 8
log: [PS4][DEBUG]: [ORBISLINK] elfLoaderLoad after elfLoaderRelocate return=0
log: [PS4][DEBUG]: [ORBISLINK] orbisUserRun after elfLoaderLoad return r=0 readable=21cea8000 executable=21cea8000
log: [PS4][DEBUG]: [ORBISLINK] orbisUserRun after set argument->main 21cedf050 
log: [PS4][DEBUG]: [ORBISLINK] orbisUserRun after elfDestroyAndFree 
log: [PS4][DEBUG]: [ORBISLINK] New user elf thread UID: 0x81D06040
log: [PS4][DEBUG]: [ORBISLINK] orbisUserMain Configuration pointer 32c7e518, pointer_conf string 32c7e518
log: [PS4][INFO]: debugnet already initialized using configuration from ps4link
log: [PS4][INFO]: debugnet_initialized=1 SocketFD=13 logLevel=3
log: [PS4][INFO]: ready to have a lot of fun...
log: [PS4][INFO]: ps4link already initialized using configuration from ps4link
log: [PS4][INFO]: ps4link_fileio_active=1
log: [PS4][INFO]: ps4link_cmdsio_active=1
log: [PS4][INFO]: ps4link_initialized=1
log: [PS4][INFO]: ps4link_requests_port=18193
log: [PS4][INFO]: ps4link_commands_port=18194
log: [PS4][INFO]: ps4link_debug_port=18194
log: [PS4][INFO]: ps4link_fileio_sock=15
log: [PS4][INFO]: ps4link_requests_sock=14
log: [PS4][INFO]: ps4link_commands_sock=16
log: [PS4][DEBUG]: [PS4LINK] Initialized and connected from pc/mac ready to receive commands
log: [PS4][DEBUG]: liborbisPad already initialized using configuration external
log: [PS4][DEBUG]: orbispad_initialized=1
log: [PS4][DEBUG]: ready to have a lot of fun...
log: [PS4][DEBUG]: liborbis2d already initialized using configuration external
log: [PS4][DEBUG]: orbis2d_initialized=1
log: [PS4][DEBUG]: ready to have a lot of fun...
log: [PS4][DEBUG]: caching framebuffersize: 3686400b
log: [PS4][DEBUG]: liborbisaudio already initialized using configuration external
log: [PS4][DEBUG]: orbisaudio_initialized=1
log: [PS4][DEBUG]: ready to have a lot of fun...
log: [PS4][DEBUG]: [PS4LINK] file open req (host0:zweifeld.mod, 0 0)
log: [PS4][DEBUG]: [PS4LINK] file open reply received (ret 8)
log: [PS4][DEBUG]: [PS4LINK] file lseek req (fd: 8)
log: [HOST][DEBUG]: [PS4SH] 34148 result of lseek 0 offset 2 whence
log: [PS4][DEBUG]: [PS4LINK] ps4link_lseek_file: lseek reply received (ret 34148)
log: [PS4][DEBUG]: [PS4LINK] file lseek req (fd: 8)
log: [HOST][DEBUG]: [PS4SH] 0 result of lseek 0 offset 0 whence
log: [PS4][DEBUG]: [PS4LINK] ps4link_lseek_file: lseek reply received (ret 0)
log: [HOST][DEBUG]: [PS4SH] read 34148 bytes of file descritor 8
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: Reply said there's 34148 bytes to read (wanted 34148)
log: [PS4][DEBUG]: [PS4LINK] ps4link_read_file: chunk 0  readed 34148
log: [PS4][DEBUG]: [PS4LINK] ps4link_file: file close req (fd: 8)
log: [HOST][DEBUG]: [PS4SH] took 0.033s
log: [PS4][DEBUG]: [PS4LINK] ps4link_close_file: close reply received (ret 0)
log: [PS4][DEBUG]: In play 0
log: [PS4][DEBUG]: In play m_bPlaying 1
log: [PS4][DEBUG]: orbis2dDumpBuffer()
ps4sh> 

If everything worked correctly, you shouls see the demo running on your PS4 - the ps4sh shell might also hint you when somethings not right.

That blog post now concludes how you can execute own code on your ps4 with the help of an OpenSource SDK.

Good luck and show me your results sometime! :)

  • [x] SDK installation
  • [x] Write and compile first own code
  • [x] Execute on PS4