Hacking Payload building

snoofly

Well-Known Member
OP
Member
Joined
Aug 18, 2015
Messages
1,012
Trophies
0
Age
54
XP
2,133
Country
United Kingdom
Hope this is the correct place for this kind of question.

I'm trying to build App2USB from source.

I'm using ps4-vtx-sdk as this seems to correct some unresolved references I had originally but I get following issue:
main.c:(.text+0x1707): undefined reference to `symlink'
and similarly for 'lstat' although I seem to have worked around it by using stat instead.

man symlink gives the include required as unistd.h but adding that conflicts with the ps4 header includes.
Also, I tried setting my compiler flags to gnu99 as opposed to gnu11 but still no luck.

Thanks in advance if anyone can help a poor lad out.

Edit: I should add all other payloads I can build fine, including vtx-hen, it's just App2USB giving me problem.
 

MostlyUnharmful

Well-Known Member
Member
Joined
Feb 8, 2018
Messages
410
Trophies
0
Age
42
XP
1,446
Country
Italy
He's definitely not using the ps4-vtx-sdk and he doesn't give instructions on how to build it, open an issue on his repository with something like "fails to build".

Try adding the following to the main.c but I don't know if the offsets of the syscalls are the same on FW 5.05 (assuming you are trying to build for FW 5.05):

Code:
int lstat(const char *pathname, struct stat *buf) {
    return syscall(190, pathname, buf);
}

int symlink(const char *pathname, const char *slink) {
    return syscall(57, pathname, slink);
}

I'm pretty sure this will result in a kernel panic.

Edit: you must use his forked PS4 SDK: https://github.com/stooged/ps4-payload-sdk/commit/db90f7b01e14c29ccba5dc4e1c86a9b84c1b86a4
 
Last edited by MostlyUnharmful,
  • Like
Reactions: KiiWii

snoofly

Well-Known Member
OP
Member
Joined
Aug 18, 2015
Messages
1,012
Trophies
0
Age
54
XP
2,133
Country
United Kingdom
He's definitely not using the ps4-vtx-sdk and he doesn't give instructions on how to build it, open an issue on his repository with something like "fails to build".

Try adding the following to the main.c but I don't know if the offsets of the syscalls are the same on FW 5.05 (assuming you are trying to build for FW 5.05):

Code:
int lstat(const char *pathname, struct stat *buf) {
    return syscall(190, pathname, buf);
}

int symlink(const char *pathname, const char *slink) {
    return syscall(57, pathname, slink);
}

I'm pretty sure this will result in a kernel panic.

Edit: you must use his forked PS4 SDK: https://github.com/stooged/ps4-payload-sdk/commit/db90f7b01e14c29ccba5dc4e1c86a9b84c1b86a4
Many thanks man.
I’ll give it a go very soon and let you know.
:)

Yep, that commit basically added in the refs you mention before.
I tried it from from a clean slate and it worked fine.
Now to test it out proper once I've made some edits for usb1 support.
 
Last edited by snoofly,
  • Like
Reactions: KiiWii

snoofly

Well-Known Member
OP
Member
Joined
Aug 18, 2015
Messages
1,012
Trophies
0
Age
54
XP
2,133
Country
United Kingdom
Great. Got it working fine.
I can now load up games to 2 different HDDs connected at same time and run them at will.

Configure 2 drives, original with bunch of stuff, second drive as a test with Terraria.
2nd drive has ps4/AppsToUSB.ini MODE_MOVE uncommented so I can specify only the game I want to move CUSA00740 - just in case..

1. Plugged in main HDD to left port. -> usb0
2. Waited a bit, plugged second drive to right front port
3. Check via ftp mnts are as expected.
4. Load Hen, install Terraria
5. Check it works
6. Load Hen, send my USB1 recompiled Apps2USB payload
7. Terraria works.
8. Unplug usb0 drive.
9. Terraria works.
10. Unplug usb1 drive.
11. Data is corrupted.

Thanks again to @MostlyUnharmful for the critical tip.
 

snoofly

Well-Known Member
OP
Member
Joined
Aug 18, 2015
Messages
1,012
Trophies
0
Age
54
XP
2,133
Country
United Kingdom
You don't plan to share your .bin for those who might be interested in it?
I could of course but not sure about all the shenanigans of GPL licensing with source etc, whether I should officially fork or whatever.
I haven't got into all that before and I don't want to put stooged or anyone elses nose out of joint.
This was really just for a quick proof of concept.

It's simple enough to recompile your own.
Grab stoogeds forked PS4SDK https://github.com/stooged/ps4-payload-sdk/commit/db90f7b01e14c29ccba5dc4e1c86a9b84c1b86a4
Check ModdedWarfare vids how to compile PS4SDK stuff in VirtualBox or VM under Ubuntu - I use VM Player 14 with Ubuntu 16.04
Setup the SDK as per the video (set env var PS4SDK to the SDK download home, make the .a's for libPS4 and libusbfatfs - done)
Edit main.c in App2USB replacing all references to USB0/usb0 to USB1/usb1
run .clean.sh then .build.sh (you may need to sudo bash prior)
netcat or whatever your new payload built in the bin folder.
 

jakkal

Well-Known Member
Member
Joined
Apr 27, 2018
Messages
2,303
Trophies
1
Age
44
XP
3,982
Country
United States
Here is a compiled App2USB bin that copies to USB1 instead of zero for anyone who wants to test
you have to set your move command in the ini as per usual

at work now so i cant test but im very excited to test it out when I get home

source: https://github.com/jakkal876/AppToUsb-50X-1
 

Attachments

  • AppToUsb1.zip
    9.1 KB · Views: 84
Last edited by jakkal,
  • Like
Reactions: KiiWii and snoofly

troelsdk

New Member
Newbie
Joined
Aug 8, 2006
Messages
2
Trophies
0
XP
12
Country
Yes I did. Sorry if I was not precise.

I meant if anyone got the compiled version from Jakkal to work.

But I actually got it to work in the end. Thanks.
 

snoofly

Well-Known Member
OP
Member
Joined
Aug 18, 2015
Messages
1,012
Trophies
0
Age
54
XP
2,133
Country
United Kingdom
Yes I did. Sorry if I was not precise.

I meant if anyone got the compiled version from Jakkal to work.

But I actually got it to work in the end. Thanks.
Sure, I see, no problem. Glad to hear it’s working for you.
I may soon need to recompile a usb2 payload lol...
 
  • Like
Reactions: troelsdk

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    cearp @ cearp: Welcome hazbeans