Advertisement
Guest User

BRICK RISK! for documenting purpose only

a guest
Nov 7th, 2011
2,194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  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.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement