i subscribed by pure persistence and you have to do it without google as it interferes with the registration, just copy and paste anything that you don't understand into google translate and it will translate it for you (even if it looks like question marks, its still chinese underneath)
well i cant download it (need 50 posts) and i don't have that yet, but from what i have read i cant really see what they are doing, a little seems to be someone harping on about transparency and alpha but getting mixed up, because the firmware can have transparent icons they think its alpha, but its not rue alpha, just a solid color to select and replace as transparent
i may be wrong here but i really do not think this is what it seems, but i may be wrong, maybe the code the guy has written takes in png images and processes them internally to BMP images, replacing the transparent areas with green????????
this is a snippit of code from the imagesearcher, and it seems to be all that it is, no UI for it from what i can gather
what this is doing is looking in the firmware and generating an LST file for use in the original tool we used called the image search editor, this is a text file that you load into the editor that basically is a list of all the images in the firmware, so what this has to do with PNG files i am not sure at all on the searcher at all, might be a red herring.
the imagesearcheditor has been overtaken by the rkuieditor, but this tool could be good as if it does generate the list automatically, (used to have to do it manually|) then what that means is we can export all the images out of the firmware as bmp images as templates
Code:
namespace T50ImageSearcher
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btOpen_Click(object sender, EventArgs e)
{
int i=1;
long picOffset=0;
long offset = 0;
string firmName = "E:\\TL-T50\\TL-T50.RKW";
string lstFileName = "E:\\TL-T50\\TL-T50.RKW.lst";
string tmpStr = "";
FileStream fileFirm = File.Open(firmName, FileMode.Open);
StreamWriter lstFile = new StreamWriter(lstFileName);
Bitmap picTmp;
do{
picTmp=getBitmapFromFirmWare(fileFirm, offset,out picOffset);
if (picTmp!=null){
offset = picOffset+1;
picTmp.Save("E:\\TL-T50\\Pic"+Convert.ToString(i)+".bmp";
tmpStr="Pic"+Convert.ToString(i)+","+Convert.ToString(picOffset+8,16)+","+Convert.ToString(picTmp.Width)+"x"+
Convert.ToString(picTmp.Height)+",32,"+fileFirm.Name;
i++;
lstFile.WriteLine(tmpStr);
lstFile.Flush();
}
}while(picTmp!=null);
fileFirm.Close();
lstFile.Close();
}
private bool isBitmapPosition(FileStream inputFile,long offset,out int width,out int height)
{
byte[] dataBuff=new byte[8];
width = 0;
height = 0;
inputFile.Seek(offset, SeekOrigin.Begin);
inputFile.Read(dataBuff, 0, 8) ;
if (dataBuff[4] == 0x20 && dataBuff[5] == 0x00&& dataBuff[6]==0x00&&dataBuff[7]==0x00)
{
width = dataBuff[1] * 256 + dataBuff[0];
height = dataBuff[3] * 256 + dataBuff[2];
if (width < 300 && height < 500 && width>0 && height>0)
{
return true;
}
}
return false;
}
private Bitmap creatBitmapFromFirm(FileStream inputFile, long offset,int picWidth, int picHeight)
{
Bitmap tmpBitmap = new Bitmap(picWidth, picHeight,PixelFormat.Format32bppRgb);
int i = 0;
for (i = 0; i< picHeight * picWidth;i++)
{
inputFile.Seek(offset+i)*4), SeekOrigin.Begin);
byte[] dataBuff=new byte[4];
inputFile.Read(dataBuff,0,4);
Color tmpColor = Color.FromArgb(dataBuff[2], dataBuff[1], dataBuff[0]);
tmpBitmap.SetPixel(i % picWidth, i / picWidth, tmpColor);
}
return tmpBitmap;
}
private Bitmap getBitmapFromFirmWare(FileStream inputFile, long offset ,out long picOffset)
{
long i = offset;
int picWidth=0;
int picHeight=0;
Bitmap tmpBmp;
for (; i < inputFile.Length-8; i++)
{
if (isBitmapPosition(inputFile, i,out picWidth,out picHeight))
{
picOffset = i;
tmpBmp = creatBitmapFromFirm(inputFile, i + 8, picWidth, picHeight);
return tmpBmp;
}
}
picOffset = -1;
return null;
}
}
}