spotlightishere / silverutil

Utility to read/manipulate iPod nano SilverDB resource databases
MIT License
8 stars 0 forks source link

Use of unknown flag in section metadata? #1

Closed spotlightishere closed 1 year ago

spotlightishere commented 1 year ago

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?

spotlightishere commented 1 year ago

It appears that this is only for certain types loaded in a specific way. I'm unclear on why other types are marked as sequential when they clearly are not - perhaps it's a default, or something else is indeed going on here.

For now, I've renamed unknown_flags to is_sequential in c5152cbeb956b5d5874a1dc8709908b5550085a0. Please feel free to comment on this issue if it's discovered that other sections handle the flag differently!