Implement Qualcomm Sahara VIP and fix a few bugs

* Qualcomm Sahara VIP
* Project Cleanup
* Allow unlocking an already unlocked phone
This commit is contained in:
Gustave Monce
2021-08-11 14:33:49 +02:00
parent 9f4c92f437
commit c5fcb1ec8d
72 changed files with 987 additions and 861 deletions
+4 -7
View File
@@ -159,7 +159,7 @@ namespace DiscUtils.Fat
int day = date & 0x001F;
int hour = (time & 0xF800) >> 11;
int minute = (time & 0x07E0) >> 5;
int second = (time & 0x001F) * 2 + tenths / 100;
int second = ((time & 0x001F) * 2) + (tenths / 100);
int millis = tenths % 100 * 10;
return new DateTime(year, month, day, hour, minute, second, millis);
@@ -167,15 +167,12 @@ namespace DiscUtils.Fat
private static void DateTimeToFileTime(DateTime value, out ushort date)
{
byte tenths;
ushort time;
DateTimeToFileTime(value, out date, out time, out tenths);
DateTimeToFileTime(value, out date, out ushort time, out byte tenths);
}
private static void DateTimeToFileTime(DateTime value, out ushort date, out ushort time)
{
byte tenths;
DateTimeToFileTime(value, out date, out time, out tenths);
DateTimeToFileTime(value, out date, out time, out byte tenths);
}
private static void DateTimeToFileTime(DateTime value, out ushort date, out ushort time, out byte tenths)
@@ -189,7 +186,7 @@ namespace DiscUtils.Fat
(ushort)((((value.Year - 1980) << 9) & 0xFE00) | ((value.Month << 5) & 0x01E0) | (value.Day & 0x001F));
time =
(ushort)(((value.Hour << 11) & 0xF800) | ((value.Minute << 5) & 0x07E0) | ((value.Second / 2) & 0x001F));
tenths = (byte)(value.Second % 2 * 100 + value.Millisecond / 10);
tenths = (byte)((value.Second % 2 * 100) + (value.Millisecond / 10));
}
private void Load(byte[] data, int offset)