PS3MFW Builder

From PS3 Developer wiki
Revision as of 03:16, 21 August 2011 by Euss (talk | contribs)
Jump to navigation Jump to search


Main description

Tasks

PS3MFW Builder v0.2

PS3MFW Builder v0.2 OtherOS++

PS3MFW Builder v0.2 Rebug OtherOS++

PS3MFW

  • PS3MFW *
    • add_license_msg.tcl (0.1) - Add a custom message to the 'New Features' installation screen. Modifies PUP license.xml --license-auto-add-features : Automatically generate the enabled features of PS3MFW --license-features-message : Prefix message to the generated features list --license-message : New Features message (Appears after the license agreement)
    • broken_bluray.tcl (0.2) – Allows you to remove Blu-Ray firmware installation so that the MFW can be installed without a working Blu-Ray drive. This is potentially dangerous if used on a PS3 with a working drive, and should only be used if the drive is broken.
    • change_coldboot_files.tcl (0.2) – Advanced users only: Allows changing the sound played and image shown during the boot process. Caution: If improper files are used, this can cause a “brick”.
    • change_devflash_files.tcl
    • change_ssl_cer.tcl (0.2) – Allows changing of SSL certificates.
    • change_theme.tcl (0.2) – Can be used to replace the default "Airbrush" theme with another theme file (.p3t format).
    • change_version.tcl
    • clean_friends.tcl (0.1) - Clean unwanted icons from the XMB Friends Category. Modifies dev_flash/vsh/resource/explore/xmb/category_friends.xml file --clean-friends-avcroom : Remove "Video Chat" icon from the XMB Friends Category --clean-friends-chat : Remove "Chat Room" icon from the XMB Friends Category --clean-friends-message-box : Remove "Message Box" icon from the XMB Friends Category --clean-friends-nas : Remove "My Profile" icon from the XMB Friends Category --clean-friends-new-chat : Remove "New Chat" icon from the XMB Friends Category
    • clean_game.tcl (0.1) - Clean unwanted icons from the XMB Game Category. Modifies dev_flash/vsh/resource/explore/xmb/category_game.xml file --clean-game-gamedata : Remove "Game Data" icon from the XMB Game Category --clean-game-mcutility : Remove "Memory Card Utility (PS/PS2)" icon from the XMB Game Category --clean-game-minis-manual : Remove "Minis Manual" icon from the XMB Game Category --clean-game-sdps3 : Remove "Saved Data Utility (PS3)" icon from the XMB Game Category --clean-game-sdpsp : Remove "Saved Data Utility (minis)" icon from the XMB Game Category --clean-game-trophy : Remove "Trophy Collection" icon from the XMB Game Category --clean-game-welcome : Remove "PlayStation Store" icon from the XMB Game Category
    • tasks/clean_music.tcl (0.1) - Clean unwanted icons from the XMB Music Category. Modifies dev_flash/vsh/resource/explore/xmb/category_music.xml file --clean-music-dlna-device : Remove "Network Media Servers" icon from the XMB Music Category --clean-music-dlna-scan : Remove "Search for Media Servers" icon from the XMB Music Category --clean-music-welcome : Remove "PlayStation Store" icon from the XMB Music Category
    • clean_network.tcl (0.1) - Clean unwanted icons from the XMB Network Category. Modifies dev_flash/vsh/resource/explore/xmb/category_network.xml file --clean-network-browser : Remove "Internet Browser" icon from the XMB Network Category --clean-network-folding-at-home : Remove "Life with PlayStation" icon from the XMB Network Category --clean-network-kensaku : Remove "Internet Search" icon from the XMB Network Category --clean-network-manual : Remove "Online Instruction Manuals" icon from the XMB Network Category --clean-network-premo : Remove "Remote Play" icon from the XMB Network Category
    • clean_photo.tcl (0.1) - Clean unwanted icons from the XMB Photo Category. Modifies dev_flash/vsh/resource/explore/xmb/category_photo.xml file --clean-photo-dlna-device : Remove "Network Media Servers" icon from the XMB Photo Category --clean-photo-dlna-scan : Remove "Search for Media Servers" icon from the XMB Photo Category --clean-photo-hakoniwa : Remove "Photo Gallery" icon from the XMB Photo Category --clean-photo-screenshot : Remove "Screenshot" icon from the XMB Photo Category
    • clean_psn.tcl (0.1) - Clean unwanted icons from the XMB PlayStation Network Category Modifies dev_flash/vsh/resource/explore/xmb/category_psn.xml file --clean-psn-commerce-new : Remove "What's New" icon from the XMB PlayStation Network Category --clean-psn-home : Remove "PlayStation Home" icon from the XMB PlayStation Network Category --clean-psn-regist : Remove "Sign In" icon from the XMB PlayStation Network Category --clean-psn-welcome : Remove "PlayStation Store" icon from the XMB PlayStation Network Category
    • clean_sysconf.tcl
    • clean_tv.tcl
    • clean_video.tcl (0.1) - Clean unwanted icons from the XMB Video Category. Modifies dev_flash/vsh/resource/explore/xmb/category_video.xml file --clean-video-bddata-mgmt : Remove "BD Data Utility" icon from the XMB Video Category --clean-video-dlna-device : Remove "Network Media Servers" icon from the XMB Video Category --clean-video-dlna-scan : Remove "Search for Media Servers" icon from the XMB Video Category --clean-video-editingvideo-mgmt : Remove "Video Editor & Uploader" icon from the XMB Video Category --clean-video-netflix : Remove "Netflix" icon from the XMB Video Category --clean-video-welcome : Remove "PlayStation Store" icon from the XMB Video Category
    • patch_category_game.tcl (0.1) - Add new icons to the XMB Game category. Modifies dev_flash/vsh/resource/explore/xmb/category_game.xml file --patch-package-files : Add "Install Package Files" icon to the XMB Game Category --patch-app-home : Add "/app_home" icon to the XMB Game Category
    • patch_lv1.tcl (0.1) - Patch LV1 hypervisor. Modifies CORE OS lv1.self --patch-lv1-mmap : Allow mapping of any memory area (Needed for LV2 Poke)
    • patch_lv2.tcl (0.1) - Patch LV2 kernel. Modifies CORE OS lv1.self --patch-lv2-peek-poke : Patch to add Peek&Poke system calls to LV2
    • patch_nas_plugin.tcl (0.1) - Patch package installer Modifies dev_flash/vsh/module/nas_plugin.sprx --allow-debug-pkg : Patch to allow installation of debug packages --allow-pseudoretail-pkg : Patch to allow installation of pseudo-retail packages
    • patch_privacy.tcl (0.2) – PS3 collects a large amount of personal information while it’s operating. Additionally personal information is sent to many domain names when internet access is enabled (unrelated to PSN access). This task prevents PS3 from sending any data to the domain names you select.
    • patch_shop.tcl (0.2) – Creates firmware to transform demo PS3s (the units used in stores) into full retail PS3s, without the need for service mode!
    • patch_translations.tcl
    • patch_vsh.tcl (0.1) - Patch Application launcher. Modifies dev_flash/vsh/module/vsh.self --allow-unsigned-app : Patch to allow running of unsigned applications
    • patch_xmb_plugin.tcl
    • spoof_version.tcl (0.2) – Allows changing the firmware version the PS3 appears to be on, similar to the rebug spoofer.



