Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

BRICK RISK! for documenting purpose only

By: a guest on Nov 7th, 2011  |  syntax: None  |  size: 1.30 KB  |  views: 1,657  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/usr/bin/tclsh
  2. #
  3. # ps3mfw -- PS3 MFW creator
  4. #
  5. # Copyright (C) Anonymous Developers (Code Monkeys)
  6. #
  7. # This software is distributed under the terms of the GNU General Public
  8. # License ("GPL") version 3, as published by the Free Software Foundation.
  9. #
  10.  
  11. # Priority: 300
  12. # Description: Patching LV1 hypervisor to Unmask bootldr by HV (BRICK RISK! for documenting purpose only)
  13.  
  14. # Option --unmask-lv1: Unmask bootldr by HV
  15.  
  16. # Type --unmask-lv1: boolean
  17.  
  18. namespace eval ::unmask_lv1 {
  19.  
  20.     array set ::unmask_lv1::options {
  21.         --unmask-lv1 true
  22.     }
  23.  
  24.     proc main { } {
  25.         set self "lv1.self"
  26.  
  27.         ::modify_coreos_file $self ::unmask_lv1::patch_self
  28.     }
  29.  
  30.     proc patch_self {self} {
  31.         if {!$::unmask_lv1::options(--unmask-lv1)} {
  32.             log "WARNING: Enabled task has no enabled option" 1
  33.         } else {
  34.             ::modify_self_file $self ::unmask_lv1::patch_elf
  35.         }
  36.     }
  37.  
  38.     proc patch_elf {elf} {
  39.         if {$::unmask_lv1::options(--unmask-lv1)} {
  40.             log "Patching LV1 hypervisor to Unmask bootldr by HV"
  41.  
  42.             set search  "\x39\x84\x02\x00\xf8\x01\x00\x90"
  43.             set replace "\x00"
  44.  
  45.             catch_die {::patch_elf $elf $search 2 $replace} \
  46.                 "Unable to patch self [file tail $elf]"
  47.         }
  48.     }
  49. }
  50.  
  51.