mirror of
				https://github.com/jakcron/nstool.git
				synced 2025-11-04 02:25:00 +00:00 
			
		
		
		
	[nx] Add getNcaPartititionAesCtr()
This commit is contained in:
		
							parent
							
								
									b69dc62062
								
							
						
					
					
						commit
						3291d06082
					
				| 
						 | 
				
			
			@ -9,5 +9,6 @@ namespace nx
 | 
			
		|||
		static inline size_t sectorToOffset(size_t sector_index) { return sector_index * nx::nca::kSectorSize; }
 | 
			
		||||
		static void decryptNcaHeader(const byte_t* src, byte_t* dst, const crypto::aes::sAesXts128Key& key);
 | 
			
		||||
		static byte_t getMasterKeyRevisionFromKeyGeneration(byte_t key_generation);
 | 
			
		||||
		static void getNcaPartitionAesCtr(const nx::sNcaFsHeader* hdr, byte_t* ctr);
 | 
			
		||||
	};
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -47,3 +47,11 @@ byte_t nx::NcaUtils::getMasterKeyRevisionFromKeyGeneration(byte_t key_generation
 | 
			
		|||
 | 
			
		||||
	return masterkey_rev;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void nx::NcaUtils::getNcaPartitionAesCtr(const nx::sNcaFsHeader* hdr, byte_t* ctr)
 | 
			
		||||
{
 | 
			
		||||
	for (size_t i = 0; i < 16; i++)
 | 
			
		||||
	{
 | 
			
		||||
		ctr[15-i] = hdr->base_ctr.iv[i];
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
		Reference in a new issue