Gitbrew OtherOS++

  • Gitbrew OtherOS++ *
    • add_license_msg.tcl
    • broken_bluray.tcl
    • change_coldboot_files.tcl
    • change_devflash_files.tcl
    • change_ssl_cer.tcl
    • change_theme.tcl
    • change_version.tcl
    • clean_friends.tcl
    • clean_game.tcl
    • clean_music.tcl
    • clean_network.tcl
    • clean_photo.tcl
    • clean_psn.tcl
    • clean_sysconf.tcl
    • clean_tv.tcl
    • clean_video.tcl
    • patch_category_game.tcl
    • patch_emer_init.tcl
    • patch_lv1.tcl
    • patch_lv2.tcl
    • patch_nas_plugin.tcl
    • patch_privacy.tcl
    • patch_profile.tcl
    • patch_shop.tcl
    • patch_translations.tcl
    • patch_vsh.tcl
    • patch_xmb_plugin.tcl
    • spoof_version.tcl


Rebug OtherOS++

..


PSheb project

Guide for adding other translations / building languagepacks

This guide will explain you how to translate the XMB and use language_pack.tcl PS3MFW task.

LP structure:

font/name_of_the_font_file_to_replace.TTF
replace/name_of_the_rco_file.xml
edit/name_of_the_rco_file/language_name.xml

