You are viewing our Forum Archives. To view or take place in current topics click here.

Should this post be a sticky?

Yes
0.00% (0 votes)
No
0.00% (0 votes)

Total Votes: 0

PS3 MFW / CFW Builder Task Codes **CODES BY TweaKii**
Posted:

PS3 MFW / CFW Builder Task Codes **CODES BY TweaKii**Posted:

TweaKii
  • New Member
Status: Offline
Joined: Nov 19, 201212Year Member
Posts: 4
Reputation Power: 0
Status: Offline
Joined: Nov 19, 201212Year Member
Posts: 4
Reputation Power: 0
Hello TTG, I am TweaKii, today I will be providing codes for you to fix your MFW Builder Tasks. Tools will be provided. Notepad ++ will be needed.

TUTORIAL

Copy the codes
Paste them in notepad++
Save them as .tcl
Add them to tasks folder


**DOWNLOADS**
Notepad ++: [ Register or Signin to view external links. ]



add_license_msg

SAVE FILE AS: add_license_msg.tcl add to 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: 200
# Description: Add a custom message to the 'New Features' installation screen

# Option --license-auto-add-features: Automatically generate the enabled features of PS3MFW
# Option --license-features-message: Prefix message to the generated features list
# Option --license-message: New Features message (Appears after the license agreement)
# Type --license-auto-add-features: boolean
# Type --license-features-message: string
# Type --license-message: textarea

namespace eval ::add_license_msg {

array set ::add_license_msg::options {
--license-auto-add-features true
--license-features-message "PS3MFW Features Enabled:"
--license-message ""
}

append ::add_license_msg::options(--license-message) "Modified firmware created by $::tcl_platform(user) using PS3MFW Framework.\n\n"
append ::add_license_msg::options(--license-message) "This system firmware update has been modified from the original, and is therefore unofficial and not endorsed by SCE.\n\n"
append ::add_license_msg::options(--license-message) "Installation of this system firmware update increases the risk of rendering your game system unstable or unusable.\n\n"
append ::add_license_msg::options(--license-message) "Use at your own risk. No guarantee expressed or implied.\n\n"
append ::add_license_msg::options(--license-message) "If anything bad happens as a result of installing this system update, you cannot hold anyone responsible but yourself.\n\n"
append ::add_license_msg::options(--license-message) "The creators of this system firmware modification process do not condone piracy.\n"
append ::add_license_msg::options(--license-message) "Use your system responsibly and only play games that you have purchased.\n"
append ::add_license_msg::options(--license-message) "Enjoy!\n\n"

proc main {} {
set MAX_MESSAGE_SIZE 1500

set message $::add_license_msg::options(--license-message)
if {$::add_license_msg::options(--license-auto-add-features)} {
append message "\n$::add_license_msg::options(--license-features-message)\n"
foreach task [sort_tasks [get_selected_tasks]] {
if {$task == "add_license_msg"} continue
set file [file join $::TASKS_DIR ${task}.tcl]
append message "[get_task_description $file]\n"
foreach option [get_sorted_options $file [array names ::${task}::options]] {
if {[string is boolean -strict [set ::${task}::options($option)]] &&
[set ::${task}::options($option)]} {
if {[get_option_description $file $option] != ""} {
append message " [get_option_description $file $option]\n"
}
}
}
append message "\n"
}
debug "Generated New features message : \n$message"
}

log "Modifying License file"
#log "This may take some time, please be patient..."

set messages [list]
for {set i 0} {$i < [string length $message]} {} {
set msg [string range $message $i [expr {$i + $MAX_MESSAGE_SIZE - 1}]]
set idx [string last "\n\n" $msg]
if {$idx > 0} {
incr idx 1
} else {
set idx [string last "\n" $msg]
}
if {$idx > 0} {
set msg [string range $message $i [expr {$i + $idx}]]
}
incr i [string length $msg]
while {[string range $msg end end] == "\n"} {
set msg [string range $msg 0 end-1]
}
lappend messages $msg
}

if {$messages == {}} {
return
}

# index 1 through 9 don't seem to work
set index 10
while {[grep "<str id=\"msg_updater_$index\">" $::CUSTOM_LICENSE_XML] != {}} {
incr index
}

set message_nodes ""
for {set i 0} {$i < [llength $messages]} {incr i} {
append message_nodes "<str id=\"msg_updater_${index}\">[::xml::xmlencode [lindex $messages $i]]</str>\n\t"
incr index
}
append message_nodes "<str id=\"msg_update_eula_1\">"

::sed_in_place $::CUSTOM_LICENSE_XML "<str id=\"msg_update_eula_1\">" $message_nodes

# set xml [::xml::LoadFile $::CUSTOM_LICENSE_XML]

# # index 1 through 9 don't seem to work
# set index 10
# while {[::xml::GetNodeByAttribute $xml "xml:locale:str" id "msg_updater_$index"] != ""} {
# incr index
# }

# set message_nodes [list]
# for {set i 0} {$i < [llength $messages]} {incr i} {
# set node_xml "<str id=\"msg_updater_${index}\">[::xml::xmlencode [lindex $messages $i]]</str>"
# lappend message_nodes [::xml::Load $node_xml]
# incr index
# }

# set i 0
# while {true} {
# set node_idx [::xml::GetNodeIndices $xml "xml:locale" $i]
# if {$node_idx == ""} break
# log "Modifying license for locale [::xml::GetAttribute $xml xml:locale lang $i]"
# foreach node $message_nodes {
# set xml [::xml::InsertNode $xml [::xml::GetNodeIndicesByAttribute $xml "xml:locale:str" id "msg_update_eula_1" $i] $node]
# }
# incr i
# }
# ::xml::SaveToFile $xml $::CUSTOM_LICENSE_XML
}
}



broken_bluray

SAVE FILE AS: broken_bluray.tcl add to 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: 2100
# Description: Allow firmware update of console with broken blu-ray drive

# Option --remove-bd-revoke: remove BdpRevoke (ENABLING THIS WILL REMOVE BLU-RAY DRIVE FIRMWARE)
# Option --remove-bd-firmware: remove BD firmware (ENABLING THIS WILL REMOVE BLU-RAY DRIVE FIRMWARE)

# Type --remove-bd-revoke: boolean
# Type --remove-bd-firmware: boolean

namespace eval ::broken_bluray {

array set ::broken_bluray::options {
--remove-bd-revoke false
--remove-bd-firmware false
}

proc main {} {
::modify_upl_file ::broken_bluray::callback
}

proc callback { file } {
log "Modifying XML file [file tail ${file}]"

if {[package provide Tk] != "" } {
tk_messageBox -default ok -message "Removing blu-ray drive firmware packages press ok to continue" -icon warning
}

set xml [::xml::LoadFile $file]

if {$::broken_bluray::options(--remove-bd-revoke)} {
set xml [::remove_pkg_from_upl_xml $xml "BdpRevoke" "blu-ray drive revoke"]
}

if {$::broken_bluray::options(--remove-bd-firmware)} {
set xml [::remove_pkgs_from_upl_xml $xml "BD" "blu-ray drive firmware"]
}

::xml::SaveToFile $xml $file
}
}


change_coldboot_files

SAVE FILE AS: change_coldboot_files.tcl add to 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.
#

# Notes: ac3 codec a52 channels stereo samplerate 48kHz bitrate 640kb/s

# Priority: 2200
# Description: Replace coldboot audio/video files (USE CAUTION)

# Option --coldboot-raf: coldboot.raf video filename
# Option --coldboot-stereo: coldboot_stereo.ac3 audio filename
# Option --coldboot-multi: coldboot_multi.ac3 audio filename

# Type --coldboot-raf: file open {"RAF Video" {raf}}
# Type --coldboot-stereo: file open {"AC3 Audio" {ac3}}
# Type --coldboot-multi: file open {"AC3 Audio" {ac3}}

namespace eval change_coldboot_files {

array set ::change_coldboot_files::options {
--coldboot-raf "/path/to/file"
--coldboot-stereo "/path/to/file"
--coldboot-multi "/path/to/file"
}

proc main {} {
variable options

set coldboot_raf [file join dev_flash vsh resource coldboot.raf]
set coldboot_stereo [file join dev_flash vsh resource coldboot_stereo.ac3]
set coldboot_multi [file join dev_flash vsh resource coldboot_multi.ac3]

if {[file exists $options(--coldboot-raf)] == 0 } {
log "Skipping coldboot.raf, $options(--coldboot-raf) does not exist"
} else {
::modify_devflash_file ${coldboot_raf} ::change_coldboot_files::copy_coldboot_file $::change_coldboot_files::options(--coldboot-raf)
}

if {[file exists $options(--coldboot-stereo)] == 0 } {
log "Skipping coldboot_stereo, $options(--coldboot-stereo) does not exist"
} else {
::modify_devflash_file ${coldboot_stereo} ::change_coldboot_files::copy_coldboot_file $::change_coldboot_files::options(--coldboot-stereo)
}

if {[file exists $options(--coldboot-multi)] == 0 } {
log "Skipping coldboot_multi, $options(--coldboot-multi) does not exist"
} else {
::modify_devflash_file ${coldboot_multi} ::change_coldboot_files::copy_coldboot_file $::change_coldboot_files::options(--coldboot-multi)
}
}

proc copy_coldboot_file { dst src } {
if {[file exists $src] == 0} {
die "$src does not exist"
} else {
if {[file exists $dst] == 0} {
die "$dst does not exist"
} else {
log "Replacing default coldboot file [file tail $dst] with [file tail $src]"
copy_file -force $src $dst
}
}
}
}


change_devflash_files

SAVE FILE AS: change_devflash_files.tcl add to 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: 2900
# Description: Change a specific file in devflash manually

# Option --change-filenames: Filenames to change (must start with 'dev_flash/')

# Type --change-filenames: textarea


namespace eval change_devflash_files {

array set ::change_devflash_files::options {
--change-filenames "dev_flash/path/to/file/to/change"
}

proc main {} {
variable options
foreach file [split $options(--change-filenames) "\n"] {
if {[string equal -length 14 "dev_flash/path" ${file}] != 1} {
if {[string equal -length 10 "dev_flash/" ${file}] == 1} {
::modify_devflash_file ${file} ::change_devflash_files::change_file
}
}
}
}

proc change_file { file } {
log "The file to change is in ${file}"

if {[package provide Tk] != "" } {
tk_messageBox -default ok -message "Change the file '${file}' then press ok to continue" -icon warning
} else {
puts "Press \[RETURN\] or \[ENTER\] to continue"
gets stdin
}
}
}


change_ssl_ser

SAVE FILE AS: change_ssl_cer.tcl add to 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: 2500
# Description: Change SSL CA public certificate

# Option --ssl-cer: New SSL CA certificate (source)
# Option --change-cer: SSL CA public certificate (destination)

