https://www.Exploitee.rs/api.php?action=feedcontributions&user=Thoughtfraud&feedformat=atom
Exploitee.rs - User contributions [en]
2024-03-29T00:32:50Z
User contributions
MediaWiki 1.37.2
https://www.Exploitee.rs/index.php?title=Teddy_Ruxpin&diff=3056
Teddy Ruxpin
2021-11-06T09:08:58Z
<p>Thoughtfraud: Restore SNX Rom heading</p>
<hr />
<div>__FORCETOC__<br />
{{Disclaimer}}<br />
[[File:TeddyRuxpin.jpg|left|thumb|140px]]<br />
[[Category:Toys]]<br />
<br />
== Teardown == <br />
<br />
== Hardware ==<br />
<br />
== Software ==<br />
<br />
== BLE Info ==<br />
<br />
== SNX Rom ==<br />
<pre><br />
/**<br />
* Teddy Ruxpin SNXROM BIN format<br />
* <br />
* Note: Byte-order is little-endian unless stated.<br />
*/<br />
<br />
#define uint32_t unsigned int<br />
#define uint16_t unsigned short<br />
#define uint8_t unsigned char<br />
<br />
#define char16_t unsigned short<br />
#define char8_t unsigned char<br />
<br />
/**<br />
* This header appears at the start of the file.<br />
*/<br />
struct SNXROMHeader {<br />
char16_t SNXROM[6]; // always "SNXROM"<br />
uint8_t unknown[28]; // all 0xFF<br />
uint32_t _unknown; // always 0x400<br />
uint32_t assetTableLength; // Size of the asset table. (Multiply by 4 for bytes)<br />
uint8_t __unknown[464]; // all 0xFF<br />
/**<br />
* assetTablePointers[0] normally points to Metadata. (Idle BIN does not have any metadata though).<br />
* <br />
* Then in order, follows pointers to:<br />
* Left Eye Bitmaps<br />
* Right Eye Bitmaps<br />
* Audio Headers<br />
*/ <br />
uint32_t assetTablePointers[];<br />
};<br />
<br />
/**<br />
* General information about this BIN file<br />
*/ <br />
struct ROMMetadata {<br />
uint16_t unknown; // always 0x0<br />
/**<br />
* 0 - Intro "Hi. My name is Teddy Ruxpin. Can you and I be friends?"<br />
* 1 - All About Bears<br />
* 2 - The Airship<br />
* 3 - Captured by MudBlups<br />
* 4 - Wooly and The Wizard<br />
* 5 - The Missing Princess<br />
* 6 - Grubby's Romance<br />
* 7 - The Day Teddy Met Grubby<br />
* 8 - Teddy Ruxpin's Birthday<br />
* 9 - Teddy Ruxpin's Christmas<br />
* 10 - Teddy Ruxpin Lullabies<br />
* 11 - Double Grubby<br />
* 12 - The Story of the Faded Fobs<br />
* 14 - Teddy Ruxpin Summertime<br />
* 15 - Grundo Springtime Singtime<br />
*/<br />
uint16_t storyId;<br />
uint16_t numberOfEyeAnimations;<br />
uint16_t numberOfEyeBitmaps;<br />
uint16_t numberOfVideoSequences;<br />
uint16_t numberOfAudioBlocks;<br />
/**<br />
* ROM file size = (fileSizeUpper) << 16 + fileSizeLower;<br />
* <br />
* In Stories 12, 13 & 15, this value is incorrectly copied from Story 11.<br />
*/ <br />
uint16_t fileSizeUpper;<br />
uint16_t fileSizeLower;<br />
uint8_t _unknown[16]; // all 0xFF <br />
/**<br />
* In order, follows:<br />
* - EyeAnimationMetadata<br />
* - VideoAudioSequence<br />
*/ <br />
MetadataObject metadataObjects[];<br />
};<br />
<br />
typedef struct MetadataObject { <br />
} MetadataObject;<br />
<br />
/**<br />
* An eye animation is defined by using sequencing a number of eye bitmap;<br />
* specifying a start and a number of frames.<br />
* <br />
* eyeId is based on it's offset in assetTablePointers.<br />
*/ <br />
typedef struct EyeAnimationMetadata : MetadataObject { <br />
/**<br />
* These identifiers start at 0xB to avoid collision <br />
* with other identifiers in the mark table.<br />
*/ <br />
uint16_t animationId;<br />
uint16_t startEyeId;<br />
uint16_t numberOfEyeFrames;<br />
uint8_t _unknown[26]; // all 0xFF <br />
} EyeAnimationMetadata;<br />
<br />
/**<br />
* An video audio sequence is defined by sequencing a number of audio blocks;<br />
* specifying a start and a number of blocks.<br />
* <br />
* (Most videos usually only have 1 associated audio block).<br />
*/ <br />
typedef struct VideoAudioSequence : MetadataObject {<br />
uint16_t videoId;<br />
uint16_t startAudioId;<br />
uint16_t numberOfAudioBlocks;<br />
uint8_t _unknown[26]; // all 0xFF<br />
};<br />
<br />
/**<br />
* A bitmap which represents a single eye.<br />
* Pixel encoding is RGB565.<br />
* Pixel order starts from top-left.<br />
* Each Bitmap is 128x128.<br />
*/<br />
struct EyeBitmap {<br />
uint16_t pixels[16384];<br />
};<br />
<br />
struct AudioHeader {<br />
char8_t AU[2]; // always "AU"<br />
uint16_t sampleRate; // always 16,000Hz<br />
/**<br />
* (compressed) bit rate = bitRate * 10<br />
*/ <br />
uint16_t bitRate; // always 3200 (32 kbps)<br />
uint16_t channels; // always 1 (mono) <br />
uint32_t totalAudioFrames;<br />
/** <br />
* size (in bytes) = sizeOfAudioBinary * 2<br />
* <br />
* Also at 32 kbps, each block is 80 bytes, <br />
* so this is also equal to totalAudioFrames * 80<br />
* <br />
* Note: Some 0xFFs will normally pad audio binary data afterwards.<br />
*/ <br />
uint32_t sizeOfAudioBinary;<br />
uint16_t markFlag; // always 1 (enabled)<br />
uint16_t silenceFlag; // always 0 (disabled)<br />
uint16_t _unknown; // always 0x0<br />
uint16_t __unknown; // always 0xFFFF<br />
uint16_t ___unknown; // always 0x0<br />
/**<br />
* Audio binary data proceeds this header struct.<br />
* Use the header size to figure its starting address.<br />
*/ <br />
uint16_t headerSize;<br />
MarkTable markTable;<br />
};<br />
<br />
/**<br />
* A table which coordinates eye animations and mouth movement, with audio.<br />
*/<br />
typedef struct MarkTable {<br />
/**<br />
* size (in bytes) = tableLength * 2<br />
*/ <br />
uint16_t tableLength;<br />
<br />
/**<br />
* Entries in the table are sequential.<br />
* Each entry has a duration (milliseconds) and an identifier.<br />
* The duration represents a period of time that elapses before the next action.<br />
* <br />
* If the duration is equal or below 32,767 ms, then the entry is as follows:<br />
* uint16_t duration;<br />
* uint16_t identifier;<br />
* <br />
* If the duration exceeds 32,767 ms, then the entry is 6 bytes is as follows:<br />
* uint16_t durationUpper;<br />
* uint16_t durationLower;<br />
* uint16_t identifier;<br />
* <br />
* Where:<br />
* - durationUpper must have MSB set (i.e. durationUpper & 0x8000 === durationUpper is true)<br />
* - duration = (durationUpper & 0x7FFF) << 16 + durationLower;<br />
* <br />
* Identifiers:<br />
* - 0x00 mouth closed<br />
* - 0x01 mouth half open<br />
* - 0x02 mouth fully open<br />
* - >= 0x03 matches an animationId<br />
* - >= 0x60 (To be confirmed)<br />
*/ <br />
uint16_t tableWords[];<br />
<br />
} MarkTable;<br />
</pre><br />
<br />
== Video ==<br />
<br />
== Audio ==</div>
Thoughtfraud
https://www.Exploitee.rs/index.php?title=Teddy_Ruxpin&diff=3055
Teddy Ruxpin
2021-11-06T09:05:49Z
<p>Thoughtfraud: /* SNX Rom */ Initial start to document ROM structure</p>
<hr />
<div>__FORCETOC__<br />
{{Disclaimer}}<br />
[[File:TeddyRuxpin.jpg|left|thumb|140px]]<br />
[[Category:Toys]]<br />
<br />
== Teardown == <br />
<br />
== Hardware ==<br />
<br />
== Software ==<br />
<br />
== BLE Info ==<br />
<br />
<pre><br />
/**<br />
* Teddy Ruxpin SXROM BIN format<br />
* <br />
* Note: Byte-order is little-endian unless stated.<br />
*/<br />
<br />
#define uint32_t unsigned int<br />
#define uint16_t unsigned short<br />
#define uint8_t unsigned char<br />
<br />
#define char16_t unsigned short<br />
#define char8_t unsigned char<br />
<br />
/**<br />
* This header appears at the start of the file.<br />
*/<br />
struct SXROMHeader {<br />
char16_t SNXROM[6]; // always "SNXROM"<br />
uint8_t unknown[28]; // all 0xFF<br />
uint32_t _unknown; // always 0x400<br />
uint32_t assetTableLength; // Size of the asset table. (Multiply by 4 for bytes)<br />
uint8_t __unknown[464]; // all 0xFF<br />
/**<br />
* assetTablePointers[0] normally points to Metadata. (Idle BIN does not have any metadata though).<br />
* <br />
* Then in order, follows pointers to:<br />
* Left Eye Bitmaps<br />
* Right Eye Bitmaps<br />
* Audio Headers<br />
*/ <br />
uint32_t assetTablePointers[];<br />
};<br />
<br />
/**<br />
* General information about this BIN file<br />
*/ <br />
struct ROMMetadata {<br />
uint16_t unknown; // always 0x0<br />
/**<br />
* 0 - Intro "Hi. My name is Teddy Ruxpin. Can you and I be friends?"<br />
* 1 - All About Bears<br />
* 2 - The Airship<br />
* 3 - Captured by MudBlups<br />
* 4 - Wooly and The Wizard<br />
* 5 - The Missing Princess<br />
* 6 - Grubby's Romance<br />
* 7 - The Day Teddy Met Grubby<br />
* 8 - Teddy Ruxpin's Birthday<br />
* 9 - Teddy Ruxpin's Christmas<br />
* 10 - Teddy Ruxpin Lullabies<br />
* 11 - Double Grubby<br />
* 12 - The Story of the Faded Fobs<br />
* 14 - Teddy Ruxpin Summertime<br />
* 15 - Grundo Springtime Singtime<br />
*/<br />
uint16_t storyId;<br />
uint16_t numberOfEyeAnimations;<br />
uint16_t numberOfEyeBitmaps;<br />
uint16_t numberOfVideoSequences;<br />
uint16_t numberOfAudioBlocks;<br />
/**<br />
* ROM file size = (fileSizeUpper) << 16 + fileSizeLower;<br />
* <br />
* In Stories 12, 13 & 15, this value is incorrectly copied from Story 11.<br />
*/ <br />
uint16_t fileSizeUpper;<br />
uint16_t fileSizeLower;<br />
uint8_t _unknown[16]; // all 0xFF <br />
/**<br />
* In order, follows:<br />
* - EyeAnimationMetadata<br />
* - VideoAudioSequence<br />
*/ <br />
MetadataObject metadataObjects[];<br />
};<br />
<br />
typedef struct MetadataObject { <br />
} MetadataObject;<br />
<br />
/**<br />
* An eye animation is defined by using sequencing a number of eye bitmap;<br />
* specifying a start and a number of frames.<br />
* <br />
* eyeId is based on it's offset in assetTablePointers.<br />
*/ <br />
typedef struct EyeAnimationMetadata : MetadataObject { <br />
/**<br />
* These identifiers start at 0xB to avoid collision <br />
* with other identifiers in the mark table.<br />
*/ <br />
uint16_t animationId;<br />
uint16_t startEyeId;<br />
uint16_t numberOfEyeFrames;<br />
uint8_t _unknown[26]; // all 0xFF <br />
} EyeAnimationMetadata;<br />
<br />
/**<br />
* An video audio sequence is defined by sequencing a number of audio blocks;<br />
* specifying a start and a number of blocks.<br />
* <br />
* (Most videos usually only have 1 associated audio block).<br />
*/ <br />
typedef struct VideoAudioSequence : MetadataObject {<br />
uint16_t videoId;<br />
uint16_t startAudioId;<br />
uint16_t numberOfAudioBlocks;<br />
uint8_t _unknown[26]; // all 0xFF<br />
};<br />
<br />
/**<br />
* A bitmap which represents a single eye.<br />
* Pixel encoding is RGB565.<br />
* Pixel order starts from top-left.<br />
* Each Bitmap is 128x128.<br />
*/<br />
struct EyeBitmap {<br />
uint16_t pixels[16384];<br />
};<br />
<br />
struct AudioHeader {<br />
char8_t AU[2]; // always "AU"<br />
uint16_t sampleRate; // always 16,000Hz<br />
/**<br />
* (compressed) bit rate = bitRate * 10<br />
*/ <br />
uint16_t bitRate; // always 3200 (32 kbps)<br />
uint16_t channels; // always 1 (mono) <br />
uint32_t totalAudioFrames;<br />
/** <br />
* size (in bytes) = sizeOfAudioBinary * 2<br />
* <br />
* Also at 32 kbps, each block is 80 bytes, <br />
* so this is also equal to totalAudioFrames * 80<br />
* <br />
* Note: Some 0xFFs will normally pad audio binary data afterwards.<br />
*/ <br />
uint32_t sizeOfAudioBinary;<br />
uint16_t markFlag; // always 1 (enabled)<br />
uint16_t silenceFlag; // always 0 (disabled)<br />
uint16_t _unknown; // always 0x0<br />
uint16_t __unknown; // always 0xFFFF<br />
uint16_t ___unknown; // always 0x0<br />
/**<br />
* Audio binary data proceeds this header struct.<br />
* Use the header size to figure its starting address.<br />
*/ <br />
uint16_t headerSize;<br />
MarkTable markTable;<br />
};<br />
<br />
/**<br />
* A table which coordinates eye animations and mouth movement, with audio.<br />
*/<br />
typedef struct MarkTable {<br />
/**<br />
* size (in bytes) = tableLength * 2<br />
*/ <br />
uint16_t tableLength;<br />
<br />
/**<br />
* Entries in the table are sequential.<br />
* Each entry has a duration (milliseconds) and an identifier.<br />
* The duration represents a period of time that elapses before the next action.<br />
* <br />
* If the duration is equal or below 32,767 ms, then the entry is as follows:<br />
* uint16_t duration;<br />
* uint16_t identifier;<br />
* <br />
* If the duration exceeds 32,767 ms, then the entry is 6 bytes is as follows:<br />
* uint16_t durationUpper;<br />
* uint16_t durationLower;<br />
* uint16_t identifier;<br />
* <br />
* Where:<br />
* - durationUpper must have MSB set (i.e. durationUpper & 0x8000 === durationUpper is true)<br />
* - duration = (durationUpper & 0x7FFF) << 16 + durationLower;<br />
* <br />
* Identifiers:<br />
* - 0x00 mouth closed<br />
* - 0x01 mouth half open<br />
* - 0x02 mouth fully open<br />
* - >= 0x03 matches an animationId<br />
* - >= 0x60 (To be confirmed)<br />
*/ <br />
uint16_t tableWords[];<br />
<br />
} MarkTable;<br />
</pre><br />
<br />
== Video ==<br />
<br />
== Audio ==</div>
Thoughtfraud