1. Create a folder – this will be our working directory.

2. If the language you want to translate XMB to is using unsupported font glyphs, you’ll have to include a modified PS3 font.

How to add glyphs to fonts?
I personally use font creator, open 2 fonts: the one I want to modify, and another one that contains the glyphs that I want to add.
Than all I need to do is to copy & paste the glyphs from one font to the other, and assign any glyph to it’s letter.
  • I modify “SCE-PS3-DH-R-CGB.TTF”, but this should work with any font.
When you finished modifying your font, create the folder “font” inside your working directory, and put you modified font in there.

3. Extract language XML files from RCO files

Here you have two options:
1) Extract them one by one using RCOmage (CLI or GUI).
2) Using LP_RCO to automatically extract language XML files from all RCO files (or writing your own script).
  • For those who doesn’t use LP_RCO:
You should extract only one language file from each RCO file (for example “English.XML”).
name each language file by the RCO file it was extracted from.
Now create a folder named “replace” in your working directory, and place all the extracted language files in it.

4. The translation itself

This is the exhausting stage, where you should just translate any string in the language files you extracted in charter 3.
  • You should translate only the string between the and tags.
You could let Google to translate it for you, but then you’ll have to fix formatting and all Sony’s “special” glyphs (such as the “cross” symbol), and of course to correct all the typos.

5. Packing everything into LP

Use any tar compression tool, and compress the root of your working directory, and named it “name.LP”.

6. The “edit option”:

There is also the “edit” option in language_pack.tcl task, which allow you to fix typos in several RCOs and languages.
Create a folder named “edit” inside you working directory.
Extract the language XML files you want to edit, and put them inside a directory named by the RCO file they extracted from.
Now all you got to do is to edit the language files.

7. All you need now is to build your MFW with your new language pack!

Take attention that you don’t have to include any of those folders inside your LP – include them only if you want to use their function.

source: http://www.ps3hax.net/2011/08/xmb-translation-guide/ (thanks to DanyL for this fine explaination :) )


more Spoof

Copypaste and save as spoof_version.tcl in tasks folder:

#!/usr/bin/tclsh
#
# ps3mfw -- PS3 MFW creator
#
# Copyright (C) Anonymous Developers (Code Monkeys)
#
# This software is distributed under the terms of the GNU General Public
# License ("GPL") version 3, as published by the Free Software Foundation.
#

# Priority: 2600
# Description: Spoof firmware build / version

# Option --spoof: Select firmware version to spoof
# Type --spoof: combobox { {1.02 1788 001:CEX-ww 20061021} {3.00 34641 001:CEX-ww 20090829} {3.01 35108 001:CEX-ww 20090910} {3.10 37233 001:CEX-ww 20091113} {3.15 38031 001:CEX-ww 20091206} {3.20 39999 001:CEX-ww 20100128} {3.21 41486 001:CEX-ww 20100320} {3.30 42164 001:CEX-ww 20100414} {3.40 44261 001:CEX-ww 20100623} {3.41 45039 001:CEX-ww 20100721} {3.42 45831 001:CEX-ww 20100901} {3.50 46135 001:CEX-ww 20100913} {3.55 47516 001:CEX-ww 20101127} {3.56 48246 001:CEX-ww 20110129} {3.60 48686 001:CEX-ww 20110304} {3.61 49561 001:CEX-ww 20110428} {3.65 49764 001:CEX-ww 20110513} {3.66 50527 001:CEX-ww 20110616} {3.70 51968 001:CEX-ww 20110805} }

namespace eval ::spoof_version {

    array set ::spoof_version::options {
      --spoof "3.70 51968 001:CEX-ww 20110805"
    }

