mirror of
https://github.com/Huntereb/Awoo-Installer
synced 2024-11-22 19:53:07 +00:00
idk why that makes a difference but now it works
This commit is contained in:
parent
f517f179d8
commit
3909194a4a
3 changed files with 7 additions and 14 deletions
|
@ -45,7 +45,6 @@ namespace tin::install::nsp
|
|||
|
||||
virtual void RetrieveHeader();
|
||||
virtual const PFS0BaseHeader* GetBaseHeader();
|
||||
virtual void BufferNCAHeader(void* buf, NcmContentId placeholderId);
|
||||
virtual u64 GetDataOffset();
|
||||
|
||||
virtual const PFS0FileEntry* GetFileEntry(unsigned int index);
|
||||
|
|
|
@ -94,15 +94,16 @@ namespace tin::install::nsp
|
|||
|
||||
if (inst::config::validateNCAs && !declinedValidation)
|
||||
{
|
||||
tin::install::NcaHeader header;
|
||||
m_remoteNSP->BufferNCAHeader(&header, ncaId);
|
||||
Crypto::AesXtr crypto(Crypto::Keys().headerKey);
|
||||
crypto.decrypt(&header, &header, sizeof(header), 0, 0x200);
|
||||
tin::install::NcaHeader* header = new NcaHeader;
|
||||
m_remoteNSP->BufferData(header, m_remoteNSP->GetDataOffset() + fileEntry->dataOffset, sizeof(tin::install::NcaHeader));
|
||||
|
||||
if (header.magic != MAGIC_NCA3)
|
||||
Crypto::AesXtr crypto(Crypto::Keys().headerKey);
|
||||
crypto.decrypt(header, header, sizeof(tin::install::NcaHeader), 0, 0x200);
|
||||
|
||||
if (header->magic != MAGIC_NCA3)
|
||||
THROW_FORMAT("Invalid NCA magic");
|
||||
|
||||
if (!Crypto::rsa2048PssVerify(&header.magic, 0x200, header.fixed_key_sig, Crypto::NCAHeaderSignature))
|
||||
if (!Crypto::rsa2048PssVerify(&header->magic, 0x200, header->fixed_key_sig, Crypto::NCAHeaderSignature))
|
||||
{
|
||||
int rc = inst::ui::mainApp->CreateShowDialog("Invalid NCA signature detected!", "The software you are trying to install may contain malicious contents!\nOnly install improperly signed software from trustworthy sources!\nThis warning can be disabled in Awoo Installer's settings.\n\nAre you sure you want to continue the installation?", {"Cancel", "Yes, I want a brick"}, false);
|
||||
if (rc != 1)
|
||||
|
|
|
@ -134,13 +134,6 @@ namespace tin::install::nsp
|
|||
return reinterpret_cast<PFS0BaseHeader*>(m_headerBytes.data());
|
||||
}
|
||||
|
||||
void RemoteNSP::BufferNCAHeader(void* buf, NcmContentId placeholderId)
|
||||
{
|
||||
const PFS0FileEntry* fileEntry = this->GetFileEntryByNcaId(placeholderId);
|
||||
u64 pfs0Offset = this->GetDataOffset() + fileEntry->dataOffset;
|
||||
this->BufferData(buf, pfs0Offset, 0xc00);
|
||||
}
|
||||
|
||||
u64 RemoteNSP::GetDataOffset()
|
||||
{
|
||||
if (m_headerBytes.empty())
|
||||
|
|
Loading…
Reference in a new issue