# Type --ssl-cer: file open {"SSL Certificate" {cer}}
# Type --change-cer: combobox {{DNAS} {Proxy} {ALL} {CA01.cer} {CA02.cer} {CA03.cer} {CA04.cer} {CA05.cer} {CA23.cer} {CA06.cer} {CA07.cer} {CA08.cer} {CA09.cer} {CA10.cer} {CA11.cer} {CA12.cer} {CA13.cer} {CA14.cer} {CA15.cer} {CA16.cer} {CA17.cer} {CA18.cer} {CA19.cer} {CA20.cer} {CA21.cer} {CA22.cer} {CA24.cer} {CA25.cer} {CA26.cer} {CA27.cer} {CA28.cer} {CA29.cer} {CA30.cer} {CA31.cer} {CA32.cer} {CA33.cer} {CA34.cer} {CA35.cer} {CA36.cer}}

namespace eval change_ssl_cer {

array set ::change_ssl_cer::options {
--ssl-cer "/path/to/file"
--change-cer "CA27.cer"
}

proc main {} {
variable options
set src $options(--ssl-cer)
set dst $options(--change-cer)
set path [file join dev_flash data cert]

if {[file exists ${src}] == 0 } {
die "Source SSL CA public certificate file ${src} does not exist"
} elseif {[string equal ${dst} "DNAS"] == 1} {
log "Changing DNAS SSL CA public certificates to [file tail ${dst}]" 1
set dst "CA01.cer CA02.cer CA03.cer CA04.cer CA05.cer"
::modify_devflash_files ${path} ${dst} ::change_ssl_cer::copy_ssl_certificate ${src}
} elseif {[string equal ${dst} "Proxy"] == 1} {
log "Changing SSL CA public certificates to [file tail ${src}]" 1
set dst "CA06.cer CA07.cer CA08.cer CA09.cer CA10.cer CA11.cer CA12.cer CA13.cer CA14.cer CA15.cer CA16.cer CA17.cer CA18.cer CA19.cer CA20.cer CA21.cer CA22.cer CA23.cer CA24.cer CA25.cer CA26.cer CA27.cer CA28.cer CA29.cer CA30.cer CA31.cer CA32.cer CA33.cer CA34.cer CA35.cer CA36.cer"
::modify_devflash_files ${path} ${dst} ::change_ssl_cer::copy_ssl_certificate ${src}
} elseif {[string equal ${dst} "ALL"] == 1} {
log "Changing ALL SSL CA public certificates to [file tail ${dst}]" 1
set dst "CA01.cer CA02.cer CA03.cer CA04.cer CA05.cer CA06.cer CA07.cer CA08.cer CA09.cer CA10.cer CA11.cer CA12.cer CA13.cer CA14.cer CA15.cer CA16.cer CA17.cer CA18.cer CA19.cer CA20.cer CA21.cer CA22.cer CA23.cer CA24.cer CA25.cer CA26.cer CA27.cer CA28.cer CA29.cer CA30.cer CA31.cer CA32.cer CA33.cer CA34.cer CA35.cer CA36.cer"
::modify_devflash_files ${path} ${dst} ::change_ssl_cer::copy_ssl_certificate ${src}
} else {
log "Changing SSL CA public certificate ${dst} to [file tail ${src}]" 1
set dst [file join ${path} [lindex ${dst} 0]]
::modify_devflash_file ${dst} ::change_ssl_cer::copy_ssl_certificate ${src}
}
}

proc copy_ssl_certificate { dst src } {
if {[file exists ${src}] == 0} {
die "Source file ${src} does not exist"
} else {
if {[file exists ${dst}] == 0} {
die "Destination file ${dst} does not exist"
} else {
debug "Changing SSL certificate [file tail ${dst}] with [file tail ${src}]"
copy_file -force ${src} ${dst}
}
}
}
}


change_theme

SAVE FILE AS: change_theme.tcl add to 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: 2400
# Description: Change default "Air Paint" theme

# Option --theme-src: Source theme file
# Option --theme-dst: Destination theme slot

# Type --theme-src: file open {"PS3 Theme" {p3t}}
# Type --theme-dst: label {01 "Air Paint"}

namespace eval change_theme {

array set ::change_theme::options {
--theme-src "filename.p3t"
--theme-dst "01 \"Air Paint\""
}

proc main {} {
variable options
set src $options(--theme-src)
set dst [file join dev_flash vsh resource theme [lindex $options(--theme-dst) 0].p3t]

if {[file exists $options(--theme-src)] == 0} {
die "$src does not exist"
} else {
::modify_devflash_file $dst ::change_theme::replace_theme $src
}
}

proc replace_theme { dst src } {
if {[file exists $src] == 0} {
die "$src does not exist"
} else {
if {[file exists $dst] == 0} {
die "$dst does not exist"
} else {
log "Changing default \"Air Paint\" theme [file tail $dst] with [file tail $src]"
copy_file -force $src $dst
}
}
}
}


change_version

SAVE FILE AS: change_version.tcl add to 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: 100
# Description: Change PUP build / version

# Option --pup-build: PUP build number
# Option --version-string: If set, overrides the entire PUP version string
# Option --version-prefix: Prefix to add to the PUP version string
# Option --version-suffix: Suffix to add to the PUP version string

# Type --pup-build: string
# Type --version-string: string
# Type --version-prefix: string
# Type --version-suffix: string

namespace eval ::change_version {

array set ::change_version::options {
--pup-build ""
--version-string ""
--version-prefix ""
--version-suffix "-PS3MFW"
}

proc main {} {
variable options

if {$options(--pup-build) != ""} {
::set_pup_build $options(--pup-build)
} else {
::set_pup_build [::get_pup_build]
}

log "Changing PUP version.txt file"
if {$options(--version-string) != ""} {
::modify_pup_version_file $options(--version-string) "" 1
} else {
::modify_pup_version_file $options(--version-prefix) $options(--version-suffix)
}
}
}



clean_friends

SAVE FILE AS: clean_friends.tcl add to 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: 1900
# Category: Friends
# Description: Clean unwanted icons from the XMB Friends Category

# Option --clean-friends-avcroom: Remove "Video Chat" icon from the XMB Friends Category
# Option --clean-friends-chat: Remove "Chat Room" icon from the XMB Friends Category
# Option --clean-friends-message-box: Remove "Message Box" icon from the XMB Friends Category
# Option --clean-friends-nas: Remove "My Profile" icon from the XMB Friends Category
# Option --clean-friends-new-chat: Remove "New Chat" icon from the XMB Friends Category
# Type --clean-friends-avcroom: boolean
# Type --clean-friends-chat: boolean
# Type --clean-friends-message-box: boolean
# Type --clean-friends-nas: boolean
# Type --clean-friends-new-chat: boolean

namespace eval ::clean_friends {

array set ::clean_friends::options {
--clean-friends-avcroom true
--clean-friends-chat true
--clean-friends-message-box true
--clean-friends-nas true
--clean-friends-new-chat true
}

proc main {} {
set CATEGORY_FRIENDS_XML [file join dev_flash vsh resource explore xmb category_friend.xml]
::modify_devflash_file ${CATEGORY_FRIENDS_XML} ::clean_friends::callback
}

proc callback { file } {
log "Modifying XML file [file tail ${file}]"

set xml [::xml::LoadFile $file]
if {$::clean_friends::options(--clean-friends-avcroom)} {
set xml [::remove_node_from_xmb_xml $xml "seg_avcroom" "Video Chat"]
}
if {$::clean_friends::options(--clean-friends-chat)} {
set xml [::remove_node_from_xmb_xml $xml "seg_chat" "Chat"]
}
if {$::clean_friends::options(--clean-friends-message-box)} {
set xml [::remove_node_from_xmb_xml $xml "seg_message_box" "Message Box"]
}
if {$::clean_friends::options(--clean-friends-nas)} {
set xml [::remove_node_from_xmb_xml $xml "seg_nas" "???NAS???"]
}
if {$::clean_friends::options(--clean-friends-new-chat)} {
set xml [::remove_node_from_xmb_xml $xml "seg_new_chat" "New Chat"]
}

::xml::SaveToFile $xml $file
}
}


clean_game

SAVE FILE AS: clean_game.tcl add to 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: 1600
# Category: Game
# Description: Clean unwanted icons from the XMB Game Category

# Option --clean-game-gamedata: Remove "Game Data" icon from the XMB Game Category
# Option --clean-game-mcutility: Remove "Memory Card Utility (PS/PS2)" icon from the XMB Game Category
# Option --clean-game-minis-manual: Remove "Minis Manual" icon from the XMB Game Category
# Option --clean-game-welcome: Remove "PlayStation Store" icon from the XMB Game Category
# Option --clean-game-sdps3: Remove "Saved Data Utility (PS3)" icon from the XMB Game Category
# Option --clean-game-sdpsp: Remove "Saved Data Utility (minis)" icon from the XMB Game Category
# Option --clean-game-trophy: Remove "Trophy Collection" icon from the XMB Game Category

# Type --clean-game-gamedata: boolean
# Type --clean-game-mcutility: boolean
# Type --clean-game-minis-manual: boolean
# Type --clean-game-welcome: boolean
# Type --clean-game-sdps3: boolean
# Type --clean-game-sdpsp: boolean
# Type --clean-game-trophy: boolean

namespace eval ::clean_game {

array set ::clean_game::options {
--clean-game-gamedata false
--clean-game-mcutility false
--clean-game-minis-manual true
--clean-game-welcome true
--clean-game-sdps3 false
--clean-game-sdpsp false
--clean-game-trophy false
}

proc main {} {
set CATEGORY_GAME_XML [file join dev_flash vsh resource explore xmb category_game.xml]
::modify_devflash_file ${CATEGORY_GAME_XML} ::clean_game::callback
}

proc callback { file } {
log "Modifying XML file [file tail ${file}]"

set xml [::xml::LoadFile $file]
if {$::clean_game::options(--clean-game-gamedata)} {
set xml [::remove_node_from_xmb_xml $xml "seg_gamedata" "Game Data"]
}
if {$::clean_game::options(--clean-game-mcutility)} {
set xml [::remove_node_from_xmb_xml $xml "seg_mcutility" "Memory Card Utility (PS/PS2)"]
}
if {$::clean_game::options(--clean-game-minis-manual)} {
set xml [::remove_node_from_xmb_xml $xml "seg_minis_manual" "Minis Manual"]
}
if {$::clean_game::options(--clean-game-welcome)} {
set xml [::remove_node_from_xmb_xml $xml "seg_welcome" "PlayStation Store"]
}
if {$::clean_game::options(--clean-game-sdps3)} {
set xml [::remove_node_from_xmb_xml $xml "seg_sdps3" "Saved Data Utility (PS3)"]
}
if {$::clean_game::options(--clean-game-sdpsp)} {
set xml [::remove_node_from_xmb_xml $xml "seg_sdpsp" "Saved Data Utility (minis)"]
}
if {$::clean_game::options(--clean-game-trophy)} {
set xml [::remove_node_from_xmb_xml $xml "seg_trophy" "Trophy Collection"]
}

::xml::SaveToFile $xml $file
}
}


clean_music

SAVE FILE AS: clean_music.tcl add to 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: 1300
# Category: Music
# Description: Clean unwanted icons from the XMB Music Category

