Giter VIP home page Giter VIP logo

silverutil's Introduction

silverutil

A utility to read and modify the contents of SilverDB files within iPod firmware. Tested on 5th, 6th, and 7th generation iPod nanos.

Usage

For up-to-date information, run silverutil -h:

Usage: silverutil <COMMAND>

Commands:
  extract  Extracts sections within database into a YAML representation
  info     Displays information about contents present within sections
  create   Creates a database from a YAML representation
  help     Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

Each section is transformed to a separate YAML file. An example of a such a representation is as follows, from the section StrT (named StrT.yaml):

magic: StrT
is_sequential: 1
resources:
- id: 1
  contents: !String orientation.landscape
- id: 2
  contents: !String orientation.alt
# [... continues ...]

The special file metadata.yaml is used to preserve the order of sections.

Format

Within the external rsrc ("iPod Resources") filesystem, UI translations and date/time locale can be found in SilverDB.xx_XX.LE.bin), along with bitmap images in SilverImagesDB.LE.bin. There is an additional database internal to osos containing upwards of 40 sections, depending on the version. This contains the default en_US translation.

For detailed information into the format of SilverDB files, please see SilverDB Format or its respective Kaitai Struct definition.

silverutil's People

Contributors

spotlightishere avatar

Stargazers

francesco avatar Jevin Sweval avatar  avatar Luke avatar Noel Towa avatar  avatar YoungChief avatar

Watchers

Jevin Sweval avatar  avatar

silverutil's Issues

Image extraction

I have no idea what I'm doing, but is it possible to extract images using this tool?

SRVL alignment?

The SilverDB file internal to firmware 1.0.2 of the iPod nano 5th generation has odd alignment for the SRVL section: for it, and it alone, an extra 4 bytes of nulls pad it. It does not appear this matters per analysis of firmware, but nonetheless is somewhat confusing. Perhaps the wrong things are being padded?

As of writing, this is manually handled, but it'd be nice to understand why - even if it chalks down to being a generation quirk.

silverutil/src/format.rs

Lines 251 to 258 in 2a2ca15

// TODO(spotlightishere): It appears some sections require more than 4 bytes of alignment. Why?
// As observed by the internal "SRVL" section in firmware 1.0.2 of the iPod nano 5th generation,
// it has an extra four bytes of padding.
//
// We'll manually handle this.
if current_section.magic == [0x4C, 0x56, 0x52, 0x53] {
raw_data_writer.write_u32_le(0)?;
}

Use of unknown flag in section metadata?

It'd be nice to determine what this flag means. The function at 0x08317fec within the iPod nano 5G's 1.0.2 (34A20020) firmware handles its value as zero or one. Consider the following table:

Values for iPod nano 5G internal table
Resource Value
AALI 1
ACST 1
AEVT 0
ANIM 1
CEVT 1
CLov 0
COLR 1
CSov 0
EEEE 0
FONT 1
ITEM 1
LDTm 1
MASt 1
SANI 1
SCRN 1
SCRT 0
SCST 1
SEVT 1
SLst 1
SORC 1
SRVL 1
SStr 0
SUse 0
Str 0
StrT 1
T10N 1
TEVT 1
TLIP 1
TLOP 1
TMLT 1
TVCL 1
TVCS 1
TrIN 1
TrIO 1
TrOO 1
TrOU 1
VCvs 0
VLyt 0
VSlt 0
View 1

The function appears to use the resource ID to avoid iterating through all resource IDs. For example, with section type StrT (starting at 1), it can multiply as needed through resource metadata to obtain its data offset. However, this is not always the case: consider T10N, whose initial index is 229447079 (0x0dad15a7) and is used by other values.

Does another function obtain such a segment's values, or is something else going on here?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.