CaramelDunes / prodinfo_gen

A Nintendo Switch payload that can generate minimal, console-unique, PRODINFO files.
GNU General Public License v2.0
74 stars 13 forks source link

Switch Lite Color information #35

Open sthetix opened 1 month ago

sthetix commented 1 month ago

Hello, do you know where do the switch lite store its color information about the analog, d-pad, and abxy button?

Thx.

DraconicNEO commented 2 weeks ago

Best to use the Switch lite color changing thread at #14 it seems like it's a feature they are working on.

sthetix commented 2 weeks ago

I've found the answer, will post solution soon.

cstout1 commented 2 weeks ago

@sthetix have you successfully changed the Switch body shell color via prodinfo? I feel like you potentially covered most of the steps in your "THE PRODINFO GEN TOOL" video but I still haven't found a comprehensive workflow on changing it easily.

sthetix commented 2 weeks ago

yes you can use my PRODIFY app. what does it do ?

Read 3 Bytes for Color: The app reads 3 bytes from offsets 0x4230 (Bezel Color) and 0x4240 (Main Color) in the PRODINFO file. These bytes represent the RGB values of the colors.

Calculate CRC-16: The app pads the 3 color bytes with a fixed 0xFF byte and ten 0x00 bytes to create a 14-byte block. It then calculates a CRC-16 checksum for this block. The 2-byte CRC-16 result is stored in the PRODINFO file at offsets 0x423F (for Bezel Color) and 0x424F (for Main Color).

Calculate SHA-256: After any updates (e.g., changing the serial number at offset 0x250 or colors), the app recalculates the SHA-256 hash of the "body" portion of the PRODINFO file, which starts at offset 0x40 and continues for a length defined by the value at offset 0x08. The resulting SHA-256 hash is written back to the PRODINFO file at offsets 0x20 to 0x3F, ensuring the integrity of the file.

FYI, we cannot change the color of the special edition lites, as it is stored on the offset 0x4330 ColorModel , and i assume only Nintendo know the value.