mirror of
				https://github.com/wh201906/Proxmark3GUI.git
				synced 2025-11-04 08:13:22 +08:00 
			
		
		
		
	Optimize writeAll()
This commit is contained in:
		
							parent
							
								
									3181848e75
								
							
						
					
					
						commit
						241b0cdc29
					
				@ -323,8 +323,7 @@ void Mifare::writeAll()
 | 
			
		||||
    {
 | 
			
		||||
        for(int j = 0; j < cardType.blk[i]; j++)
 | 
			
		||||
        {
 | 
			
		||||
            result = ""; // if the KeyA is invalid and the result is not empty, the
 | 
			
		||||
            // KeyB will not be tested.
 | 
			
		||||
            result = ""; // if the KeyA is valid and the result is not empty, the KeyB will not be tested.
 | 
			
		||||
            if(data_isDataValid(dataList->at(cardType.blks[i] + j)) != DATA_NOSPACE || dataList->at(cardType.blks[i] + j).contains('?'))
 | 
			
		||||
                continue;
 | 
			
		||||
            if(data_isKeyValid(keyAList->at(i)))
 | 
			
		||||
@ -350,6 +349,15 @@ void Mifare::writeAll()
 | 
			
		||||
                             + dataList->at(cardType.blks[i] + j),
 | 
			
		||||
                             waitTime);
 | 
			
		||||
            }
 | 
			
		||||
            if(result.indexOf("isOk:01") == -1 && keyAList->at(i) != "FFFFFFFFFFFF") // Try default key. It's useful when writing to a blank card
 | 
			
		||||
            {
 | 
			
		||||
                result = util->execCMDWithOutput(
 | 
			
		||||
                             "hf mf wrbl "
 | 
			
		||||
                             + QString::number(cardType.blks[i] + j)
 | 
			
		||||
                             + " A FFFFFFFFFFFF "
 | 
			
		||||
                             + dataList->at(cardType.blks[i] + j),
 | 
			
		||||
                             waitTime);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user