main pkg files extracts to sce_sys folder

This commit is contained in:
georgemoralis 2023-03-01 18:24:33 +02:00
parent 44e60f779c
commit 907c32967e
2 changed files with 5 additions and 5 deletions

View File

@ -75,13 +75,13 @@ bool PKG::extract(const std::string& filepath, const std::string& extractPath, s
std::string name = getEntryNameByType(entry.id); std::string name = getEntryNameByType(entry.id);
if (!name.empty()) if (!name.empty())
{ {
QString filepath= QString::fromStdString(extractPath+name); QString filepath= QString::fromStdString(extractPath+ "/sce_sys/" + name);
QDir dir = QFileInfo(filepath).dir(); QDir dir = QFileInfo(filepath).dir();
if (!dir.exists()) { if (!dir.exists()) {
dir.mkpath(dir.path()); dir.mkpath(dir.path());
} }
FsFile out; FsFile out;
out.Open(extractPath + name, fsWrite); out.Open(extractPath + "/sce_sys/" + name, fsWrite);
out.Write(pkg + entry.offset, entry.size); out.Write(pkg + entry.offset, entry.size);
out.Close(); out.Close();
} }
@ -89,7 +89,7 @@ bool PKG::extract(const std::string& filepath, const std::string& extractPath, s
{ {
//just print with id //just print with id
FsFile out; FsFile out;
out.Open(extractPath + std::to_string(entry.id), fsWrite); out.Open(extractPath + "/sce_sys/" + std::to_string(entry.id), fsWrite);
out.Write(pkg + entry.offset, entry.size); out.Write(pkg + entry.offset, entry.size);
out.Close(); out.Close();
} }

View File

@ -150,11 +150,11 @@ void GameListWorker::AddEntriesToGameList(const std::string& dir_path) {
foreach(QFileInfo item, fList) foreach(QFileInfo item, fList)
{ {
PSF psf; PSF psf;
if (!psf.open(item.absoluteFilePath().toStdString() + "/PARAM.SFO")) if (!psf.open(item.absoluteFilePath().toStdString() + "/sce_sys/PARAM.SFO"))
continue;//if we can't open param.sfo go to the next entry continue;//if we can't open param.sfo go to the next entry
//TODO std::string test = psf.get_string("TITLE_ID"); //TODO std::string test = psf.get_string("TITLE_ID");
QString iconpath(item.absoluteFilePath() + "/ICON0.PNG"); QString iconpath(item.absoluteFilePath() + "/sce_sys/ICON0.PNG");
QString t; QString t;
emit EntryReady({ emit EntryReady({