mirror of
https://github.com/LongSoft/UEFITool.git
synced 2025-05-13 06:34:42 -04:00
NE_aplha5
Added FIT detection, parsing and UI, finally
This commit is contained in:
parent
f3d731c599
commit
407e558b60
16 changed files with 472 additions and 100 deletions
|
@ -30,36 +30,6 @@ const QVector<QByteArray> FFSv3Volumes =
|
|||
const UINT8 ffsAlignmentTable[] =
|
||||
{ 0, 4, 7, 9, 10, 12, 15, 16 };
|
||||
|
||||
UINT8 calculateChecksum8(const UINT8* buffer, UINT32 bufferSize)
|
||||
{
|
||||
if (!buffer)
|
||||
return 0;
|
||||
|
||||
UINT8 counter = 0;
|
||||
|
||||
while (bufferSize--)
|
||||
counter += buffer[bufferSize];
|
||||
|
||||
return (UINT8)(0x100 - counter);
|
||||
}
|
||||
|
||||
UINT16 calculateChecksum16(const UINT16* buffer, UINT32 bufferSize)
|
||||
{
|
||||
if (!buffer)
|
||||
return 0;
|
||||
|
||||
UINT16 counter = 0;
|
||||
UINT32 index = 0;
|
||||
|
||||
bufferSize /= sizeof(UINT16);
|
||||
|
||||
for (; index < bufferSize; index++) {
|
||||
counter = (UINT16)(counter + buffer[index]);
|
||||
}
|
||||
|
||||
return (UINT16)(0x10000 - counter);
|
||||
}
|
||||
|
||||
VOID uint32ToUint24(UINT32 size, UINT8* ffsSize)
|
||||
{
|
||||
ffsSize[2] = (UINT8)((size) >> 16);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue