-
Notifications
You must be signed in to change notification settings - Fork 20
UGO format
When the Flipnote client calls out to the Flipnote server it requests resources with the UGO extension. These resources respond with a mixture of binary and tab/newline delimited text.
A typical UGO file looks like this:
- Header
- Table of Lengths
- Section #1 (Table of Contents) + NULL padding zipaligning the length by 4
- Section #2 (Embedded files) + NULL padding zipaligning the length by 4
UGO files without Section #2 has been seen, but none without #1
The header describes the structure of the UGO file
The header contains the MAGIC and number of sections in the UGO file. No UGO file is seen with more than 2 sections, namely the Table of Contents and Extra Data section.
Length | Type | Description |
---|---|---|
4 | string | Magic = "UGAR" |
4 | uint32 LE | Number of sections |
Following the Header comes a table containing the length in bytes of each section in the file. There are as many entries here as told in "Number of sections" in the Header.
Each entry looks like this:
Length | Type | Description |
---|---|---|
4 | uint32 LE | Length of section |
Here is where the actual data stored. The offset to each section is: 8 + (4 * number of sections) + lengths of all previous sectionlengths each zipaligned to 4
Read as a textfile. Each line contains tab separated values stored in plain text. URLs, numbers and strings can be found here. All the strings displayed on the DSi are UTF-16LE encoded in base64. The URLs can point to html pages, PPM files and UGO pages. When pointing to a UGO page the extention .uls is used instead of .ugo, but the DSi will still request .ugo from the server.
The first value in each line defines what type of entry it is:
- 0 - Layout options
- 1 - Top screen text (title and flipnote/letter count)
- 2 - Category, the ones in the drop-down menu where you select "most popular" and other sorting methods.
- 3 - Unknown, believed to be the button going to a html page utilizing the POST function further defined with Meta_tags
- 4 - Button/link with an icon or flipnote preview image
Following these "type" indicators are differing amount of values:
Exactly how this section works is yet not fully known. All the values stored in this entry are numbers The first value following the type indicator is believed to set the button layout and the icon set available to buttons.
It has been seen as the following:
- 0 - Buttons form a list of up to 10 buttons. Has its own icon set. Used on index.ugo, the frontpage of Flipnote Hatena, but isn't what sets the top screen to
- 1 - Buttons form a list. Has its own icon set.
- 2 - Buttons form large squares the size of flipnote previews in a grid. Unlimited amount of entires. Has its own icon set.
- 3 - Buttons form a list. Has its own icon set.
- 4 - Buttons form a list. May not have an icon set. This value will be later referenced as the "Layout Type".
The icon sets have yet to be mapped, and #4 is just speculation.
Any following values are yet to be understood.
Following the type indicator are 6 values:
Value # | Type | Description |
---|---|---|
1 | number | Unknown, always seen as 0 |
2 | string (base64) | The title |
3 | string (base64) | Sub title, left aligned |
4 | string (base64) | Sub title, right aligned, sligtly larger than the one to the left |
5 | string (base64) | Don't remember |
6 | string (base64) | Small text at the bottom of the top screen |
An entry to the category drop-down-list available in Layout type 2. The type indicator is followed by these 3 values:
Value # | Type | Description |
---|---|---|
1 | URL | Points to the UGO page for the category |
2 | string (base64) | Category name/label. It starts with a @, like "@All Flipnotes" |
3 | number | Whether it the selected category or not. 0 is False and 1 is True |
This is the button seen in the lower right hand corner, which usually points to a html page. This page has a metatag in the
section which tells what to post where. This button can be seen as the "Post Flipnote" button when browsing flipnotes.The type indicator is followed by these 2 values:
Value # | Type | Description |
---|---|---|
1 | URL | Points to the html page |
2 | string (base64) | Buton label |
This is a labeled button with either a icon or bitmap image pointing to either a UGO page or flipnote PPM. The number of values following the type indicator varies, but these are always present:
Value # | Type | Description |
---|---|---|
1 | URL | Points to the UGO/PPM page |
2 | number | Icon index/trait. Further explained below. |
3 | string (base64) | Button label |
This value can mean several thing. When the Layout Type isn't 2, this is the index of the icon displayed by the label. Values from 100 and up are icon indexes from the preexisting iconset chosed in the Layout Type. Values from 0 to and including 99 are the icon index for the files in the stored in Section #2. UGO.py currently handles this wrong
When the Layout Type is 2, this value can be either 0, 1, 2 or 3. These will add decorator to the button, like a red checkmark as in "read" for letters or a little green frog. I have not yet mapped these. 3 is undecorated and used in flipnote previews. If the trait is 3 and the URL ends with .ppm, the button's picture will be set to the preview bitmap stored in the next/matching TMB file found in Section #2.
Here are all the embedded icons and TMB files stored. They're just appended on eachother.
If the Layout Type isn't 2, then all the files are NTFT each 2048 bytes long. These pack out into 32x32 icons.
If the Layout Type is 2, then all the files are TMB files, each 1696 bytes in length.