Documentation ¶
Index ¶
- Variables
- func ReadKeyFile(f io.Reader) ([]byte, error)
- func Test3k3yImage(f afero.File) ([]byte, error)
- type EncryptedISO
- func (e *EncryptedISO) Read(b []byte) (int, error)
- func (e *EncryptedISO) ReadAt(b []byte, off int64) (int, error)
- func (e *EncryptedISO) Seek(offset int64, whence int) (int64, error)
- func (*EncryptedISO) Truncate(int64) error
- func (*EncryptedISO) Write([]byte) (int, error)
- func (*EncryptedISO) WriteAt([]byte, int64) (int, error)
- func (*EncryptedISO) WriteString(string) (int, error)
- type FS
- type ISO3k3y
- func (iso *ISO3k3y) Read(b []byte) (int, error)
- func (iso *ISO3k3y) ReadAt(b []byte, off int64) (int, error)
- func (iso *ISO3k3y) Seek(offset int64, whence int) (int64, error)
- func (*ISO3k3y) Truncate(int64) error
- func (*ISO3k3y) Write([]byte) (int, error)
- func (*ISO3k3y) WriteAt([]byte, int64) (int, error)
- func (*ISO3k3y) WriteString(string) (int, error)
- type VirtualISO
- func (viso *VirtualISO) Close() error
- func (viso *VirtualISO) Name() string
- func (viso *VirtualISO) Read(p []byte) (int, error)
- func (viso *VirtualISO) ReadAt(p []byte, off int64) (int, error)
- func (viso *VirtualISO) Readdir(count int) ([]os.FileInfo, error)
- func (viso *VirtualISO) Readdirnames(n int) ([]string, error)
- func (viso *VirtualISO) Seek(offset int64, whence int) (int64, error)
- func (viso *VirtualISO) Stat() (os.FileInfo, error)
- func (*VirtualISO) Sync() error
- func (*VirtualISO) Truncate(int64) error
- func (*VirtualISO) Write([]byte) (int, error)
- func (*VirtualISO) WriteAt([]byte, int64) (int, error)
- func (*VirtualISO) WriteString(string) (int, error)
Constants ¶
This section is empty.
Variables ¶
var ErrNot3k3y = fmt.Errorf("not 3k3y image")
var ErrNotDirectory = fmt.Errorf("not a directory")
ErrNotDirectory occurs when root path for VirtualISO is not a directory
Functions ¶
func ReadKeyFile ¶ added in v0.0.4
ReadKeyFile reads key file and decodes hex-encoded key.
Types ¶
type EncryptedISO ¶ added in v0.0.4
type EncryptedISO struct {
// contains filtered or unexported fields
}
EncryptedISO is a wrapper to decrypt encrypted images on-the-fly. Redump (and 3k3y dump) is not completely encrypted. It's consist from "regions" (one or more sectors). Only odd regions are encrypted. Region map placed in the beginning of the image. Write operations are blocked due to complexity of implementation. See https://www.psdevwiki.com/ps3/Bluray_disc#Encryption for details.
func NewEncryptedISO ¶ added in v0.0.4
NewEncryptedISO wraps afero.File to EncryptedISO with provided "data1" key. "clearRegions" defines if regions header should be zeroed during reads, some software can't handle non-clear header.
func (*EncryptedISO) ReadAt ¶ added in v0.0.4
func (e *EncryptedISO) ReadAt(b []byte, off int64) (int, error)
func (*EncryptedISO) Seek ¶ added in v0.0.4
func (e *EncryptedISO) Seek(offset int64, whence int) (int64, error)
func (*EncryptedISO) Truncate ¶ added in v0.0.4
func (*EncryptedISO) Truncate(int64) error
func (*EncryptedISO) WriteAt ¶ added in v0.0.4
func (*EncryptedISO) WriteAt([]byte, int64) (int, error)
func (*EncryptedISO) WriteString ¶ added in v0.0.4
func (*EncryptedISO) WriteString(string) (int, error)
type ISO3k3y ¶ added in v0.0.4
type ISO3k3y struct {
// contains filtered or unexported fields
}
ISO3k3y is a simple wrapper to remove 3k3y data on-the-fly during reads. Write operations are blocked because here we don't know how to handle them correctly.
func NewISO3k3y ¶ added in v0.0.4
NewISO3k3y wraps afero.File to ISO3k3y.
type VirtualISO ¶
type VirtualISO struct {
// contains filtered or unexported fields
}
VirtualISO is an on-the-fly generated .iso disk image. According to iso9660 spec image consists of: 1) 16 empty sectors (system area, for ps3 game mode 0 and 1 sectors set) 2) volume descriptors (1 per sector) 3) little-endian and big-endian path tables (multiple entries in one sector, table aligned to sector size) 4) directory entries (multiple in one sector) 5) files PS3 requires also Joliet extension. To support it here added: * supplementary volume descriptor (goes second) * duplicated path tables (same as for plain iso9660 but identifiers encoded with utf16-be w/o bom) after iso ones * duplicated directory entries (like for path tables) after iso ones aligned to sector size The main idea is to make binary representation of parts 1-4 in memory (named fsBuf next) and keep files on disk. So to achieve this file address space partitioned like: * 0 - fsBuf size: binary encoded parts 1-4 (kept inmemory) * fsBuf size - file1 start: file 1 (from disk) * file1 end - file2 end: file 2 (from disk) * fileN start - fileN end: file N (from disk) * lastFile end - volume end: padding area (zero bytes) from last file end to volume end To serve file we need to correctly compare address space boundaries and copy data from fsBuf or open and send file from disk. In ps3 game mode we have to parse PARAM.SFO and get TITLE_ID to create sector 1 and write full volume size to sector 0.
func NewVirtualISO ¶
NewVirtualISO creates a virtual iso object from given root optionally with some data for ps3 games. Root path must be without ..'s.
func (*VirtualISO) Close ¶
func (viso *VirtualISO) Close() error
func (*VirtualISO) Name ¶
func (viso *VirtualISO) Name() string
func (*VirtualISO) Readdirnames ¶
func (viso *VirtualISO) Readdirnames(n int) ([]string, error)
func (*VirtualISO) Sync ¶
func (*VirtualISO) Sync() error
func (*VirtualISO) Truncate ¶
func (*VirtualISO) Truncate(int64) error
func (*VirtualISO) WriteString ¶
func (*VirtualISO) WriteString(string) (int, error)