# Option --clean-music-dlna-scan: Remove "Search for Media Servers" icon from the XMB Music Category
# Option --clean-music-dlna-device: Remove "Network Media Servers" icon from the XMB Music Category
# Option --clean-music-playlists: Remove "Playlists" icon from the XMB Music Category
# Option --clean-music-welcome: Remove "PlayStation Store" icon from the XMB Music Category

# Type --clean-music-dlna-scan: boolean
# Type --clean-music-dlna-device: boolean
# Type --clean-music-playlists: boolean
# Type --clean-music-welcome: boolean

namespace eval ::clean_music {

array set ::clean_music::options {
--clean-music-dlna-scan false
--clean-music-dlna-device false
--clean-music-playlists false
--clean-music-welcome true
}

proc main {} {
set CATEGORY_MUSIC_XML [file join dev_flash vsh resource explore xmb category_music.xml]
::modify_devflash_file ${CATEGORY_MUSIC_XML} ::clean_music::callback
}

proc callback { file } {
log "Modifying XML file [file tail ${file}]"

set xml [::xml::LoadFile $file]
if {$::clean_music::options(--clean-music-dlna-scan)} {
set xml [::remove_node_from_xmb_xml $xml "seg_dlna_scan" "Search for Media Servers"]
}
if {$::clean_music::options(--clean-music-dlna-device)} {
set xml [::remove_node_from_xmb_xml $xml "seg_dlna_device" "Network Media Servers"]
}
if {$::clean_music::options(--clean-music-playlists)} {
set xml [::remove_node_from_xmb_xml $xml "seg_playlist_mgmt" "Playlists"]
}
if {$::clean_music::options(--clean-music-welcome)} {
set xml [::remove_node_from_xmb_xml $xml "seg_welcome" "PlayStation Store"]
}

::xml::SaveToFile $xml $file
}
}


clean_network

SAVE FILE AS: clean_network.tcl add to 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: 1700
# Category: Network
# Description: Clean unwanted icons from the XMB Network Category

# Option --clean-network-browser: Remove "Internet Browser" icon from the XMB Network Category
# Option --clean-network-folding-at-home: Remove "Life with PlayStation" icon from the XMB Network Category
# Option --clean-network-kensaku: Remove "Internet Search" icon from the XMB Network Category
# Option --clean-network-manual: Remove "Online Instruction Manuals" icon from the XMB Network Category
# Option --clean-network-premo: Remove "Remote Play" icon from the XMB Network Category

# Type --clean-network-browser: boolean
# Type --clean-network-folding-at-home: boolean
# Type --clean-network-kensaku: boolean
# Type --clean-network-manual: boolean
# Type --clean-network-premo: boolean

namespace eval ::clean_network {

array set ::clean_network::options {
--clean-network-browser false
--clean-network-folding-at-home true
--clean-network-kensaku true
--clean-network-manual true
--clean-network-premo true
}

proc main {} {
set CATEGORY_NETWORK_XML [file join dev_flash vsh resource explore xmb category_network.xml]
::modify_devflash_file ${CATEGORY_NETWORK_XML} ::clean_network::callback
}

proc callback { file } {
log "Modifying XML file [file tail ${file}]"

# hack to get around upstream category_network.xml errant />
set fd [open $file r]
set data [read $fd]
regsub {\s*/>(\s*/>\s*</Items>)} $data {\1} data
close $fd
set xml [::xml::Load $data]

# this should work but upstream category_network.xml has an errant />
# set xml [::xml::LoadFile $file]

if {$::clean_network::options(--clean-network-browser)} {
set xml [::remove_node_from_xmb_xml $xml "seg_browser" "Internet Browser"]
}
if {$::clean_network::options(--clean-network-folding-at-home)} {
set xml [::remove_node_from_xmb_xml $xml "seg_folding_at_home" "Life with PlayStation "]
}
if {$::clean_network::options(--clean-network-kensaku)} {
set xml [::remove_node_from_xmb_xml $xml "seg_kensaku" "Internet Search"]
}
if {$::clean_network::options(--clean-network-manual)} {
set xml [::remove_node_from_xmb_xml $xml "seg_manual" "Online Instruction Manuals"]
}
if {$::clean_network::options(--clean-network-premo)} {
set xml [::remove_node_from_xmb_xml $xml "seg_premo" "Remote Play"]
}

::xml::SaveToFile $xml $file
}
}


clean_photo

SAVE FILE AS: clean_photo.tcl add to 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: 1200
# Category: Photo
# Description: Clean unwanted icons from the XMB Photo Category

# Option --clean-photo-dlna-scan: Remove "Search for Media Servers" icon from the XMB Photo Category
# Option --clean-photo-dlna-device: Remove "Network Media Servers" icon from the XMB Photo Category
# Option --clean-photo-hakoniwa: Remove "Photo Gallery" icon from the XMB Photo Category
# Option --clean-photo-playlists: Remove "Playlists" icon from the XMB Photo Category
# Option --clean-photo-screenshot: Remove "Screenshot" icon from the XMB Photo Category

# Type --clean-photo-dlna-scan: boolean
# Type --clean-photo-dlna-device: boolean
# Type --clean-photo-hakoniwa: boolean
# Type --clean-photo-playlists: boolean
# Type --clean-photo-screenshot: boolean

namespace eval ::clean_photo {

array set ::clean_photo::options {
--clean-photo-dlna-scan false
--clean-photo-dlna-device false
--clean-photo-hakoniwa true
--clean-photo-playlists false
--clean-photo-screenshot true
}

proc main {} {
set CATEGORY_PHOTO_XML [file join dev_flash vsh resource explore xmb category_photo.xml]
::modify_devflash_file ${CATEGORY_PHOTO_XML} ::clean_photo::callback
}

proc callback { file } {
log "Modifying XML file [file tail ${file}]"

set xml [::xml::LoadFile $file]
if {$::clean_photo::options(--clean-photo-dlna-scan)} {
set xml [::remove_node_from_xmb_xml $xml "seg_dlna_scan" "Search for Media Servers"]
}
if {$::clean_photo::options(--clean-photo-dlna-device)} {
set xml [::remove_node_from_xmb_xml $xml "seg_dlna_device" "Network Media Servers"]
}
if {$::clean_photo::options(--clean-photo-hakoniwa)} {
set xml [::remove_node_from_xmb_xml $xml "seg_hakoniwa" "Photo Gallery"]
}
if {$::clean_photo::options(--clean-photo-playlists)} {
set xml [::remove_node_from_xmb_xml $xml "seg_playlist_mgmt" "Playlists"]
}
if {$::clean_photo::options(--clean-photo-screenshot)} {
set xml [::remove_node_from_xmb_xml $xml "seg_screenshot" "Screenshot"]
}

::xml::SaveToFile $xml $file
}
}


clean_psn

SAVE FILE AS: clean_psn.tcl add to 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: 1800
# Category: PlayStation Network
# Description: Clean unwanted icons from the XMB PlayStation Network Category

# Option --clean-psn-commerce-new: Remove "What's New" icon from the XMB PlayStation Network Category
# Option --clean-psn-home: Remove "PlayStation Home" icon from the XMB PlayStation Network Category
# Option --clean-psn-regist: Remove "Sign In" icon from the XMB PlayStation Network Category
# Option --clean-psn-welcome: Remove "PlayStation Store" icon from the XMB PlayStation Network Category

# Type --clean-psn-commerce-new: boolean
# Type --clean-psn-home: boolean
# Type --clean-psn-regist: boolean
# Type --clean-psn-welcome: boolean

namespace eval ::clean_psn {

array set ::clean_psn::options {
--clean-psn-commerce-new true
--clean-psn-home true
--clean-psn-regist true
--clean-psn-welcome true
}

proc main {} {
set CATEGORY_PSN_XML [file join dev_flash vsh resource explore xmb category_psn.xml]
::modify_devflash_file ${CATEGORY_PSN_XML} ::clean_psn::callback
}

proc callback { file } {
log "Modifying XML file [file tail ${file}]"

set xml [::xml::LoadFile $file]
if {$::clean_psn::options(--clean-psn-commerce-new)} {
set xml [::remove_node_from_xmb_xml $xml "seg_commerce_new" "What's New"]
}
if {$::clean_psn::options(--clean-psn-home)} {
set xml [::remove_node_from_xmb_xml $xml "seg_home" "PlayStation Home"]
}
if {$::clean_psn::options(--clean-psn-regist)} {
set xml [::remove_node_from_xmb_xml $xml "seg_regist" "Sign In"]
}
if {$::clean_psn::options(--clean-psn-welcome)} {
set xml [::remove_node_from_xmb_xml $xml "seg_welcome" "PlayStation Store"]
}

::xml::SaveToFile $xml $file
}
}


clean_sysconf

SAVE FILE AS: clean_sysconf.tcl add to 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: 1100
# Category: Settings
# Description: Clean unwanted icons from the XMB Settings Category

# Option --clean_sysconf_chat: Remove "Chat Settings" icon from the XMB Settings Category
# Option --clean_sysconf_print: Remove "Printer Settings" icon from the XMB Settings Category
# Option --clean_sysconf_security: Remove "Security Settings" icon from the XMB Settings Category
# Option --clean_sysconf_remote: Remove "Remote Play Settings" icon from the XMB Settings Category

# Type --clean_sysconf_chat: boolean
# Type --clean_sysconf_print: boolean
# Type --clean_sysconf_security: boolean
# Type --clean_sysconf_remote: boolean

namespace eval ::clean_sysconf {

array set ::clean_sysconf::options {
--clean_sysconf_chat true
--clean_sysconf_print true
--clean_sysconf_security true
--clean_sysconf_remote true
}

proc main {} {
set CATEGORY_SYSCONF_XML [file join dev_flash vsh resource explore xmb category_sysconf.xml]
modify_devflash_file ${CATEGORY_SYSCONF_XML} ::clean_sysconf::callback
}

proc callback { file } {
variable options

log "Modifying XML file [file tail ${file}]"

set xml [::xml::LoadFile $file]
if {$options(--clean_sysconf_chat)} {
set xml [remove_node_from_xmb_xml $xml "chat" "Chat Settings"]
}
if {$options(--clean_sysconf_print)} {
set xml [remove_node_from_xmb_xml $xml "print" "Printer Settings"]
}
if {$options(--clean_sysconf_security)} {
set xml [remove_node_from_xmb_xml $xml "security" "Security Settings"]
}
if {$options(--clean_sysconf_remote)} {
set xml [remove_node_from_xmb_xml $xml "remote" "Remote Play Settings"]
}

::xml::SaveToFile $xml $file
}
}


clean_tv

SAVE FILE AS: clean_tv.tcl add to 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: 1500
# Category: TV
# Description: Clean unwanted icons from the XMB TV Category

# Option --clean_tv_xil: Remove "xil" icon from the XMB TV Category
# Option --clean_tv_gameexit: Remove "gameexit" icon from the XMB TV Category
# Option --clean_tv_gamedir: Remove "gameDir" icon from the XMB TV Category

