Advertisement
Guest User

patch_epilepsy.tcl

a guest
Jun 13th, 2015
552
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 3.16 KB | None | 0 0
  1. #!/usr/bin/tclsh
  2. #
  3. # ps3mfw -- PS3 MFW creator
  4. #
  5. # Copyright (C) Anonymous Developers (Code Monkeys)
  6. # Copyright (C) Ezio (For adding disabler for epilepsy message!)
  7. # Copyright (C) mysis (For reversing and patches!)
  8. #
  9. # This software is distributed under the terms of the GNU General Public
  10. # License ("GPL") version 3, as published by the Free Software Foundation.
  11. #
  12.  
  13. # Priority: 2
  14. # Description: [4.xx] Patch to disable epilepsy message
  15.  
  16. # Option --patch-disable-epilepsy-message-on-cex: [4.xx] Patch to disable the epilepsy message on cex cfw!
  17. # Option --patch-disable-epilepsy-message-on-dex: [4.xx] Patch to disable the epilepsy message on dex cfw!
  18. # Option --patch-disable-epilepsy-message-on-rebug: [4.xx] Patch to disable the epilepsy message on rebug cfw!
  19.  
  20. # Type --patch-disable-epilepsy-message-on-cex: boolean
  21. # Type --patch-disable-epilepsy-message-on-dex: boolean
  22. # Type --patch-disable-epilepsy-message-on-rebug: boolean
  23.  
  24. namespace eval ::patch_epilepsy {
  25.  
  26.     array set ::patch_epilepsy::options {
  27.         --patch-disable-epilepsy-message-on-cex true
  28.         --patch-disable-epilepsy-message-on-dex false
  29.         --patch-disable-epilepsy-message-on-rebug false
  30.     }
  31.  
  32.     proc main {} {
  33.             set self [file join dev_flash vsh module vsh.self]
  34.             set ::SELF "vsh.self"
  35.         if { ${::OLDROUTINE} == "1" } {
  36.         ::modify_devflash_file $self ::patch_epilepsy::patch_self
  37.         } elseif { ${::OLDROUTINE} == "0" } {
  38.         ::modify_devflash_file2 $self ::patch_epilepsy::patch_self
  39.         }
  40.     }
  41.  
  42.     proc patch_self { self } {
  43.             if { ${::OLDROUTINE} == "1" } {
  44.             ::modify_self_file $self ::patch_epilepsy::patch_elf
  45.             } elseif { ${::OLDROUTINE} == "0" } {
  46.             ::modify_self_file2 $self ::patch_epilepsy::patch_elf
  47.             }
  48.     }
  49.  
  50.     proc patch_elf { elf } {
  51.         if {$::patch_epilepsy::options(--patch-disable-epilepsy-message-on-cex) } {
  52.             log "Patching [file tail $elf] to disable epilepsy message on cex cfw"
  53.             log "Added by Ezio"
  54.            
  55.             set search  "\x00\x00\x00\x02\x00\x00\x00\x01\x02\x01\x01\x01\xff\xff\xff\xff"
  56.             set replace "\x00\x00\x00\x02\x00\x00\x00\x01\x02\x00\x01\x01\xff\xff\xff\xff"
  57.  
  58.             catch_die {::patch_elf $elf $search 0 $replace} \
  59.             "Unable to patch self [file tail $elf]"
  60.         }
  61.  
  62.         if {$::patch_epilepsy::options(--patch-disable-epilepsy-message-on-dex) } {
  63.             log "Patching [file tail $elf] to disable epilepsy message on dex cfw"
  64.             log "Added by Ezio"
  65.  
  66.             set search  "\x00\x00\x00\x00\x00\x00\x00\x00\x01\x01\x01\x00\xff\xff\xff\xff"
  67.             set replace "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x01\x00\xff\xff\xff\xff"
  68.            
  69.             catch_die {::patch_elf $elf $search 2 $replace} \
  70.             "Unable to patch self [file tail $elf]"
  71.         }
  72.  
  73.         if {$::patch_epilepsy::options(--patch-disable-epilepsy-message-on-rebug) } {
  74.             log "Patching [file tail $elf] to disable epilepsy message on rebug cfw"
  75.             log "Added by Ezio"
  76.            
  77.             set search  "\x00\x00\x00\x00\x00\x00\x00\x00\x01\x01\x01\x00\xff\xff\xff\xff"
  78.             set replace "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x01\x00\xff\xff\xff\xff"
  79.            
  80.             catch_die {::patch_elf $elf $search 0 $replace} \
  81.             "Unable to patch self [file tail $elf]"
  82.         }
  83.     }
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement