Skip to content

Commit

Permalink
Finish implementing the .NET Single File Application bundle readonly …
Browse files Browse the repository at this point in the history
…support for NanaZip.Codecs.
  • Loading branch information
MouriNaruto committed Feb 1, 2025
1 parent 3791802 commit 50c72cd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 129 deletions.
129 changes: 0 additions & 129 deletions NanaZip.Codecs/NanaZip.Codecs.Archive.DotNetSingleFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,135 +478,6 @@ namespace NanaZip::Codecs::Archive

hr = S_OK;

/*for (size_t i = 0; -1 != g_SuperBlockSearchList[i]; ++i)
{
if (FAILED(this->ReadFileStream(
g_SuperBlockSearchList[i],
&this->m_SuperBlock,
sizeof(this->m_SuperBlock))))
{
break;
}
this->m_IsBigEndian = false;
std::uint32_t Signature = this->ReadUInt32(
&this->m_SuperBlock.fs_magic);
if (FS_UFS2_MAGIC == Signature)
{
this->m_IsUfs2 = true;
}
else if (FS_UFS1_MAGIC == Signature)
{
this->m_IsUfs2 = false;
}
else
{
this->m_IsBigEndian = true;
Signature = this->ReadUInt32(
&this->m_SuperBlock.fs_magic);
if (FS_UFS2_MAGIC == Signature)
{
this->m_IsUfs2 = true;
}
else if (FS_UFS1_MAGIC == Signature)
{
this->m_IsUfs2 = false;
}
else
{
continue;
}
}
std::int64_t SuperBlockLocation = this->ReadInt64(
&this->m_SuperBlock.fs_sblockloc);
if (this->m_IsUfs2)
{
if (SBLOCK_UFS2 != SuperBlockLocation)
{
continue;
}
}
else
{
if (SuperBlockLocation < 0 ||
SuperBlockLocation > SBLOCK_UFS1)
{
continue;
}
}
std::int32_t FragmentsCount = this->ReadInt32(
&this->m_SuperBlock.fs_frag);
if (FragmentsCount < 1)
{
continue;
}
std::uint32_t CylinderGroupsCount = this->ReadUInt32(
&this->m_SuperBlock.fs_ncg);
if (CylinderGroupsCount < 1)
{
continue;
}
std::int32_t BlockSize = this->ReadInt32(
&this->m_SuperBlock.fs_bsize);
if (BlockSize < MINBSIZE)
{
continue;
}
std::int32_t SuperBlockSize = this->ReadInt32(
&this->m_SuperBlock.fs_sbsize);
if (SuperBlockSize > SBLOCKSIZE ||
SuperBlockSize < sizeof(fs))
{
continue;
}
hr = S_OK;
break;
}
if (S_OK != hr)
{
break;
}
std::uint64_t TotalFiles = 0;
std::uint64_t TotalBytes =
this->GetTotalBlocks() * this->GetFragmentBlockSize();
if (OpenCallback)
{
OpenCallback->SetTotal(&TotalFiles, &TotalBytes);
}
this->m_FilePaths.clear();
this->GetAllPaths(UFS_ROOTINO, "");
TotalFiles = this->m_FilePaths.size();
if (OpenCallback)
{
OpenCallback->SetTotal(&TotalFiles, &TotalBytes);
}
for (auto const& Item : this->m_TemporaryFilePaths)
{
UfsFilePathInformation Current;
Current.Path = Item.first;
Current.Inode = Item.second;
if (!this->GetInodeInformation(
Current.Inode,
Current.Information))
{
continue;
}
this->m_FilePaths.emplace_back(Current);
}
this->m_TemporaryFilePaths.clear();*/

} while (false);

if (FAILED(hr))
Expand Down
2 changes: 2 additions & 0 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ Kenji Mouri
7-Zip ZS)
- NSIS (Decoder's NSIS script decompiling support, inherited from 7-Zip NSIS)
- UFS/UFS2 file system image (Archiver, read-only, both big and little endian)
- .NET Single File Application bundle (Archiver, read-only, extracting
compressed files in the bundle are not supported)
- Provide additional security mitigations.
- Enable Control Flow Guard (CFG) to all target binaries for mitigating ROP
attacks.
Expand Down

0 comments on commit 50c72cd

Please sign in to comment.