# Type --clean_tv_xil: boolean
# Type --clean_tv_gameexit: boolean
# Type --clean_tv_gamedir: boolean

namespace eval ::clean_tv {

array set ::clean_tv::options {
--clean_tv_xil false
--clean_tv_gameexit false
--clean_tv_gamedir false
}

proc main {} {
set CATEGORY_SYSCONF_XML [file join dev_flash vsh resource explore xmb category_tv.xml]
modify_devflash_file ${CATEGORY_SYSCONF_XML} ::clean_tv::callback
}

proc callback { file } {
variable options

log "Modifying XML file [file tail ${file}]"

set xml [::xml::LoadFile ${file}]

if {$options(--clean_tv_xil)} {
set xml [remove_node_from_xmb_xml ${xml} "xil" "xil"]
}
if {$options(--clean_tv_gameexit)} {
set xml [remove_node_from_xmb_xml ${xml} "gameexit" "gameexit"]
}
if {$options(--clean_tv_gamedir)} {
set xml [remove_node_from_xmb_xml ${xml} "gameDir" "gameDir"]
}

::xml::SaveToFile ${xml} ${file}
}
}


clean_video

SAVE FILE AS: clean_video.tcl add to 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: 1400
# Category: Video
# Description: Clean unwanted icons from the XMB Video Category

# Option --clean-video-bddata-mgmt: Remove "BD Data Utility" icon from the XMB Video Category
# Option --clean-video-dlna-scan: Remove "Search for Media Servers" icon from the XMB Video Category
# Option --clean-video-dlna-device: Remove "Network Media Servers" icon from the XMB Video Category
# Option --clean-video-editingvideo-mgmt: Remove "Video Editor & Uploader" icon from the XMB Video Category
# Option --clean-video-netflix: Remove "Netflix" icon from the XMB Video Category
# Option --clean-video-welcome: Remove "PlayStation Store" icon from the XMB Video Category

# Type --clean-video-bddata-mgmt: boolean
# Type --clean-video-dlna-scan: boolean
# Type --clean-video-dlna-device: boolean
# Type --clean-video-editingvideo-mgmt: boolean
# Type --clean-video-netflix: boolean
# Type --clean-video-welcome: boolean

namespace eval ::clean_video {

array set ::clean_video::options {
--clean-video-bddata-mgmt false
--clean-video-dlna-scan false
--clean-video-dlna-device false
--clean-video-editingvideo-mgmt true
--clean-video-netflix true
--clean-video-welcome true
}

proc main {} {
set CATEGORY_VIDEO_XML [file join dev_flash vsh resource explore xmb category_video.xml]
::modify_devflash_file ${CATEGORY_VIDEO_XML} ::clean_video::callback
}

proc callback { file } {
log "Modifying XML file [file tail ${file}]"

set xml [::xml::LoadFile $file]
if {$::clean_video::options(--clean-video-bddata-mgmt)} {
set xml [::remove_node_from_xmb_xml $xml "seg_bddata_mgmt" "BD Data Utility"]
}
if {$::clean_video::options(--clean-video-dlna-scan)} {
set xml [::remove_node_from_xmb_xml $xml "seg_dlna_scan" "Search for Media Servers"]
}
if {$::clean_video::options(--clean-video-dlna-device)} {
set xml [::remove_node_from_xmb_xml $xml "seg_dlna_device" "Network Media Servers"]
}
if {$::clean_video::options(--clean-video-editingvideo-mgmt)} {
set xml [::remove_node_from_xmb_xml $xml "seg_editingvideo_mgmt" "Video Editor & Uploader"]
}
if {$::clean_video::options(--clean-video-netflix)} {
set xml [::remove_node_from_xmb_xml $xml "seg_netflix" "Netflix"]
}
if {$::clean_video::options(--clean-video-welcome)} {
set xml [::remove_node_from_xmb_xml $xml "seg_welcome" "PlayStation Store"]
}

::xml::SaveToFile $xml $file
}
}


homebrew_category

SAVE FILE AS: homebrew_category.tcl add to 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: 1000
# Description: Add "Homebrew" category to the XMB

# Option --homebrew-cat: Category to replace

# Type --homebrew-cat: combobox {{Users} {Photo} {Music} {Video} {TV} {Game} {Network} {PlayStation Network} {Friends}}


namespace eval ::homebrew_category {

array set ::homebrew_category::options {
--homebrew-cat "Category"
}

proc main {} {
set CATEGORY_TV_XML [file join dev_flash vsh resource explore xmb category_tv.xml]
set CATEGORY_GAME_TOOL2_XML [file join dev_flash vsh resource explore xmb category_game_tool2.xml]
set EXPLORE_PLUGIN_FULL_RCO [file join dev_flash vsh resource explore_plugin_full.rco]
set XMB_INGAME_RCO [file join dev_flash vsh resource xmb_ingame.rco]

if {$::homebrew_category::options(--homebrew-cat) == "Users"} {
set CATEGORY_XML [file join dev_flash vsh resource explore xmb category_user.xml]
}

if {$::homebrew_category::options(--homebrew-cat) == "Photo"} {
set CATEGORY_XML [file join dev_flash vsh resource explore xmb category_photo.xml]
}

if {$::homebrew_category::options(--homebrew-cat) == "Music"} {
set CATEGORY_XML [file join dev_flash vsh resource explore xmb category_music.xml]
}

if {$::homebrew_category::options(--homebrew-cat) == "Video"} {
set CATEGORY_XML [file join dev_flash vsh resource explore xmb category_video.xml]
}

if {$::homebrew_category::options(--homebrew-cat) == "TV"} {
set CATEGORY_XML [file join dev_flash vsh resource explore xmb category_tv.xml]
set XMB_PLUGIN [file join dev_flash vsh module xmb_plugin.sprx]
modify_devflash_file $XMB_PLUGIN ::homebrew_category::patch_self
}

if {$::homebrew_category::options(--homebrew-cat) == "Game"} {
set CATEGORY_XML [file join dev_flash vsh resource explore xmb category_game.xml]
}

if {$::homebrew_category::options(--homebrew-cat) == "Network"} {
set CATEGORY_XML [file join dev_flash vsh resource explore xmb category_network.xml]
}

if {$::homebrew_category::options(--homebrew-cat) == "PlayStation Network"} {
set CATEGORY_XML [file join dev_flash vsh resource explore xmb category_psn.xml]
}

if {$::homebrew_category::options(--homebrew-cat) == "Friends"} {
set CATEGORY_XML [file join dev_flash vsh resource explore xmb category_friend.xml]
}

modify_devflash_file $CATEGORY_TV_XML ::homebrew_category::find_nodes
modify_devflash_file $CATEGORY_GAME_TOOL2_XML ::homebrew_category::find_nodes_2
modify_devflash_file $CATEGORY_XML ::homebrew_category::inject_nodes
modify_rco_file $EXPLORE_PLUGIN_FULL_RCO ::homebrew_category::callback_homebrew
modify_rco_file $XMB_INGAME_RCO ::homebrew_category::callback_homebrew
}

proc patch_self {self} {
log "Patching [file tail $self]"
::modify_self_file $self ::homebrew_category::patch_elf
}

proc patch_elf {elf} {
log "Patching [file tail $elf] to add tv category"

set search "\x64\x65\x76\x5f\x68\x64\x64\x30\x2f\x67\x61\x6d\x65\x2f\x42\x43\x45\x53\x30\x30\x32\x37\x35"
set replace "\x64\x65\x76\x5f\x66\x6c\x61\x73\x68\x2f\x64\x61\x74\x61\x2f\x63\x65\x72\x74\x00\x00\x00\x00"

catch_die {::patch_elf $elf $search 0 $replace} \
"Unable to patch self [file tail $elf]"
}

proc find_nodes { file } {
log "Parsing XML: [file tail $file]"
set xml [::xml::LoadFile $file]

set ::XMBML [::xml::GetNodeByAttribute $xml "XMBML" version "1.0"]

if {$::XMBML == ""} {
die "Could not parse $file"
}
}

proc find_nodes_2 { file } {
log "Parsing XML: [file tail $file]"
set xml [::xml::LoadFile $file]

set ::query_package_files [::xml::GetNodeByAttribute $xml "XMBML:View:Items:Query" key "seg_package_files"]
set ::view_package_files [::xml::GetNodeByAttribute $xml "XMBML:View" id "seg_package_files"]
set ::view_packages [::xml::GetNodeByAttribute $xml "XMBML:View" id "seg_packages"]

if {$::query_package_files == "" || $::view_package_files == "" || $::view_packages == "" } {
die "Could not parse $file"
}

set ::query_gamedebug [::xml::GetNodeByAttribute $xml "XMBML:View:Items:Query" key "seg_gamedebug"]
set ::view_gamedebug [::xml::GetNodeByAttribute $xml "XMBML:View" id "seg_gamedebug"]

if {$::query_gamedebug == "" || $::view_gamedebug== "" } {
die "Could not parse $file"
}
}

proc inject_nodes { file } {
log "Modifying XML: [file tail $file]"
set xml [::xml::LoadFile $file]

set xml [::xml::ReplaceNode $xml [::xml::GetNodeIndicesByAttribute $xml "XMBML" version "1.0"] $::XMBML]
set xml [::xml::InsertNode $xml [::xml::GetNodeIndicesByAttribute $xml "XMBML:View:Items:Query" key "seg_gameexit"] $::query_package_files]
set xml [::xml::InsertNode $xml {2 end 0} $::view_package_files]
set xml [::xml::InsertNode $xml {2 end 0} $::view_packages]
set xml [::xml::InsertNode $xml [::xml::GetNodeIndicesByAttribute $xml "XMBML:View:Items:Query" key "seg_gameexit"] $::query_gamedebug]
set xml [::xml::InsertNode $xml {2 end 0} $::view_gamedebug]

unset ::query_package_files
unset ::view_package_files
unset ::view_packages
unset ::query_gamedebug
unset ::view_gamedebug
::xml::SaveToFile $xml $file
}

proc callback_homebrew {path args} {
log "Patching English.xml into [file tail $path]"
sed_in_place [file join $path English.xml] $::homebrew_category::options(--homebrew-cat) Homebrew
}
}


language_pack

SAVE FILE AS: language_pack.tcl add to 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: 950
# Description: Language Pack

# Option --language-pack: Language Pack path
# Option --language-replace: Language Pack to replace (keep empty for none)
# Option --language-font: Replace fonts

# Type --language-pack: file open {"Language Pack" {.LP}}
# Type --language-replace: combobox {{} {English} {French} {German} {Italian} {Finnish} {Dutch} {Danish} {Swedish} {Spanish} {Russian} {Portugese} {Norwegian} {Korean} {ChineseTrad} {ChineseSimpl} {Japanese}}
# Type --language-font: boolean


namespace eval ::language_pack {

array set ::language_pack::options {
--language-pack "Language_Pack.LP"
--language-replace ""
--language-font true
}

proc main {} {
variable options
set fontPrefix "SCE-PS3-"
set langpackDir [file join ${::BUILD_DIR} langpack]
file delete -force $langpackDir
extract_tar $options(--language-pack) ${langpackDir}

set fontFiles {{CP-R-KANA} {DH-R-CGB} {MT-BI-LATIN} {MT-B-LATIN} {MT-I-LATIN} {MT-R-LATIN} {NR-B-JPN} {NR-L-JPN} {NR-R-EXT} {NR-R-JPN} {RD-BI-LATIN} {RD-B-LATIN} {RD-B-LATIN2} {RD-I-LATIN} {RD-LI-LATIN} {RD-L-LATIN} {RD-L-LATIN2} {RD-R-LATIN} {RD-R-LATIN2} {SR-R-EXT} {SR-R-JPN} {SR-R-LATIN} {SR-R-LATIN2} {VR-R-LATIN} {VR-R-LATIN2} {YG-B-KOR} {YG-L-KOR} {YG-R-KOR}}

if {$::language_pack::options(--language-font)} {
foreach fontFile $fontFiles {
set devflashFontFile [file join dev_flash data font ${fontPrefix}${fontFile}.TTF]
set langpackFontFile [file join ${langpackDir} font ${fontPrefix}${fontFile}.TTF]
if {[file exists ${langpackFontFile}]} {
::modify_devflash_file ${devflashFontFile} ::language_pack::callback_font ${langpackFontFile}
}
}
}

set rcoFiles {{ap_plugin} {audioplayer_plugin} {audioplayer_plugin_dummy} {audioplayer_plugin_mini} {audioplayer_plugin_util} {auth_plugin} {autodownload_plugin} {avc_game_plugin} {avc_plugin} {avc2_game_plugin} {avc2_game_video_plugin} {avc2_text_plugin} {bdp_disccheck_plugin} {bdp_plugin} {bdp_storage_plugin} {category_setting_plugin} {checker_plugin} {custom_render_plugin} {data_copy_plugin} {deviceconf_plugin} {dlna_plugin} {download_plugin} {edy_plugin} {eula_cddb_plugin} {eula_hcopy_plugin} {eula_net_plugin} {explore_category_friend} {explore_category_game} {explore_category_music} {explore_category_network} {explore_category_photo} {explore_category_psn} {explore_category_sysconf} {explore_category_tv} {explore_category_user} {explore_category_video} {explore_plugin_ft} {explore_plugin_full} {explore_plugin_game} {explore_plugin_np} {filecopy_plugin} {friendim_plugin} {friendim_plugin_game} {friendml_plugin} {friendml_plugin_game} {friendtrophy_plugin} {friendtrophy_plugin_game} {game_ext_plugin} {game_indicator_plugin} {game_plugin} {gamedata_plugin} {gamelib_plugin} {gameupdate_plugin} {hknw_plugin} {idle_plugin} {impose_plugin} {kensaku_plugin} {msgdialog_plugin} {musicbrowser_plugin} {nas_plugin} {netconf_plugin} {newstore_effect} {newstore_plugin} {np_eula_plugin} {np_matching_plugin} {np_multisignin_plugin} {np_trophy_ingame} {np_trophy_plugin} {npsignin_plugin} {osk_plugin} {oskfullkeypanel_plugin} {oskpanel_plugin} {pesm_plugin} {photo_network_sharing_plugin} {photolist_plugin} {photoupload_plugin} {photoviewer_plugin} {playlist_plugin} {poweroff_plugin} {premo_plugin} {print_plugin} {profile_plugin} {profile_plugin_mini} {ps3_savedata_plugin} {rec_plugin} {regcam_plugin} {sacd_plugin} {scenefolder_plugin} {screenshot_plugin} {search_service} {software_update_plugin} {soundvisualizer_plugin} {strviewer_plugin} {subdisplay_plugin} {sv_pseudoaudioplayer_plugin} {sysconf_plugin} {system_plugin} {thumthum_plugin} {upload_util} {user_info_plugin} {user_plugin} {videodownloader_plugin} {videoeditor_plugin} {videoplayer_plugin} {videoplayer_util} {vmc_savedata_plugin} {wboard_plugin} {webbrowser_plugin} {webrender_plugin} {xmb_ingame} {xmb_plugin_normal} {ycon_manual_plugin}}

foreach rcoFile $rcoFiles {
set devflashRcoFile [file join dev_flash vsh resource ${rcoFile}.rco]

if {$options(--language-replace) == ""} {
} else {
if {[file isdirectory [file join ${langpackDir} replace]]} {
set replacelangpackRcoFile [file join ${langpackDir} replace ${rcoFile}.xml]
if {[file exists $replacelangpackRcoFile]} {
set mode "0"
::modify_rco_file ${devflashRcoFile} ::language_pack::callback_rco ${replacelangpackRcoFile} ${mode} {empty}
}
}
}

if {[file isdirectory [file join ${langpackDir} edit]]} {
set langs {{English} {French} {German} {Italian} {Finnish} {Dutch} {Danish} {Swedish} {Spanish} {Russian} {Portugese} {Norwegian} {Korean} {ChineseTrad} {ChineseSimpl} {Japanese}}
foreach lang $langs {
set editlangpackRcoFile [file join ${langpackDir} edit ${rcoFile} ${lang}.xml]
if {[file exists $editlangpackRcoFile]} {
set mode "1"
::modify_rco_file ${devflashRcoFile} ::language_pack::callback_rco ${editlangpackRcoFile} ${mode} ${lang}
}
}
}

if {[file exists [file join ${langpackDir} format.txt]]} {
set formatlangpackRcoFile [file join ${langpackDir} format.txt]
if {[file exists $formatlangpackRcoFile]} {
set mode "2"
::modify_rco_file ${devflashRcoFile} ::language_pack::callback_rco ${formatlangpackRcoFile} ${mode} ${rcoFile}
}
}
}
}

proc callback_font { dst src } {
if {[file exists ${src}]} {
if {[file exists ${dst}]} {
log "Replacing font file [file tail ${dst}] with [file tail ${src}]"
copy_file -force ${src} ${dst}
} else {
die "Font file ${dst} does not exist"
}
} else {
die "Font file ${src} does not exist"
}
}

proc callback_rco {path src mode name} {
variable options

if {${mode} == "0" } {
set dst [file join ${path} $options(--language-replace).xml]
}

if {${mode} == "1" } {
set dst [file join ${path} ${name}.xml]
}

if {${mode} == "2" } {
set dst [file join ${::CUSTOM_PUP_DIR} "update_files" "dev_flash" "dev_flash" "vsh" "resource" ${name}.rco.xml]
}

if {[file exists ${src}]} {
if {[file exists ${dst}]} {
if {${mode} != "2" } {
log "Replacing ${dst}"
copy_file -force ${src} ${dst}
} else {
log "Patching format"
set re [open ${src} r]
set format [read $re]
set read [read [open ${dst} r]]
sed_in_place ${read} utf16 ${format}
close $re
}
} else {
die "${dst} does not exist"
}
} else {
die "${src} does not exist"
}
}
}


patch_category_game

SAVE FILE AS: patch_category_game.tcl add to 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: 1000
# Description: Add new icons to the XMB Game category

# Option --patch-package-files: Add "Install Package Files" icon to the XMB Game Category
# Option --patch-app-home: Add "/app_home" icon to the XMB Game Category

# Type --patch-package-files: boolean
# Type --patch-app-home: boolean

namespace eval ::patch_category_game {

array set ::patch_category_game::options {
--patch-package-files true
--patch-app-home true
}

proc main {} {
set CATEGORY_GAME_TOOL2_XML [file join dev_flash vsh resource explore xmb category_game_tool2.xml]
set CATEGORY_GAME_XML [file join dev_flash vsh resource explore xmb category_game.xml]

::modify_devflash_file $CATEGORY_GAME_TOOL2_XML ::patch_category_game::find_nodes
::modify_devflash_file $CATEGORY_GAME_XML ::patch_category_game::inject_nodes
}

proc find_nodes { file } {
log "Parsing XML: [file tail $file]"
set xml [::xml::LoadFile $file]

if {$::patch_category_game::options(--patch-package-files)} {
set ::query_package_files [::xml::GetNodeByAttribute $xml "XMBML:View:Items:Query" key "seg_package_files"]
set ::view_package_files [::xml::GetNodeByAttribute $xml "XMBML:View" id "seg_package_files"]
set ::view_packages [::xml::GetNodeByAttribute $xml "XMBML:View" id "seg_packages"]

if {$::query_package_files == "" || $::view_package_files == "" || $::view_packages == "" } {
die "Could not parse $file"
}
}

if {$::patch_category_game::options(--patch-app-home)} {
set ::query_gamedebug [::xml::GetNodeByAttribute $xml "XMBML:View:Items:Query" key "seg_gamedebug"]
set ::view_gamedebug [::xml::GetNodeByAttribute $xml "XMBML:View" id "seg_gamedebug"]

if {$::query_gamedebug == "" || $::view_gamedebug== "" } {
die "Could not parse $file"
}
}
}

proc inject_nodes { file } {
log "Modifying XML: [file tail $file]"
set xml [::xml::LoadFile $file]

if {$::patch_category_game::options(--patch-package-files)} {
set xml [::xml::InsertNode $xml [::xml::GetNodeIndicesByAttribute $xml "XMBML:View:Items:Query" key "seg_gameexit"] $::query_package_files]
set xml [::xml::InsertNode $xml {2 end 0} $::view_package_files]
set xml [::xml::InsertNode $xml {2 end 0} $::view_packages]

unset ::query_package_files
unset ::view_package_files
unset ::view_packages
}

if {$::patch_category_game::options(--patch-app-home)} {
set xml [::xml::InsertNode $xml [::xml::GetNodeIndicesByAttribute $xml "XMBML:View:Items:Query" key "seg_gameexit"] $::query_gamedebug]
set xml [::xml::InsertNode $xml {2 end 0} $::view_gamedebug]

unset ::query_gamedebug
unset ::view_gamedebug
}
::xml::SaveToFile $xml $file
}
}


patch_lv1

SAVE FILE AS: patch_lv1.tcl add to 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: 300
# Description: Patch LV1 hypervisor

# Option --patch-lv1-mmap: Allow mapping of any memory area (Needed for LV2 Poke)

# Type --patch-lv1: boolean

namespace eval ::patch_lv1 {

array set ::patch_lv1::options {
--patch-lv1-mmap true
}

proc main { } {
set self "lv1.self"

::modify_coreos_file $self ::patch_lv1::patch_self
}

proc patch_self {self} {
if {!$::patch_lv1::options(--patch-lv1-mmap)} {
log "WARNING: Enabled task has no enabled option" 1
} else {
::modify_self_file $self ::patch_lv1::patch_elf
}
}

proc patch_elf {elf} {
if {$::patch_lv1::options(--patch-lv1-mmap)} {
log "Patching LV1 hypervisor to allow mapping of any memory area"

set search "\x39\x08\x05\x48\x39\x20\x00\x00\x38\x60\x00\x00\x4b\xff\xfc\x45"
set replace "\x01"

catch_die {::patch_elf $elf $search 7 $replace} \
"Unable to patch self [file tail $elf]"
}
}
}


