Multiloader file format

4 views
Skip to first unread message

Jason C.

unread,
Jul 17, 2010, 1:12:11 AM7/17/10
to Eternity Firmware
Here is a C# Struct detailing the last 1024 bytes of our flash files.
Anything that is prefixed with unk should be loaded from another file,
And left alone.


public struct MLEndBlock
{
byte[] Magic = new Byte[4]; //Must be 0xCDABCDAB
//If we read this in reverse like FlashAddr we get 0xABCDABCD,
Funny huh?
byte[] FlashAddr = new Byte[4]; //Bytes need to be read in
reverse.
byte[] unkBlock1 = new Byte[4];
byte[] Model = new Byte[4]; // Convers directly to ASCII
string.
byte[] unkBlock2 = new Byte[28];
byte[] FType = new byte[3]; // Same as model.
byte[] unkBlock3 = new Byte[14];
byte[] unkSpecialBlock1 = new Byte[960]; // Special Block, See
below.
//This block is only present in AMSS.BIN
//It is all zeros in every other file.
}

Jason C.

unread,
Jul 17, 2010, 2:16:03 AM7/17/10
to Eternity Firmware
Here is some sample code from the library i am writing to read and
modify these blocks. Can't yet write the changes out to file, Plan on
working on that next. Although the struct does store everything in an
easily writable format, Just need to plop all variables back into a
1024 byte array and write it out to the last 1024 bytes of the file.

I'll upload the code when its complete.

MLHeader test = new MLHeader("test.rc2");
Console.WriteLine("Magic: 0x{0}",
BitConverter.ToString(BitConverter.GetBytes(test.meb.magic)).Replace("-",
""));
Console.WriteLine("Flash Address: 0x{0}",
BitConverter.ToString(BitConverter.GetBytes(test.meb.flashAddress)).Replace("-",
""));
test.meb.flashAddress = 0x4b00000;
Console.WriteLine("Flash Address: 0x{0}",
BitConverter.ToString(BitConverter.GetBytes(test.meb.flashAddress)).Replace("-",
""));
Console.WriteLine("Phone Model: {0}",
test.meb.PhoneModel);
test.meb.PhoneModel = "TEST";
Console.WriteLine("Phone Model: {0}",
test.meb.PhoneModel);
Console.WriteLine("File Type: {0}", test.meb.ImageType);
test.meb.ImageType = "TST";
Console.WriteLine("File Type: {0}", test.meb.ImageType);
Console.ReadLine();
Reply all
Reply to author
Forward
0 new messages