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
+2 -2
View File
@@ -35,14 +35,14 @@ namespace SevenZip
public void UpdateByte(byte b)
{
_value = Table[((byte)(_value)) ^ b] ^ (_value >> 8);
_value = Table[((byte)_value) ^ b] ^ (_value >> 8);
}
public void Update(byte[] data, uint offset, uint size)
{
for (uint i = 0; i < size; i++)
{
_value = Table[((byte)(_value)) ^ data[offset + i]] ^ (_value >> 8);
_value = Table[((byte)_value) ^ data[offset + i]] ^ (_value >> 8);
}
}
+1 -1
View File
@@ -134,7 +134,7 @@ namespace SevenZip.CommandLineParser
}
else
{
matchedSwitch.WithMinus = (srcString[pos] == kSwitchMinus);
matchedSwitch.WithMinus = srcString[pos] == kSwitchMinus;
if (matchedSwitch.WithMinus)
{
pos++;
+5 -11
View File
@@ -38,7 +38,7 @@ namespace SevenZip.Buffer
int aNumProcessedBytes = m_Stream.Read(m_Buffer, 0, (int)m_BufferSize);
m_Pos = 0;
m_Limit = (uint)aNumProcessedBytes;
m_StreamWasExhausted = (aNumProcessedBytes == 0);
m_StreamWasExhausted = aNumProcessedBytes == 0;
return !m_StreamWasExhausted;
}
@@ -50,12 +50,9 @@ namespace SevenZip.Buffer
public bool ReadByte(byte b) // check it
{
if (m_Pos >= m_Limit)
if (m_Pos >= m_Limit && !ReadBlock())
{
if (!ReadBlock())
{
return false;
}
return false;
}
b = m_Buffer[m_Pos++];
@@ -65,12 +62,9 @@ namespace SevenZip.Buffer
public byte ReadByte()
{
// return (byte)m_Stream.ReadByte();
if (m_Pos >= m_Limit)
if (m_Pos >= m_Limit && !ReadBlock())
{
if (!ReadBlock())
{
return 0xFF;
}
return 0xFF;
}
return m_Buffer[m_Pos++];