    proc main {} {
      variable options

      set release [lindex $options(--spoof) 0]
      set build [lindex $options(--spoof) 1]
      set target [lindex $options(--spoof) 2]
      set auth [lindex $options(--spoof) 1]
      set bdate [lindex $options(--spoof) 3]

      if {$release != "" || $build != "" || $target != "" || $auth != ""} {
        log "Changing firmware version.txt & index.dat file"
        ::modify_devflash_file [file join dev_flash vsh etc version.txt] ::spoof_version::version_txt
      }
      if {$build != "" || $auth != ""} {
        log "Patching vsh.self"
        ::modify_devflash_file [file join dev_flash vsh module vsh.self] ::spoof_version::patch_self
      }
      if {$build != "" && $bdate != ""} {
        log "Patching UPL.xml"
        ::modify_upl_file ::spoof_version::upl_xml
      }
    }

    proc patch_self {self} {
      ::modify_self_file $self ::spoof_version::patch_elf
    }

    proc patch_elf {elf} {
      variable options

      set release [lindex $options(--spoof) 0]
      set build [lindex $options(--spoof) 1]

      log "Patching [file tail $elf] to spoof version and build"

      debug "Patching version number"
      set search "99.99"
      debug "search: $search"
      set major [lindex [split $release "."] 0]
      set minor [lindex [split $release "."] 1]
      set replace "[format %0.2d ${major}].[format %0.2d ${minor}]"
      debug "replace: $replace"
      catch_die {::patch_elf $elf $search 0 $replace} "Unable to patch self [file tail $elf]"

      debug "Patching build number"
      set search "[format %0.5d [::get_pup_build]]"
      debug "search: $search"
      set replace "[format %0.5d $build]"
      debug "replace: $replace"
      catch_die {::patch_elf $elf $search 0 $replace} "Unable to patch self [file tail $elf] with [::hexify $replace]"

#      debug "Patching 0x31a7c0" 
#      set search "\x48\x00\x00\x38\xa0\x7f\x00\x04\x39\x60\x00\x01"
#      set replace "\x38\x60\x00\x82"
#      catch_die {::patch_elf $elf $search 4 $replace} "Unable to patch self [file tail $elf]"

#      debug "Patching ..."
#      set search "\x4b\xff\xfe\x80\xf8\x21\xff\x81\x7c\x08\x02\xa6\x38\x61\x00\x70"
#      set replace "\x38\x60\x00\x01\x4e\x80\x00\x20"
#      catch_die {::patch_elf $elf $search 4 $replace} "Unable to patch self [file tail $elf]"

      debug "Patching 0x48d030"
      set search    "\xeb\xe1\x00\x80\x38\x21\x00\x90\x7c\x08\x03\xa6\x4e\x80\x00\x20"
      append search "\xf8\x21\xff\x61\x7c\x08\x02\xa6\xfb\xe1\x00\x98\xf8\x01\x00\xb0"
      append search "\x7c\x7f\x1b\x78\x38\x00\x00\x00\x38\x61\x00\x74\xfb\x81\x00\x80"
      set replace "\x38\x60\x00\x00\x4e\x80\x00\x20"
      catch_die {::patch_elf $elf $search 16 $replace} "Unable to patch self [file tail $elf]"
    }

    proc get_fw_release {filename} {
      debug "Getting firmware release from [file tail $filename]"
      set results [grep "^release:" $filename]
      set release [string trim [regsub "^release:" $results {}] ":"]
      return [string trim $release]
    }

    proc get_fw_build {filename} {
      debug "Getting firmware build from [file tail $filename]"
      set results [grep "^build:" $filename]
      set build [string trim [regsub "^build:" $results {}] ":"]
      return [string trim $build]
    }

    proc get_fw_target {filename} {
      debug "Getting firmware target from [file tail $filename]"
      set results [grep "^target:" $filename]
      set target [regsub "^target:" $results {}]
      return [string trim $target]
    }

    proc get_fw_auth {filename} {
      debug "Getting firmware auth from [file tail $filename]"
      set results [grep "^auth:" $filename]
      set auth [string trim [regsub "^auth:" $results {}] ":"]
      return [string trim $auth]
    }

