How To Add App And Elf In Opl
Samba networking with OPL on a Sony Playstation 2 SPCH-90010
2021-05-13
(last time edited: 2021-09-17)
tags: vidya, softmodding, linux
In this guide I will explain the usage of:
- FreeDVDBoot
The DVD burned with FreeDVDBoot will be read even if your PlayStation 2 is unmodded. FreeDVDBoot launches wLaunchELF (a simple file manager).
- wLaunchELF
With this file manager we will proceed to execute an ELF file stored in one of our USB drives connected to the PS2. The executable will be OpenTuna.
- OpenTuna
OpenTuna is a program made to exploit our PS2 and install Open PS2 Loader (OPL) in our original 8MB Memory Card. OpenTuna was written by alexparrado from scratch and by reverse engineering a previously closed source exploit called Fortuna. Info Technical Information
- Open PS2 Loader (OPL)
Once OpenTuna have been executed, OPL will populate in our Memory Card. We will use the Open PS2 Loader to play games and run programs.
- Samba
Samba is a very well known daemon program for file sharing. OPL can connect to any device running Samba (any computer or Raspberry Pi, whatever) and retrieve ISO files containing PS2 video games.
Introduction
Notice! This guide can be followed successfully from start to end using any kind of Linux system. The whole setup works perfectly and was fully tested with Linux. I can assure this guide is also possible to be followed from a Windows system but I won't help you finding alternatives for certain tips. Use a Linux distribution at all costs.
So I bought this infamous -kinda used- Sony PlayStation 2 model SPCH-90010 (NTSC) that lots of idiots on the Internet talk about it saying "nooo don't buy that! it's impossible to hack! u dun goofed bro".
Here is this blog post to prove that some people, whose names always get lost in the empty void of nothingness, worked their ass off to soft mod it and proven that is possible to play video games on it without hacking it physically with a nasty chinese chip.
FreeDVDBoot
FreeDVDBoot allows you to burn your own PlayStation 2 homebrew discs and play them on an unmodified console as seen in the demo video. With wLaunchELF as the initial program, users can include multiple homebrew programs on the same disc.
With FreeDVDBoot we will be able to run wLaunchELF (which is a binary program that comes included in FreeDVDBoot) and then install OpenTuna into an official 8MB PS2 Memory Card.
Download the .iso image.
And then burn it on a brand new and virgin DVD-R using growisofs. If you are not using Linux, what the fuck are waiting for?
# growisofs -dvd-compat -speed=1 -Z /dev/sr0=/path/too/downloaded_image.iso
It's better to use the lowest burning speed just in case. I happened to have a Thinkpad T420 that saved me with this task.
Before inserting the disc in the PS2 we need to build a FAT32 USB drive and put OpenTuna in it.
OpenTuna
OpenTuna is an open source version of Fortuna. While Fortuna was merely a proof of concept, OpenTuna was made having future development in mind:
- It is made to be easy to use by the user. We included an easy to use installer were you only need to press X to install it.
- Also, we included OPL on the release package, so you are ready to play once you install it.
- It allows embedding compressed and uncompressed executables to the exploit icon
- Since it is open source, it will allow porting it to other hardware versions, including TEST consoles.
- Compatibility:
- Every Slim PS2 Console (SCPH-700XX, 750XX, 770XX, 790XX, 900XX)
- PS2 TV
- Only one specific FAT console model: SCPH-500XX with BIOS v1.90
We will use fdisk to partition the USB drive.
First check which drive was assigned to your USB using lsblk.
$ lsblk
This is what appears on my host machine so in my case I will be targeting sdc.
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 XXX.XG disk ...... sdb 8:16 0 XXX.XG 0 disk ...... sdc 8:32 1 7.3G 0 disk Then partition.
# fdisk -w always -W always /dev/sdX
Create a new DOS disklabel.
Command (m for help): o Created a new DOS disklabel with disk identifier 0x59640b34. Just create a single partition, who cares.
Command (m for help): n Partition type p primary (0 primary, 0 extended, 4 free) e extended (container for logical partitions) Select (default p): ENTER Partition number (1-4, default 1): ENTER First sector (2048-15248831, default 2048): ENTER Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-15248831, default 15248831): ENTER Created a new partition 1 of type 'Linux' and of size XXXX.XXX. Add W95 FAT32 type to the partition.
Command (m for help): t Selected partition 1 Hex code or alias (type L to list all): 0b Changed type of partition 'Linux' to 'W95 FAT32'. Write changes.
Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. Now we need to format the drive with FAT32 filesystem.
# mkfs.vfat -F 32 /dev/sdX1
Download OpenTuna v1, click here to download: link. These files ARE NOT hosted on my server.
v1.0.2 is the latest version up to May 26, 2021.
Unzip to extract the files.
$ unzip /path/to/opentuna.zip
You only need to copy the .ELF file to the USB drive. But first mount the drive.
# mkdir /mnt/fat32usb
# mount /dev/sdX1 /mnt/fat32usb
Copy the OpenTuna installer.
# cp /path/to/OpenTuna_Installer_v1B_FINAL.ELF /mnt/fat32usb
Unmount the USB drive.
# umount /mnt/fat32usb
Now you can remove the USB drive from the USB port.
Ok, insert the FreeDVDBoot DVD in the PS2 and insert the USB drive we built. Time to pray.
wLaunchELF
wLaunchELF, formerly known as wLaunchELF, also known as wLE or uLE (abbreviated), is an open source file manager and executable launcher for the Playstation 2 console based off of the original wLaunchELF. It contains many different features, including a text editor, hard drive manager, as well as network support, and much more.
There isn't much to say about wLaunchELF. It's a nice graphical file manager and environment that lets us copy, move, execute and do certain tasks with the data found in our Memory Card or in the USB drive.
Like I said, this program binary comes included in FreeDVDBoot.
Once we are in wLaunchELF we are able to install OpenTuna to the Memory Card.
So the SPCH-90010 can be soft modded unlike people said. I took these screenshots using an elgato capture device.
It is preferable that your Memory Card is already empty.
Press circle and navigate to mass:/ directory.
Execute OpenTuna and you will be prompted to press X or circle.
Once the installation is done go to your Memory Card and you'll see an invisible Corrupted Data item.
Press circle 2 times on it.
This action will execute OPL v1.0.0 which was packed inside OpenTuna and installed inside your Memory Card.
OPTIONAL! ...and very important. If for some reason you want to use wLaunchELF again, press circle on the invisible Corrupted Data item, and then HOLD circle until wLaunchELF is executed and shown on screen.
Interesting notes:
If you were wondering why some people call it LaunchELF (LE), uLaunchELF (uLE); wLaunchELF (wLE)... here is some information taken from this post by Jay-Jay on the PS2 Homebrew and Tools site regarding the history of this program.
-
LaunchELF (LE) = The original LaunchELF project was by Mirakichi, who worked on versions prior to v3.41.
-
uLaunchELF (uLE) = the "u" stands for "unofficial" meaning: Unofficial LaunchELF. After Mirakichi stopped working on LaunchELF, E P and dlanor worked on unofficial LaunchELF (wLaunchELF) up to v4.42d.
-
wLaunchELF (wLE) = the "w" stands for "double-u" meaning: Double-unofficial LaunchELF. Due to real-life commitments, both E P and dlanor have been on a hiatus for quite a few years. Double-unofficial LaunchELF (wLaunchELF) is a new project by AKuHAK and SP193 that continues to bring new updates to our favorite file manager to the PlayStation 2. -- Plus this is the version that started to support 2TB HDDs.
There are other file managers alternatives such as LbFn but I haven't tried that one yet. wLaunchELF is the most common and stable with lots of development to this date.
OPL (Open PS2 Loader)
Open PS2 Loader (OPL) is a 100% open source game and application loader for the PS2 and PS3 units. It supports three categories of devices : USB mass storage devices, SMB shares and the PlayStation 2 HDD unit. USB devices and SMB shares support USBExtreme and *.iso formats while PS2 HDD supports HDLoader format. It's now the most compatible homebrew loader.
OPL is also developed continuously - anyone can contribute improvements to the project due to its open source nature.
Notice! OPL only plays PS2 games. I learned this the hard way.
This is the welcoming loading intro.
This is the main menu.
This is the about section with information of the programmers and program versioning, etc.
Samba
Samba is a free software re-implementation of the SMB networking protocol, and was originally developed by Andrew Tridgell. Samba provides file and print services for various Microsoft Windows clients and can integrate with a Microsoft Windows Server domain, either as a Domain Controller (DC) or as a domain member. As of version 4, it supports Active Directory and Microsoft Windows NT domains.
To the moment I'm writing this blog post I'm using the 4.13.4 version of Samba.
Here comes the tricky part if you are not very into the basics of networking. We need to run the Samba server in our computer/workstation to share our .iso games across the network. Grab an ethernet cable and ram it in!
I can assure this networking configuration is very simple. Basically we need to connect our OPL (especifically the Samba client that runs within OPL) to our computer, where the games are located at. Our router will be the middle-man.
This is my current routing configuration. Just a DHCP server that connects my multiple home devices.
In your host machine create an OPL share directory to serve all games. Create it with 770 permissions. If you don't know much about file permissions check out this beautiful chmod calculator, it's very handy for newbies.
$ mkdir -m 770 /home/your_username/OPL
770 is the same as rwxrwx--- which means:
- rwx: users can read, write and execute.
- rwx: group can read, write and execute.
- ---: others cannot read, cannot write and cannot execute.
If the OPL directory was already created then just chmod it.
$ chmod -v 770 /path/to/OPL
Now create a common share group.
In Void Linux:
# groupadd sambagroup
In Alpine Linux:
# addgroup sambagroup
And change the GID of the directory.
$ chgrp sambagroup /home/your_username/OPL
And give execution rights to your home dir so group members can have access to your OPL dir. Usually this is not necessary because the default home directory permissions are 755.
$ chmod 710 /home/your_username
And add sambagroup to your home dir too. This is absolutely not necessary when your home dir permissions is 755.
$ chgrp sambagroup /home/your_username
In this guide I opted NOT to create a guest account to connect to Samba server. It's not worth the risk. We are going to create a separate UNIX user.
Create a new user. Let's call it opllogin. You can call it whatever you want.
In Void Linux:
# useradd -M -s /bin/false -G sambagroup opllogin
In Alpine Linux:
# adduser -H -s /bin/false -G sambagroup opllogin
And add your daily UNIX user to the same group. This is necessary to move files between directories.
In Void Linux:
# usermod -G sambagroup -a your_username
In Alpine Linux:
# addgroup your_username sambagroup
Create an opllogin group.
In Void Linux:
# groupadd opllogin
In Alpine Linux:
# addgroup opllogin
And add opllogin to the your_username group, so he can at least enter the directory and search for the games.
In Void Linux:
# usermod -G your_username -a opllogin
In Alpine Linux:
# addgroup your_username opllogin
Relogin to your your_username shell to make group permissions work and keep going.
Now add opllogin user in the Samba password database. It will be enabled instantly. No need to pass -e argument. Choose any password you like.
# smbpasswd -a opllogin
New SMB password: Retype new SMB password: Let's make a Samba server configuration now.
[global] log file = /tmp/samba/log.txt log level = 5 hosts allow = 192.168.1. server min protocol = NT1 ntlm auth = ntlmv1-permitted [ps2] path = /home/your_username/OPL writeable = true strict sync = false valid users = opllogin group = sambagroup create mask = 660 directory mask = 770 Now save this configuration somewhere. I prefer to save it in a file called ~/.config/samba/smb.conf and then run it as a normal user rather than a daemonized service (root).
Some basic explanation of what we are doing here.
- log file: useful to get verbose and check for Samba errors. You can use
tail -f /tmp/samba/log.txtto retrieve errors in realtime. - log level: level 5 to get more information about what's happening within the Samba server.
- hosts allow: option absolutely crucial for network security! We are specifying the hosts able to connect to our Samba server. 192.168.1 is the same as 192.168.1.* * as wildcard for all. This means only hosts in our local area network (LAN) will be able to reach our Samba server.
- server min protocol: support for old NT1 protocol also known as CIFS protocol in Windows and SMB1 in Samba. This is what OPL demands to be used otherwise it won't be able to retrieve shared files. Some explanation on SMB1 and why Samba wants to drop support for it soon.
- ntlm auth: this is the authentication protocol for NT1 or most commonly known as SMB1. ntlmv1 is required to login with a username and password.
- path: This is the directory we've created. This is where we are gonna store all our games and other cool stuff. This directory will be populated with 9 directories (APPS, ART, CD, CFG, CHT, DVD, LNG, THM, VMC) when OPL reaches it via Samba.
- writeable: OPL needs permissions to create directories, write our Memory Card saves and other stuff.
- strict sync: this option needs to be disabled otherwise you won't be able to save game states in the Virtual Memory Card (VMC) in OPL.
- valid users: opllogin is the user we created to manage security and permissions better.
- group: sambagroup is the group that your daily UNIX account shares in common with opllogin, this facilitates the handling of game files across directories.
- create mask: this option forces permissions for file creation, otherwise the user opllogin will create files in 644.
- directory mask: this option also forces permissions for directory creation, otherwise the user opllogin will create directories in 755 and we need group execution access to them. We need to be able to move files.
If you want more information on the smb.conf file use the manpages. The smb.conf manual page is very well documented and tells you the default values of every possible parameter.
$ man smb.conf
Totally Optional! Testparm is a program that comes included in the Samba package. This standalone program can be run wether Samba is running or not. It is useful for double checking our configuration syntax and default parameters.
To check for syntax errors in our configuration.
$ testparm -s /path/to/our_custom_smb.conf
To read default Samba parameter values.
$ testparm -sv | less
Now let's fill the all the information in the OPL Network Settings menu.
As you can see in the PS2 part of the screenshot:
- IP Address Type: DHCP, you can choose this or you can just static. I prefer to use DHCP and manage everything from my router.
- IP Address: 192.168.1.109 is the local IP address for the PS2. The DHCP client of the PS2 will be requesting that address to my router. For less hassle it's better to add that specific address in the address reservation list of the router.
- Mask: Ths is the subnet mask. The same one that I specified in the router, which comes by default in the router.
- Gateway: This is the router IP.
- DNS Server: Same as the gateway. DHCP will take care of the DNS addresses loaded on the router.
In the SBM server part:
- Address Type: OPL starts a Samba client to connect to our host, and there are at least 2 types of addresses to reach our host. Via NetBIOS and via IP. Via IP address is easier and the UNIX norm. If we wanted to use NetBIOS we need to start listening (most commonly known as open) from the netbios-ssn port (139/tcp). The IANA name of this port is shown when we do
grep "139/tcp" /etc/services. - Address: This is the IP address of my workstation where all my games are stored at. I tend to use 192.168.1.107 because it's my 7th machine and it's reserved permanently in the router's address reservation list.
- Port: 445 is the default port for Samba server. This port is privileged therefore Samba must run on root only. OPL doesn't let us to choose a higher (unprivileged/ephemeral) port than 1024. No idea why, but Samba has capabilities to be run as normal user.
- Share: This is name to our Samba virtual shared directory (you will see that below in the smb.conf). OPL fills this parameter by itself when the game list GUI is loaded and refreshed. There is no need to enter anything but do as you wish!
- User: We will not use guest accounts like most people do! That is extremely insecure. We are going to use a Samba account mapped to a UNIX user account with no privileges in our system.
- Password: The Samba user password we managed to create for opllogin using smbpasswd.
Let's keep going and execute Samba once and for all. We need to do it under root account. Pay attention to the argument, we are calling the configuration we saved before.
# smbd -s /path/to/smb.conf
For further debugging, if you wanna know if Samba is connecting OPL to our host machine, you can use ss, a program that comes in the iproute2 package for network information. ss can display socket information.
If you use Void Linux like me, you can start the Samba server / service daemon (smbd) by creating a conf file in /etc/sv/smbd. Runit will read it and pass the arguments.
First create the file.
# touch /etc/sv/smbd/conf
Open it with a text editor.
# vim /etc/sv/smbd/conf
Add the following text.
#!/bin/sh OPTS = "-s /path/to/smb.conf" And then you can just start the service by doing a symlink.
# ln -s /etc/sv/smbd /var/service
And use sv to manage the service.
For example:
# sv force-restart smbd
or
# sv force-stop smbd
The same idea of running Samba as a daemonized service can be done in Alpine Linux. Add the service to the default runtime.
# rc-update add samba default
Then configure the service just like we did in Void Linux (runit). This time we are using the OpenRC conventions.
# vim /etc/conf.d/samba
And edit the text adding the Samba personal config path. You could as well just leave smbd in the daemon_list because nmbd is not needed.
daemon_list = "smbd" smbd_options = "-D -s /path/to/your/custom/smb.conf` Another way of using a configuration file is by copying your config and replacing the original one. But this one is the lazy way to achieve it.
# cp /path/to/your/custom/smb.conf /etc/samba/smb.conf
To check if OPL is connecting to your Samba server.
# ss -lnt -o state established '( sport = :445 )'
To check if your PS2 has established connection with your Samba server.
$ ss dsn -n PS2_IP_HERE
Recv-Q Send-Q Local Address:Port Peer Address:Port Process 0 0 192.168.1.107:445 192.168.1.109:49153 timer:(keepalive,118min,0) - 192.168.1.107 is my workstation IP address in the LAN.
- 192.168.1.09 is the PlayStation 2 IP address in the LAN.
- 445 is the Samba port by default.
- 49153 is the Samba client port that OPL runs in the background..
Or you could just run this command as root which brings up also more information about the server, such as: protocol, encryption, signing, etc.
# smbstatus
Wrap these commands with watch -n 1 to refresh them with a second interval. For example:
# watch -n 1 smbstatus
or
# watch -n 1 ss -lnt -o state "established '( sport = :445 )'"
Time to play!
Now we need some games. If you download games like me from sketchy websites, you might get them compressed in .7z format rather than .iso format. No worries!
Let's convert our games to .iso easily using bchunk.
$ bchunk game.bin game.cue game
This works perfect with games that come in a single .bin. Some websites offer the same game in just 1 binary file, try to find them instead of trying to merge 2 .bin files. Most of the time this convertion won't work and OPL won't read them. I recommend you to search and download a different version of the same game from the Internet.
And store it in the CD or DVD directory depending on the game format. For example, Crazy Taxi was only released in CD-ROM, therefore it goes in the CD directory. OPL will detect them anyways no matter which directory you put them in, but let's keep things nice and tidy.
If everything went correctly, press start and you will see this image on screen. It shows ETH Games on the top middle, referring to the Samba networking via ethernet and it shows our games on the left.
Remember! Don't panic if your OPL freezes if you refresh the game list. Just reboot your console, remove certain .iso images that could possibly be messing with OPL and try refreshing the game list again. OPL cannot read some .iso files, and OPL cannot play PSX games either. Shadow of the Colossus, Crazy Taxi and many other games work perfectly! There are websites where people contribute adding information of compatible games with OPL and Samba.
If you wanna leave a game, press and hold L1 + L2 + R1 + R2 + select + start at the same time.
Applications
The Open PS2 Loader (OPL) is incredibly dynamic. We can run also little programs in .elf format.
To make this work first create a conf_apps.cfg file and place it in the OPL directory we use for Samba sharing.
And then with our favorite text editor add all the .elf programs manually, pointing to the file.
The pattern is very basic and simple: ANY_NAME=PATH
PadTest=smb:/APPS/padtest.elf RetroArch=smb:/APPS/retroarch/raboot.elf wLaunchELF=smb:/APPS/wlaunchelfv4.43a.elf All our ELF files need to be stored in the APPS directory and pointed correctly.
Some programs I currently use:
-
PadTest is a program to test joysticks in real time. Full credit to jbit of ps2dev.org. More info Mirror
-
RetroArch is a front-end to multiple emulators. You can download it from the RetroArch build bot. I know that RetroArch works correctly from a USB drive but it does not boot correctly from OPL's APPS menu with Samba. Development seems to be keep going thanks to ftrujy.
-
wLaunchELF standalone binary is a file manager for the PS2. I downloaded it from from here. I'm currently using the pre-release v4.34a. (4f9831d) (md5hash: 55d5b961ea7b1a8fbef0b8012722f509)
-
PS2Temps shows system temperature. This program was written by krat0s. Download it from here
Image taken by me 29/06/2021 showing my system temperature. It looks horrible but it works. Feels good to know temps are under 40°.
Updating OPL
First download the latest release from the Open-PS2-Loader releases uploaded in GitHub.
When I wrote this guide I was using the version 1.0.0. At the time of updating this guide I just updated to 1.1.0.
Once you download the .elf from the releases, copy it to a W95 FAT32 formatted partitioned USB. Then load wLaunchELF and replace the OPNPS2LD.ELF file with the new one.
Some interesting details:
-
Original PlayStation 4 wired controllers work perfectly using OPL's PADEMU (gamepad emulation).
-
Changing language inside the PS2 BIOS will also override the language of every game you load.
-
PAL games go by their ISO code S*ES_XXX.XX and NTSC games go by S*US_XXX.XX. Examples: SLES_517.99 and SLUS_208.85
-
Front cover artwork for each game goes in the OPL/ART directory. Dimensions should be 140x200, and filename should follow this pattern: SLES_502.13_COV.jpg, SCES_555.42_COV.jpg. A very simple way to resize your front covers is using ImageMagick this way:
$ convert /path/to/image.jpg -resize x200 /path/to/image.jpg
Happy gaming!
If this information was useful to you, please consider donating some Bitcoin to my address. It will make me stay motivated to document more *NIX information. The amount doesn't matter. Thank you.
19hpNfKrRBdzScXPhW6s3e88TMcqFcuNhy
How To Add App And Elf In Opl
Source: https://unblogmas.ar/41-ps2.html
Posted by: limonfordispreme.blogspot.com

0 Response to "How To Add App And Elf In Opl"
Post a Comment