patch_lv2

SAVE FILE AS: patch_lv2.tcl add to 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: 400
# Description: Patch LV2 kernel

# Option --patch-lv2-peek-poke: Patch to add Peek&Poke system calls to LV2

# Type --patch-lv2-peek-poke: boolean

namespace eval ::patch_lv2 {

array set ::patch_lv2::options {
--patch-lv2-peek-poke true
}

proc main { } {
set self "lv2_kernel.self"

::modify_coreos_file $self ::patch_lv2::patch_self
}

proc patch_self {self} {
if {!$::patch_lv2::options(--patch-lv2-peek-poke)} {
log "WARNING: nothing to do for LV2 patching" 1
} else {
set lv1_task 0
foreach task [get_selected_tasks] {
if {$task == "patch_lv1"} {
set lv1_task 1
break
}
}

if {$lv1_task == 0} {
log "WARNING: You enabled Peek&Poke without enabling LV1 mmap patching." 1
log "WARNING: Patching LV1 mmap is necessary for Poke to function." 1
} else {
::modify_self_file $self ::patch_lv2::patch_elf
}
}
}

proc patch_elf {elf} {
if {$::patch_lv2::options(--patch-lv2-peek-poke)} {
log "Patching LV2 to allow Peek and Poke support"

set search "\xEB\xA1\x00\x88\x38\x60\x00\x00\xEB\xC1\x00\x90\xEB\xE1\x00\x98"
append search "\x7C\x08\x03\xA6\x7C\x63\x07\xB4\x38\x21\x00\xA0\x4E\x80\x00\x20"
append search "\x3C\x60\x80\x01\x60\x63\x00\x03\x4E\x80\x00\x20\x3C\x60\x80\x01"
append search "\x60\x63\x00\x03\x4E\x80\x00\x20"
set replace "\xE8\x63\x00\x00\x60\x00\x00\x00\x4E\x80\x00\x20\xF8\x83\x00\x00\x60\x00\x00\x00"

catch_die {::patch_elf $elf $search 32 $replace} \
"Unable to patch self [file tail $elf]"
}
}
}


patch_nas_plugin

SAVE FILE AS: patch_nas_plugin.tcl add to 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: 500
# Description: Patch package installer

# Option --allow-pseudoretail-pkg: Patch to allow installation of pseudo-retail packages
# Option --allow-debug-pkg: Patch to allow installation of debug packages

# Type --allow-pseudoretail-pkg: boolean
# Type --allow-debug-pkg: boolean

namespace eval ::patch_nas_plugin {

array set ::patch_nas_plugin::options {
--allow-pseudoretail-pkg true
--allow-debug-pkg true
}

proc main {} {
set self [file join dev_flash vsh module nas_plugin.sprx]

::modify_devflash_file $self ::patch_nas_plugin::patch_self
}

proc patch_self { self } {
if {!$::patch_nas_plugin::options(--allow-pseudoretail-pkg)} {
log "WARNING: Enabled task has no enabled option" 1
} elseif {!$::patch_nas_plugin::options(--allow-debug-pkg)} {
log "WARNING: Enabled task has no enabled option" 1
} else {
::modify_self_file $self ::patch_nas_plugin::patch_elf
}
}

proc patch_elf { elf } {
if {$::patch_nas_plugin::options(--allow-pseudoretail-pkg) } {
log "Patching [file tail $elf] to allow pseudo-retail pkg installs"

set search "\x7c\x60\x1b\x78\xf8\x1f\x01\x80"
set replace "\x38\x00\x00\x00"

catch_die {::patch_elf $elf $search 0 $replace} \
"Unable to patch self [file tail $elf]"
}

if {$::patch_nas_plugin::options(--allow-debug-pkg) } {
log "Patching [file tail $elf] to allow debug pkg installs"

set search "\x2f\x89\x00\x00\x41\x9e\x00\x4c\x38\x00\x00\x00"
set replace "\x60\x00\x00\x00"

catch_die {::patch_elf $elf $search 4 $replace} \
"Unable to patch self [file tail $elf]"
}
}
}


patch_privacy

SAVE FILE AS: patch_privacy.tcl add to 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: 600
# Description: Patch all self/sprx to secure privacy

# Option --patch-playstation-com: Patch communication to playstation.com
# Option --patch-playstation-net: Patch communication to playstation.net
# Option --patch-playstation-org: Patch communication to playstation.org
# Option --patch-sony: Patch communication to sony.[com|co.jp]
# Option --patch-bitwallet: Patch communication to bitwallet.co.jp
# Option --patch-qriocity: Patch communication to qriocity.com
# Option --patch-trendmicro: Patch communication to trendmicro.com
# Option --patch-allmusic: Patch communication to allmusic.com
# Option --patch-intertrust: Patch communication to intertrust.com
# Option --patch-marlin-drm: Patch communication to marlin-drm.com
# Option --patch-marlin-tmo: Patch communication to marlin-tmo.com
# Option --patch-oasis-open: Patch communication to oasis-open.org
# Option --patch-octopus-drm: Patch communication to octopus-drm.com

# Type --patch-playstation-com: boolean
# Type --patch-playstation-net: boolean
# Type --patch-playstation-org: boolean
# Type --patch-sony: boolean
# Type --patch-bitwallet: boolean
# Type --patch-qriocity: boolean
# Type --patch-trendmicro: boolean
# Type --patch-allmusic: boolean
# Type --patch-intertrust: boolean
# Type --patch-marlin-drm: boolean
# Type --patch-marlin-tmo: boolean
# Type --patch-oasis-open: boolean
# Type --patch-octopus-drm: boolean

namespace eval ::patch_privacy {

array set ::patch_privacy::options {
--patch-allmusic true
--patch-bitwallet true
--patch-intertrust true
--patch-marlin-drm true
--patch-marlin-tmo true
--patch-oasis-open true
--patch-octopus-drm true
--patch-playstation-net true
--patch-playstation-com true
--patch-playstation-org true
--patch-qriocity true
--patch-sony true
--patch-trendmicro true
}

proc main { } {

if {$::patch_privacy::options(--patch-allmusic)} {
set selfs {x3_amgsdk.sprx}
::modify_devflash_files [file join dev_flash vsh module] $selfs ::patch_privacy::patch_allmusic_com_self
}
if {$::patch_privacy::options(--patch-bitwallet)} {
set selfs {edy_plugin.sprx}
::modify_devflash_files [file join dev_flash vsh module] $selfs ::patch_privacy::patch_bitwallet_co_jp_self
}
if {$::patch_privacy::options(--patch-intertrust)} {
set selfs {mcore.self msmw2.sprx}
::modify_devflash_files [file join dev_flash vsh module] $selfs ::patch_privacy::patch_intertrust_com_self
}
if {$::patch_privacy::options(--patch-marlin-drm)} {
set selfs {mcore.self}
::modify_devflash_files [file join dev_flash vsh module] $selfs ::patch_privacy::patch_marlin-drm_com_self
}
if {$::patch_privacy::options(--patch-marlin-tmo)} {
set selfs {mcore.self msmw2.sprx}
::modify_devflash_files [file join dev_flash vsh module] $selfs ::patch_privacy::patch_marlin-tmo_com_self
}
if {$::patch_privacy::options(--patch-oasis-open)} {
set selfs {mcore.self msmw2.sprx}
::modify_devflash_files [file join dev_flash vsh module] $selfs ::patch_privacy::patch_oasis-open_org_self
}
if {$::patch_privacy::options(--patch-octopus-drm)} {
set selfs {mcore.self msmw2.sprx}
::modify_devflash_files [file join dev_flash vsh module] $selfs ::patch_privacy::patch_octopus-drm_com_self
}
if {$::patch_privacy::options(--patch-playstation-com)} {
set selfs {netconf_plugin.sprx sysconf_plugin.sprx}
::modify_devflash_files [file join dev_flash vsh module] $selfs ::patch_privacy::patch_playstation_com_self
}
if {$::patch_privacy::options(--patch-playstation-net)} {
set selfs {libad_core.sprx libmedi.sprx libsysutil_np_clans.sprx libsysutil_np_commerce2.sprx libsysutil_np_util.sprx}
::modify_devflash_files [file join dev_flash sys external] $selfs ::patch_privacy::patch_playstation_net_self

set selfs {autodownload_plugin.sprx download_plugin.sprx esehttp.sprx eula_cddb_plugin.sprx eula_hcopy_plugin.sprx eula_net_plugin.sprx explore_category_friend.sprx explore_category_game.sprx explore_category_music.sprx explore_category_network.sprx explore_category_photo.sprx explore_category_psn.sprx explore_category_sysconf.sprx explore_category_tv.sprx explore_category_user.sprx explore_category_video.sprx explore_plugin.sprx explore_plugin_ft.sprx explore_plugin_np.sprx friendtrophy_plugin.sprx game_ext_plugin.sprx hknw_plugin.sprx nas_plugin.sprx newstore_plugin.sprx np_eula_plugin.sprx np_trophy_plugin.sprx np_trophy_util.sprx photo_network_sharing_plugin.sprx profile_plugin.sprx regcam_plugin.sprx sysconf_plugin.sprx videoeditor_plugin.sprx videoplayer_plugin.sprx videoplayer_util.sprx vsh.self x3_mdimp11.sprx x3_mdimp7.sprx}
::modify_devflash_files [file join dev_flash vsh module] $selfs ::patch_privacy::patch_playstation_net_self
}
if {$::patch_privacy::options(--patch-playstation-org)} {
set selfs {netconf_plugin.sprx sysconf_plugin.sprx}
::modify_devflash_files [file join dev_flash vsh module] $selfs ::patch_privacy::patch_playstation_org_self
}
if {$::patch_privacy::options(--patch-qriocity)} {
set selfs {regcam_plugin.sprx}
::modify_devflash_files [file join dev_flash vsh module] $selfs ::patch_privacy::patch_qriocity_com_self
}
if {$::patch_privacy::options(--patch-sony)} {
set selfs {eula_net_plugin.sprx mintx_client.sprx}
::modify_devflash_files [file join dev_flash vsh module] $selfs ::patch_privacy::patch_sony_com_self
}
if {$::patch_privacy::options(--patch-sony)} {
set selfs {videodownloader_plugin.sprx}
::modify_devflash_files [file join dev_flash vsh module] $selfs ::patch_privacy::patch_sony_co_jp_self
}
if {$::patch_privacy::options(--patch-trendmicro)} {
set selfs {silk.sprx silk_nas.sprx}
::modify_devflash_files [file join dev_flash vsh module] $selfs ::patch_privacy::patch_trendmicro_com_self
}
}

proc patch_allmusic_com_self {self} {
::modify_self_file $self ::patch_privacy::patch_allmusic_com_elf
}
proc patch_bitwallet_co_jp_self {self} {
::modify_self_file $self ::patch_privacy::patch_bitwallet_co_jp_elf
}
proc patch_intertrust_com_self {self} {
::modify_self_file $self ::patch_privacy::patch_intertrust_com_elf
}
proc patch_marlin-drm_com_self {self} {
::modify_self_file $self ::patch_privacy::patch_marlin-drm_com_elf
}
proc patch_marlin-tmo_com_self {self} {
::modify_self_file $self ::patch_privacy::patch_marlin-tmo_com_elf
}
proc patch_oasis-open_org_self {self} {
::modify_self_file $self ::patch_privacy::patch_oasis-open_org_elf
}
proc patch_octopus-drm_com_self {self} {
::modify_self_file $self ::patch_privacy::patch_octopus-drm_com_elf
}
proc patch_playstation_com_self {self} {
::modify_self_file $self ::patch_privacy::patch_playstation_com_elf
}
proc patch_playstation_net_self {self} {
::modify_self_file $self ::patch_privacy::patch_playstation_net_elf
}
proc patch_playstation_org_self {self} {
::modify_self_file $self ::patch_privacy::patch_playstation_org_elf
}
proc patch_qriocity_com_self {self} {
::modify_self_file $self ::patch_privacy::patch_qriocity_com_elf
}
proc patch_sony_com_self {self} {
::modify_self_file $self ::patch_privacy::patch_sony_com_elf
}
proc patch_sony_co_jp_self {self} {
::modify_self_file $self ::patch_privacy::patch_sony_co_jp_elf
}
proc patch_trendmicro_com_self {self} {
::modify_self_file $self ::patch_privacy::patch_trendmicro_com_elf
}

proc patch_playstation_com_elf {elf} {
if {$::patch_privacy::options(--patch-playstation-com)} {
log "Patching [file tail $elf] to disable communication with playstation.com"
# playstation.com
set search "\x70\x6c\x61\x79\x73\x74\x61\x74\x69\x6f\x6e\x2e\x63\x6f\x6d"
# aaaaaaaaaaa.com
set replace "\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x2e\x63\x6f\x6d"
catch_die {::patch_file_multi $elf $search 0 $replace} \
"Unable to patch self [file tail $elf]"
}
}

proc patch_playstation_net_elf {elf} {
if {$::patch_privacy::options(--patch-playstation-net)} {
log "Patching [file tail $elf] to disable communication with playstation.net"
# playstation.net
set search "\x70\x6c\x61\x79\x73\x74\x61\x74\x69\x6f\x6e\x2e\x6e\x65\x74"
# aaaaaaaaaaa.net
set replace "\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x2e\x6e\x65\x74"
catch_die {::patch_file_multi $elf $search 0 $replace} \
"Unable to patch self [file tail $elf]"
# playstation.net
set search "\x70\x00\x6c\x00\x61\x00\x79\x00\x73\x00\x74\x00\x61\x00\x74\x00\x69\x00\x6f\x00\x6e\x00\x2e\x00\x6e\x00\x65\x00\x74"
# aaaaaaaaaaa.net
set replace "\x61\x00\x61\x00\x61\x00\x61\x00\x61\x00\x61\x00\x61\x00\x61\x00\x61\x00\x61\x00\x61\x00\x2e\x00\x6e\x00\x65\x00\x74"
catch_die {::patch_file_multi $elf $search 0 $replace} \
"Unable to patch self [file tail $elf]"
}
}

proc patch_playstation_org_elf {elf} {
if {$::patch_privacy::options(--patch-playstation-org)} {
log "Patching [file tail $elf] to disable communication with playstation.org"
# playstation.org
set search "\x70\x6c\x61\x79\x73\x74\x61\x74\x69\x6f\x6e\x2e\x6f\x72\x67"
# aaaaaaaaaaa.org
set replace "\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x2e\x6f\x72\x67"
catch_die {::patch_file_multi $elf $search 0 $replace} \
"Unable to patch self [file tail $elf]"
}
}

proc patch_sony_com_elf {elf} {
if {$::patch_privacy::options(--patch-sony)} {
log "Patching [file tail $elf] to disable communication with sony.com"
# sony.com
set search "\x73\x6f\x6e\x79\x2e\x63\x6f\x6d"
# aaaa.com
set replace "\x61\x61\x61\x61\x2e\x63\x6f\x6d"
catch_die {::patch_file_multi $elf $search 0 $replace} \
"Unable to patch self [file tail $elf]"
}
}

proc patch_sony_co_jp_elf {elf} {
if {$::patch_privacy::options(--patch-sony)} {
log "Patching [file tail $elf] to disable communication with sony.co.jp"
# sony.co.jp
set search "\x73\x6f\x6e\x79\x2e\x63\x6f\x2e\x6a\x70"
# aaaa.co.jp
set replace "\x61\x61\x61\x61\x2e\x63\x6f\x2e\x6a\x70"
catch_die {::patch_file_multi $elf $search 0 $replace} \
"Unable to patch self [file tail $elf]"
}
}

proc patch_bitwallet_co_jp_elf {elf} {
if {$::patch_privacy::options(--patch-bitwallet)} {
log "Patching [file tail $elf] to disable communication with bitwallet.co.jp"
# bitwallet.co.jp
set search "\x62\x69\x74\x77\x61\x6c\x6c\x65\x74\x2e\x63\x6f\x2e\x6a\x70"
# aaaaaaaaa.co.jp
set replace "\x61\x61\x61\x61\x61\x61\x61\x61\x61\x2e\x63\x6f\x2e\x6a\x70"
catch_die {::patch_file_multi $elf $search 0 $replace} \
"Unable to patch self [file tail $elf]"
}
}

proc patch_qriocity_com_elf {elf} {
if {$::patch_privacy::options(--patch-qriocity)} {
log "Patching [file tail $elf] to disable communication with qriocity.com"
# qriocity.com
set search "\x71\x72\x69\x6f\x63\x69\x74\x79\x2e\x63\x6f\x6d"
# aaaaaaaa.com
set replace "\x61\x61\x61\x61\x61\x61\x61\x61\x2e\x63\x6f\x6d"
catch_die {::patch_file_multi $elf $search 0 $replace} \
"Unable to patch self [file tail $elf]"
}
}

proc patch_trendmicro_com_elf {elf} {
if {$::patch_privacy::options(--patch-trendmicro)} {
log "Patching [file tail $elf] to disable communication with trendmicro.com"
# trendmicro.com
set search "\x74\x72\x65\x6e\x64\x6d\x69\x63\x72\x6f\x2e\x63\x6f\x6d"
# aaaaaaaaaa.com
set replace "\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x2e\x63\x6f\x6d"
catch_die {::patch_file_multi $elf $search 0 $replace} \
"Unable to patch self [file tail $elf]"
}
}

proc patch_allmusic_com_elf {elf} {
if {$::patch_privacy::options(--patch-allmusic)} {
log "Patching [file tail $elf] to disable communication with allmusic.com"
# allmusic.com
set search "\x61\x6c\x6c\x6d\x75\x73\x69\x63\x2e\x63\x6f\x6d"
# aaaaaaaa.com
set replace "\x61\x61\x61\x61\x61\x61\x61\x61\x2e\x63\x6f\x6d"
catch_die {::patch_file_multi $elf $search 0 $replace} \
"Unable to patch self [file tail $elf]"
}
}

proc patch_intertrust_com_elf {elf} {
if {$::patch_privacy::options(--patch-intertrust)} {
log "Patching [file tail $elf] to disable communication with intertrust.com"
# intertrust.com
set search "\x69\x6e\x74\x65\x72\x74\x72\x75\x73\x74\x2e\x63\x6f\x6d"
# aaaaaaaaaa.com
set replace "\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x2e\x63\x6f\x6d"
catch_die {::patch_file_multi $elf $search 0 $replace} \
"Unable to patch self [file tail $elf]"
}
}

proc patch_marlin-tmo_com_elf {elf} {
if {$::patch_privacy::options(--patch-marlin-tmo)} {
log "Patching [file tail $elf] to disable communication with marlin-tmo.com"
# marlin-tmo.com
set search "\x6d\x61\x72\x6c\x69\x6e\x2d\x74\x6d\x6f\x2e\x63\x6f\x6d"
# aaaaaaaaaa.com
set replace "\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x2e\x63\x6f\x6d"
catch_die {::patch_file_multi $elf $search 0 $replace} \
"Unable to patch self [file tail $elf]"
}
}

proc patch_marlin-drm_com_elf {elf} {
if {$::patch_privacy::options(--patch-marlin-drm)} {
log "Patching [file tail $elf] to disable communication with marlin-drm.com"
# marlin-drm.com
set search "\x6d\x61\x72\x6c\x69\x6e\x2d\x64\x72\x6d\x2e\x63\x6f\x6d"
# aaaaaaaaaa.com
set replace "\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x2e\x63\x6f\x6d"
catch_die {::patch_file_multi $elf $search 0 $replace} \
"Unable to patch self [file tail $elf]"
}
}

proc patch_oasis-open_org_elf {elf} {
if {$::patch_privacy::options(--patch-oasis-open)} {
log "Patching [file tail $elf] to disable communication with oasis-open.org"
# oasis-open.org
set search "\x6f\x61\x73\x69\x73\x2d\x6f\x70\x65\x6e\x2e\x6f\x72\x67"
# aaaaaaaaaa.org
set replace "\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x2e\x6f\x72\x67"
catch_die {::patch_file_multi $elf $search 0 $replace} \
"Unable to patch self [file tail $elf]"
}
}

proc patch_octopus-drm_com_elf {elf} {
if {$::patch_privacy::options(--patch-octopus-drm)} {
log "Patching [file tail $elf] to disable communication with octopus-drm.com"
# octopus-drm.com
set search "\x6f\x63\x74\x6f\x70\x75\x73\x2d\x64\x72\x6d\x2e\x63\x6f\x6d"
# aaaaaaaaaaa.com
set replace "\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x2e\x63\x6f\x6d"
catch_die {::patch_file_multi $elf $search 0 $replace} \
"Unable to patch self [file tail $elf]"
}
}
}


patch_shop

SAVE FILE AS: patch_shop.tcl add to 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: 2300
# Description: Patch firmware for installation shop/promo unit

# Option --patch-promo-flags: Patch promo_flags file
# Option --patch-update-flags: Patch update_flags file
# Option --patch-version: Append string to build version

# Type --patch-promo-flags: boolean
# Type --patch-update-flags: boolean
# Type --patch-version: string

namespace eval ::patch_shop {

array set ::patch_shop::options {
--patch-promo-flags true
--patch-update-flags true
--patch-version "Promotional-to-Retail"
}

proc main {} {
if {$::patch_shop::options(--patch-promo-flags)} {
debug "Patching [file tail $::CUSTOM_PROMO_FLAGS_TXT]"
set fd [open $::CUSTOM_PROMO_FLAGS_TXT w]
puts -nonewline $fd "0"
close $fd
}
if {$::patch_shop::options(--patch-update-flags)} {
debug "Patching [file tail $::CUSTOM_UPDATE_FLAGS_TXT]"
set fd [open $::CUSTOM_UPDATE_FLAGS_TXT w]
puts -nonewline $fd "0300"
close $fd
}
if {$::patch_shop::options(--patch-version) != ""} {
append ::options(--build-suffix) "($::patch_shop::options(--patch-version))"
}
}
}


