Open DSchndr opened 3 years ago
29 Images can be extracted, some currnently unknown data is at the end of the file
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Runtime.InteropServices;
namespace PhotonS_UIExtract
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("PhotonS-UIEXtract");
Console.Write("File: ");
string fp = Console.ReadLine();
var fs = new FileStream(fp, FileMode.Open);
var len = (int)fs.Length;
var bits = new byte[len];
fs.Read(bits, 0, len);
int imagecount = 0;
// Dump 25800h (one image) bytes per line, skip a800h padding
for (int ix = 0; ix < len; ix += 0x25800)
{
var cnt = Math.Min(0x25800, len - ix);
var line = new byte[cnt];
Array.Copy(bits, ix, line, 0, cnt);
ix += 0xa800;
imagecount++;
int stride = 4 * ((320 * 2 + 3) / 4);
Bitmap im = new Bitmap(320, 240, stride, PixelFormat.Format16bppRgb565, Marshal.UnsafeAddrOfPinnedArrayElement(line, 0));
im.Save($"ui_{imagecount}.bmp");
}
Console.ReadLine();
}
}
}
How did you manage to extract the UI File? I've tried with the Photonsters UIExtractor, but I only ever get the "Invalid UI file!" error. Extracting the Photonsters Firmware for the Non-S works fine but I havent had any luck extracting the Photon S firmware. Did you modify the tool somehow?
Photon S has a different mainboard with completely diffrerent software on it. You cannot use Chitubox fw or ui on it
My vid should have a download link to the binary that can extract and pack Photon-S ui files https://www.youtube.com/watch?v=ioST-wdf2YM
Btw, if you think about using the ethernet port: forget it, it has absolutely no reference in the firmware and would need firmware patching (you could ask AndyBig) as well as adding the ethernet mac and port to the mainboard
Ok, thats a bummer. Just tried your tool, seems to work pretty well! I absolutely hate the stock firmware style so I might use this to make a dark mode firmware that looks like the photonsters firmware.
I have looked at P_UI_2_6.bin, it contains all images for the ui and presumably gets loaded onto the spi flash near stm32