mirror of
https://github.com/wiiu-env/wudd.git
synced 2024-11-25 19:26:58 +01:00
05aea5756b
- Display name/type of the partition - Block home menu when launching via HBL - Use libmocha instead of libiosuhax, which should result in a small performance boost - Improve logging - Improve memory management - Add option to abort dumps - Slightly improve .wux handling
15 lines
806 B
C++
15 lines
806 B
C++
#include "WUDUtils.h"
|
|
#include "FSTUtils.h"
|
|
|
|
std::optional<uint64_t> WUDUtils::getOffsetOfContent(const std::shared_ptr<WiiUGMPartition> &gamePartition, const std::shared_ptr<FST> &fst, const std::shared_ptr<Content> &content) {
|
|
if (content->index == 0) { // Index 0 is the FST which is at the beginning of the partition;
|
|
auto &vh = gamePartition->getVolumes().begin()->second;
|
|
return gamePartition->getSectionOffsetOnDefaultPartition() + vh->FSTAddress.getAddressInBytes();
|
|
}
|
|
auto info = FSTUtils::getSectionEntryForIndex(fst, content->index);
|
|
if (!info.has_value()) {
|
|
DEBUG_FUNCTION_LINE_ERR("Failed to get section for Content");
|
|
return {};
|
|
}
|
|
return gamePartition->getSectionOffsetOnDefaultPartition() + info.value()->address.getAddressInBytes();
|
|
} |