nstool/src/PfsProcess.h

53 lines
1.1 KiB
C
Raw Normal View History

#pragma once
#include <string>
#include <fnd/types.h>
2018-04-24 07:51:29 +00:00
#include <fnd/IFile.h>
#include <fnd/SharedPtr.h>
#include <nn/hac/PartitionFsHeader.h>
#include "common.h"
class PfsProcess
{
public:
PfsProcess();
void process();
// generic
void setInputFile(const fnd::SharedPtr<fnd::IFile>& file);
void setCliOutputMode(CliOutputMode type);
void setVerifyMode(bool verify);
// pfs specific
void setMountPointName(const std::string& mount_name);
void setExtractPath(const std::string& path);
void setListFs(bool list_fs);
const nn::hac::PartitionFsHeader& getPfsHeader() const;
private:
const std::string kModuleName = "PfsProcess";
static const size_t kCacheSize = 0x10000;
fnd::SharedPtr<fnd::IFile> mFile;
CliOutputMode mCliOutputMode;
bool mVerify;
std::string mExtractPath;
bool mExtract;
std::string mMountName;
bool mListFs;
fnd::Vec<byte_t> mCache;
nn::hac::PartitionFsHeader mPfs;
2018-08-13 17:14:21 +00:00
void importHeader();
void displayHeader();
void displayFs();
2018-08-07 07:17:51 +00:00
size_t determineHeaderSize(const nn::hac::sPfsHeader* hdr);
bool validateHeaderMagic(const nn::hac::sPfsHeader* hdr);
void validateHfs();
void extractFs();
};