Making Isolated SPU Modules and Loaders: Difference between revisions

From PS3 Developer wiki
Jump to navigation Jump to search
Line 39: Line 39:
ls -l dump_ata_keys.o
ls -l dump_ata_keys.o


# conert your code to binary
# convert your code to binary


spu-elf-objcopy -O binary dump_ata_keys.o dump_ata_keys.bin
spu-elf-objcopy -O binary dump_ata_keys.o dump_ata_keys.bin
Line 48: Line 48:


unself sb_iso_spu_module.self sb_iso_spu_module.elf
unself sb_iso_spu_module.self sb_iso_spu_module.elf
ls -l sb_iso_spu_module.elf
# print program header of decrypted SPU module
readelf -l sb_iso_spu_module.elf
Elf file type is EXEC (Executable file)
Entry point 0x880
There are 3 program headers, starting at offset 52
Program Headers:
  Type          Offset  VirtAddr  PhysAddr  FileSiz MemSiz  Flg Align
  LOAD          0x000100 0x00000880 0x00000880 0x05040 0x05040 R E 0x80
  LOAD          0x005180 0x00005900 0x00005900 0x00030 0x001c0 RW  0x80
  NOTE          0x0051b0 0x00000000 0x00000000 0x00034 0x00000 R  0x10
Section to Segment mapping:
  Segment Sections...
  00    .unknown .unknown
  01    .unknown .unknown .unknown .unknown
  02    .unknown
</pre>
</pre>


=Example: Making dump_encdec_keys.self=
=Example: Making dump_encdec_keys.self=

Revision as of 20:59, 7 September 2012

Introduction

  • E.g. to dump your ATA, ENCDEC or EID2 keys you have to make signed isolated SPU modules or loaders.
  • This is a tutorial how to do it on Linux (it doesn't matter on PC or PS3).

Tools

SPU GCC Compiler

  • You need SPU GCC compiler to compile your code and create binary version of it.
  • On PS3 Debian, just install spu toolchain.
  • You can also cross-compile SPU GCC toolchain for your Linux PC.

ps3tools

  • You need these tools to decrypt PS3 isolated SPU modules and loaders.
  • You also need it to sign and encrypt your own SPU modules and loaders.
  • self_rebuilder doesn't work properly with isolated SPU modules or loaders. Therefore, i made a new tool which works with isolated SPU modules and loaders. It's called iso_rebuilder.
  • See my GIT repop: http://gitorious.ps3dev.net/ps3otheros/ps3tools


How To Test Isolated SPU Modules and Loaders

  • I test my isolated SPU modules and loaders with PS3 Linux and spuisofs/spuldrfs Virtual File Systems.

spuisofs

spuldrfs

Example: Making dump_ata_keys.self

  • First you need sb_iso_spu_module.self from your NOR/NAND flash or from PS3 update file.
# compile your SPU code

spu-elf-gcc -c dump_ata_keys.S

ls -l dump_ata_keys.o

# convert your code to binary

spu-elf-objcopy -O binary dump_ata_keys.o dump_ata_keys.bin

ls -l dump_ata_keys.bin

# decrypt sb_iso_spu_module.self

unself sb_iso_spu_module.self sb_iso_spu_module.elf

ls -l sb_iso_spu_module.elf

# print program header of decrypted SPU module

readelf -l sb_iso_spu_module.elf

Elf file type is EXEC (Executable file)
Entry point 0x880
There are 3 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000100 0x00000880 0x00000880 0x05040 0x05040 R E 0x80
  LOAD           0x005180 0x00005900 0x00005900 0x00030 0x001c0 RW  0x80
  NOTE           0x0051b0 0x00000000 0x00000000 0x00034 0x00000 R   0x10

 Section to Segment mapping:
  Segment Sections...
   00     .unknown .unknown 
   01     .unknown .unknown .unknown .unknown 
   02     .unknown 

Example: Making dump_encdec_keys.self