    proc version_txt {filename} {
      variable options

      set release [lindex $options(--spoof) 0]
      set build [lindex $options(--spoof) 1]
      set target [lindex $options(--spoof) 2]
      set auth [lindex $options(--spoof) 1]

      set fd [open $filename r]
      set data [read $fd]
      close $fd

      if {$release != [get_fw_release $filename]} {
        debug "Setting firmware release to $release"
        set major [lindex [split $release "."] 0]
        set minor [lindex [split $release "."] 1]
        set nano "0"
        set data [regsub {release:[0-9]+\.[0-9]+:} $data "release:[format %0.2d ${major}].[format %0.2d ${minor}][format %0.2d ${nano}]:"]
      }

      if {$build != [get_fw_build $filename]} {
        debug "Setting firmware build in to $build"
        set build_num $build
        set build_date [lindex [split [lindex [split [::spoof_version::get_fw_build $filename] ":"] 1] ","] 1]
        set data [regsub {build:[0-9]+,[0-9]+:} $data "build:${build_num},${build_date}:"]
      }

      if {$target != [get_fw_target $filename]} {
        debug "Setting firmware target to $target"
        set target_num [lindex [split $target ":"] 0]
        set target_string [lindex [split $target ":"] 1]
        set data [regsub {target:[0-9]+:[A-Z]+-ww} $data "target:${target_num}:${target_string}"]
      }

      if {$auth != [get_fw_auth $filename]} {
        debug "Setting firmware auth to $auth"
        set data [regsub {auth:[0-9]+:} $data "auth:$auth:"]
      }

      set fd [open $filename w]
      puts -nonewline $fd $data
      close $fd

      set index_dat [file join [file dirname $filename] index.dat]
      shell "dat" [file nativename $filename] [file nativename $index_dat]
    }

    proc upl_xml {filename} {
      variable options

      set release [lindex $options(--spoof) 0]
      set build [lindex $options(--spoof) 1]
      set bdate [lindex $options(--spoof) 3]
      set major [lindex [split $release "."] 0]
      set minor [lindex [split $release "."] 1]
      set nano "0"

      debug "Setting UPL.xml.pkg :: release to ${release} :: build to ${build},${bdate}"

      set search [::get_header_key_upl_xml $filename Version Version]
      set replace "[format %0.2d ${major}].[format %0.2d ${minor}][format %0.2d ${nano}]:"
      if { $search != "" && $search != $replace } {
        set xml [::set_header_key_upl_xml $filename Version "${replace}" Version]
        if { $xml == "" } {
          die "spoof failed:: search: $search :: replace: $replace"
        }
      }

      set search [::get_header_key_upl_xml $filename Build Build]
      set replace "${build},${bdate}"
      if { $search != "" && $search != $replace } {
        set xml [::set_header_key_upl_xml $filename Build "${replace}" Build]
        if { $xml == "" } {
          die "spoof failed:: search: $search :: replace: $replace"
        }
      }

      if {$::change_version::options(--pup-build) == ""} {
        ::set_pup_build [incr build]
      }
    }
}


Using console / shellscript

By using commandline switches you can preset every task there is, plus the source PUP, destination PUP and debug settings.

Example of PS3MFW Builder 0.2 tasks:

ps3mfw.exe %1 "Y:\PS3-Firmwares" "Z:/PS3MFW-out/test.pup" --change_version --add_license_msg --patch_lv1 --patch_lv2 --patch_nas_plugin --patch_privacy --patch_vsh --patch_category_game --spoof_version --debug true

Example of PS3MFW Builder with OtherOS++ tasks (in this case tasks that fail with FW 3.15 are disabled/not selected):

ps3mfw.exe %1 "Y:\PS3-Firmwares\" "Z:/MFWOtherOS-out/test.pup" --change_version --add_license_msg --patch_lv1 --patch-lv1-dispmgr-access false --patch-lv1-otheros-plus-plus false --patch_lv2 --patch-emer-init --patch_category_game --patch-package-files true --patch-app-home true --patch_nas_plugin --allow-pseudoretail-pkg true --allow-debug-pkg true --patch_vsh --allow-unsigned-app true --patch_privacy --debug true


Reference

Downloads / precompiled & source