patch_translations

SAVE FILE AS: patch_translations add to tasks folder

#!/usr/bin/tclsh
#
# ps3mfw.tcl -- 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: 2000
# Description: Patch translations: fix typos, change strings, replace languages

# Option --fix-typo-sysconf-Italian: Fix a typo in the Italian localization of the sysconf plugin

# Type --fix-typo-sysconf-Italian: boolean

namespace eval ::patch_translations {

array set ::patch_translations::options {
--fix-typo-sysconf-Italian true
}

proc main { } {
if {$::patch_translations::options(--fix-typo-sysconf-Italian)} {
fix_typo_sysconf_Italian
}
}

proc fix_typo_sysconf_Italian { } {
set SYSCONF_PLUGIN_RCO [file join dev_flash vsh resource sysconf_plugin.rco]
::modify_rco_file $SYSCONF_PLUGIN_RCO ::patch_translations::callback_fix_typo_sysconf_Italian
}

proc callback_fix_typo_sysconf_Italian {path args} {
log "Patching Italian.xml into [file tail $path]"
sed_in_place [file join $path Italian.xml] backuip backup
}

}



patch_vsh

SAVE FILE AS: patch_vsh.tcl add to 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: 700
# Description: Patch Application launcher

# Option --allow-unsigned-app: Patch to allow running of unsigned applications

# Type --allow-unsigned-app: boolean

namespace eval ::patch_vsh {

array set ::patch_vsh::options {
--allow-unsigned-app true
}

proc main { } {
set self [file join dev_flash vsh module vsh.self]

::modify_devflash_file $self ::patch_vsh::patch_self
}

proc patch_self {self} {
if {!$::patch_vsh::options(--allow-unsigned-app)} {
log "WARNING: Enabled task has no enabled option" 1
} else {
::modify_self_file $self ::patch_vsh::patch_elf
}
}

proc patch_elf {elf} {
if {$::patch_vsh::options(--allow-unsigned-app)} {
log "Patching [file tail $elf] to allow running of unsigned applications"

set search "\xF8\x21\xFF\x81\x7C\x08\x02\xA6\x38\x61\x00\x70\xF8\x01\x00\x90\x4B\xFF\xFF\xE1\x38\x00\x00\x00"
set replace "\x38\x60\x00\x01\x4E\x80\x00\x20"

catch_die {::patch_elf $elf $search 0 $replace} "Unable to patch self [file tail $elf]"

set search "\xA0\x7F\x00\x04\x39\x60\x00\x01\x38\x03\xFF\x7F\x2B\xA0\x00\x01\x40\x9D\x00\x08\x39\x60\x00\x00"
set replace "\x60\x00\x00\x00"

catch_die {::patch_elf $elf $search 20 $replace} "Unable to patch self [file tail $elf]"

log "WARNING: Running unsigned applications will only work if the kernel also supports this option" 1
}
}
}


patch_xmb_plugin

SAVE FILE AS: patch_xmb_plugin.tcl add to 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: 2500
# Description: Remove unwanted icons from the XMB

# Option --patch-xmb-plugin: Remove below items from the XMB
# Option --patch-xmb-ingame-plugin: Remove below items from the in-game XMB
# Option --remove-user: Remove "Users" icon from the XMB
# Option --remove-sysconf: Remove "Settings" icon from the XMB
# Option --remove-photo: Remove "Photo" icon from the XMB
# Option --remove-music: Remove "Music" icon from the XMB
# Option --remove-video: Remove "Video" icon from the XMB
# Option --remove-tv: Remove "TV" icon from the XMB
# Option --remove-game: Remove "Games" icon from the XMB
# Option --remove-network: Remove "Network" icon from the XMB
# Option --remove-psn: Remove "PlayStation Network" icon from the XMB
# Option --remove-friends: Remove "Friends" icon from the XMB

# Type --patch-xmb-plugin: boolean
# Type --patch-xmb-ingame-plugin: boolean
# Type --remove-user: boolean
# Type --remove-sysconf: boolean
# Type --remove-photo: boolean
# Type --remove-music: boolean
# Type --remove-video: boolean
# Type --remove-tv: boolean
# Type --remove-game: boolean
# Type --remove-network: boolean
# Type --remove-psn: boolean
# Type --remove-friends: boolean

namespace eval ::patch_xmb_plugin {

array set ::patch_xmb_plugin::options {
--patch-xmb-plugin false
--patch-xmb-ingame-plugin false
--remove-user false
--remove-sysconf false
--remove-photo false
--remove-music false
--remove-video false
--remove-tv false
--remove-game false
--remove-network false
--remove-psn false
--remove-friends false
}

proc main {} {
if {$::patch_xmb_plugin::options(--patch-xmb-plugin)} {
set XMB_SPRX [file join dev_flash vsh module xmb_plugin.sprx]
::modify_devflash_file ${XMB_SPRX} ::patch_xmb_plugin::patch_self
}
if {$::patch_xmb_plugin::options(--patch-xmb-ingame-plugin)} {
set XMB_SPRX [file join dev_flash vsh module xmb_ingame.sprx]
::modify_devflash_file ${XMB_SPRX} ::patch_xmb_plugin::patch_self
}
}

proc patch_self {self} {
log "Patching [file tail $self]"
::modify_self_file $self ::patch_xmb_plugin::patch_elf
}

proc patch_elf {elf} {
if {$::patch_xmb_plugin::options(--remove-user)} {
debug "Patching [file tail $elf] to remove user menu"

set search "\x6c\x69\x73\x74\x5f\x75\x73\x65\x72"
set replace "\x00\x00\x00\x00\x00\x00\x00\x00\x00"

catch_die {::patch_elf $elf $search 0 $replace} \
"Unable to patch self [file tail $elf]"
}
if {$::patch_xmb_plugin::options(--remove-sysconf)} {
debug "Patching [file tail $elf] to remove settings menu"

set search "\x6c\x69\x73\x74\x5f\x73\x79\x73\x63\x6f\x6e\x66"
set replace "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"

catch_die {::patch_elf $elf $search 0 $replace} \
"Unable to patch self [file tail $elf]"
}
if {$::patch_xmb_plugin::options(--remove-photo)} {
debug "Patching [file tail $elf] to remove photo menu"

set search "\x6c\x69\x73\x74\x5f\x70\x68\x6f\x74\x6f"
set replace "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"

catch_die {::patch_elf $elf $search 0 $replace} \
"Unable to patch self [file tail $elf]"
}
if {$::patch_xmb_plugin::options(--remove-music)} {
debug "Patching [file tail $elf] to remove music menu"

set search "\x6c\x69\x73\x74\x5f\x6d\x75\x73\x69\x63"
set replace "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"

catch_die {::patch_elf $elf $search 0 $replace} \
"Unable to patch self [file tail $elf]"
}
if {$::patch_xmb_plugin::options(--remove-video)} {
debug "Patching [file tail $elf] to remove video menu"

set search "\x6c\x69\x73\x74\x5f\x76\x69\x64\x65\x6f"
set replace "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"

catch_die {::patch_elf $elf $search 0 $replace} \
"Unable to patch self [file tail $elf]"
}
if {$::patch_xmb_plugin::options(--remove-tv)} {
debug "Patching [file tail $elf] to remove tv menu"

set search "\x6c\x69\x73\x74\x5f\x74\x76"
set replace "\x00\x00\x00\x00\x00\x00\x00"

catch_die {::patch_elf $elf $search 0 $replace} \
"Unable to patch self [file tail $elf]"
}
if {$::patch_xmb_plugin::options(--remove-game)} {
debug "Patching [file tail $elf] to remove game menu"

set search "\x6c\x69\x73\x74\x5f\x67\x61\x6d\x65"
set replace "\x00\x00\x00\x00\x00\x00\x00\x00\x00"

catch_die {::patch_elf $elf $search 0 $replace} \
"Unable to patch self [file tail $elf]"
}
if {$::patch_xmb_plugin::options(--remove-network)} {
debug "Patching [file tail $elf] to remove network menu"

set search "\x6c\x69\x73\x74\x5f\x6e\x65\x74\x77\x6f\x72\x6b"
set replace "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"

catch_die {::patch_elf $elf $search 0 $replace} \
"Unable to patch self [file tail $elf]"
}
if {$::patch_xmb_plugin::options(--remove-psn)} {
debug "Patching [file tail $elf] to remove psn menu"

set search "\x6c\x69\x73\x74\x5f\x70\x73\x6e"
set replace "\x00\x00\x00\x00\x00\x00\x00\x00"

catch_die {::patch_elf $elf $search 0 $replace} \
"Unable to patch self [file tail $elf]"
}
if {$::patch_xmb_plugin::options(--remove-friends)} {
debug "Patching [file tail $elf] to remove friends menu"

set search "\x6c\x69\x73\x74\x5f\x66\x72\x69\x65\x6e\x64"
set replace "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"

catch_die {::patch_elf $elf $search 0 $replace} \
"Unable to patch self [file tail $elf]"
}
}
}


README

Download and add to tasks folder

[ Register or Signin to view external links. ]


spoof_version

SAVE FILE AS: spoof_version.tcl add to 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 { {3.15 38031 001:CEX-ww} {3.41 45039 001:CEX-ww} {3.55 47516 001:CEX-ww} {3.56 48246 001:CEX-ww} {3.60 48686 001:CEX-ww} }

namespace eval ::spoof_version {

array set ::spoof_version::options {
--spoof "3.60 48686 001:CEX-ww"
}

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]

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
}
}

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]
}
}



tv_category

SAVE FILE AS: tv_category.tcl add to 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: 1050
# Description: Add "TV" category to the XMB

# Option --tv-cat: Show TV category in xmb no matter if your country support it.

# Type --tv-cat: boolean


namespace eval ::tv_category {

array set ::tv_category::options {
--tv-cat true
}

proc main {} {
if {$::tv_category::options(--tv-cat)} {
set CATEGORY_XML [file join dev_flash vsh resource explore xmb category_tv.xml]
set XMB_PLUGIN [file join dev_flash vsh module xmb_plugin.sprx]
modify_devflash_file $XMB_PLUGIN ::tv_category::patch_self
}
}

proc patch_self {self} {
log "Patching [file tail $self]"
::modify_self_file $self ::tv_category::patch_elf
}

proc patch_elf {elf} {
log "Patching [file tail $elf] to add tv category"

set search "\x64\x65\x76\x5f\x68\x64\x64\x30\x2f\x67\x61\x6d\x65\x2f\x42\x43\x45\x53\x30\x30\x32\x37\x35"
set replace "\x64\x65\x76\x5f\x66\x6c\x61\x73\x68\x2f\x64\x61\x74\x61\x2f\x63\x65\x72\x74\x00\x00\x00\x00"

catch_die {::patch_elf $elf $search 0 $replace} \
"Unable to patch self [file tail $elf]"
}
}



That's all files of the task folder! Please comment if you need further help. - TweaKii
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.