diff --git a/.gitmodules b/.gitmodules index 78f1e9d..7ca2b3a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "log-visor"] - path = log-visor - url = https://github.com/AxioDL/log-visor.git +[submodule "logvisor"] + path = logvisor + url = https://github.com/AxioDL/logvisor.git diff --git a/CMakeLists.txt b/CMakeLists.txt index b8e59b2..421f44b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,20 +1,20 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) cmake_minimum_required(VERSION 3.0) -project(NODLib) +project(nod) endif() if(NOT MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") endif() -if (NOT TARGET LogVisor) - add_subdirectory(LogVisor) - set(LOG_VISOR_INCLUDE_DIR LogVisor/include) +if (NOT TARGET logvisor) + add_subdirectory(logvisor) + set(LOGVISOR_INCLUDE_DIR logvisor/include) endif() -include_directories(include ${LOG_VISOR_INCLUDE_DIR}) -file(GLOB NOD_HEADERS include/NOD/*.h*) +include_directories(include ${LOGVISOR_INCLUDE_DIR}) +file(GLOB NOD_HEADERS include/nod/*.h*) add_subdirectory(lib) add_subdirectory(driver) -install(DIRECTORY include/NOD DESTINATION include/NOD) +install(DIRECTORY include/nod DESTINATION include/nod) diff --git a/driver/CMakeLists.txt b/driver/CMakeLists.txt index 0f46f78..fcb1821 100644 --- a/driver/CMakeLists.txt +++ b/driver/CMakeLists.txt @@ -1,7 +1,6 @@ -add_executable(nodtool - main.cpp) +add_executable(nodtool main.cpp) -target_link_libraries(nodtool NOD LogVisor) +target_link_libraries(nodtool nod logvisor) if (NOT WIN32) target_link_libraries(nodtool pthread) endif() diff --git a/driver/main.cpp b/driver/main.cpp index 03f9a0b..3c000c2 100644 --- a/driver/main.cpp +++ b/driver/main.cpp @@ -1,7 +1,7 @@ #include #include -#include -#include "NOD/NOD.hpp" +#include "logvisor/logvisor.hpp" +#include "nod/nod.hpp" static void printHelp() { @@ -33,13 +33,13 @@ int main(int argc, char* argv[]) } /* Enable logging to console */ - LogVisor::RegisterConsoleLogger(); + logvisor::RegisterConsoleLogger(); - NOD::ExtractionContext ctx = { true, true, [&](const std::string& str){ + nod::ExtractionContext ctx = { true, true, [&](const std::string& str){ fprintf(stderr, "%s\n", str.c_str()); }}; - const NOD::SystemChar* inDir = nullptr; - const NOD::SystemChar* outDir = _S("."); + const nod::SystemChar* inDir = nullptr; + const nod::SystemChar* outDir = _S("."); for (int a=2 ; a disc = NOD::OpenDiscFromImage(inDir, isWii); + std::unique_ptr disc = nod::OpenDiscFromImage(inDir, isWii); if (!disc) return 1; - NOD::Mkdir(outDir, 0755); + nod::Mkdir(outDir, 0755); if (isWii) - static_cast(*disc).writeOutDataPartitionHeader( - (NOD::SystemString(outDir) + _S("/partition_head.bin")).c_str()); + static_cast(*disc).writeOutDataPartitionHeader( + (nod::SystemString(outDir) + _S("/partition_head.bin")).c_str()); - NOD::Partition* dataPart = disc->getDataPartition(); + nod::Partition* dataPart = disc->getDataPartition(); if (!dataPart) return 1; @@ -78,27 +78,27 @@ int main(int argc, char* argv[]) { #if NOD_UCS2 if (wcslen(argv[2]) < 6) - NOD::LogModule.report(LogVisor::FatalError, _S("game-id is not at least 6 characters")); + nod::LogModule.report(logvisor::Fatal, _S("game-id is not at least 6 characters")); #else if (strlen(argv[2]) < 6) - NOD::LogModule.report(LogVisor::FatalError, _S("game-id is not at least 6 characters")); + nod::LogModule.report(logvisor::Fatal, _S("game-id is not at least 6 characters")); #endif /* Pre-validate paths */ - NOD::Sstat theStat; - if (NOD::Stat(argv[4], &theStat) || !S_ISDIR(theStat.st_mode)) - NOD::LogModule.report(LogVisor::FatalError, _S("unable to stat %s as directory"), argv[4]); - if (NOD::Stat(argv[5], &theStat) || !S_ISREG(theStat.st_mode)) - NOD::LogModule.report(LogVisor::FatalError, _S("unable to stat %s as file"), argv[5]); - if (NOD::Stat(argv[6], &theStat) || !S_ISREG(theStat.st_mode)) - NOD::LogModule.report(LogVisor::FatalError, "unable to stat %s as file", argv[6]); + nod::Sstat theStat; + if (nod::Stat(argv[4], &theStat) || !S_ISDIR(theStat.st_mode)) + nod::LogModule.report(logvisor::Fatal, _S("unable to stat %s as directory"), argv[4]); + if (nod::Stat(argv[5], &theStat) || !S_ISREG(theStat.st_mode)) + nod::LogModule.report(logvisor::Fatal, _S("unable to stat %s as file"), argv[5]); + if (nod::Stat(argv[6], &theStat) || !S_ISREG(theStat.st_mode)) + nod::LogModule.report(logvisor::Fatal, "unable to stat %s as file", argv[6]); - NOD::SystemString gameIdSys(argv[2]); - NOD::SystemUTF8View gameId(gameIdSys); - NOD::SystemString gameTitleSys(argv[3]); - NOD::SystemUTF8View gameTitle(gameTitleSys); + nod::SystemString gameIdSys(argv[2]); + nod::SystemUTF8View gameId(gameIdSys); + nod::SystemString gameTitleSys(argv[3]); + nod::SystemUTF8View gameTitle(gameTitleSys); size_t lastIdx = -1; - auto progFunc = [&](size_t idx, const NOD::SystemString& name, size_t bytes) + auto progFunc = [&](size_t idx, const nod::SystemString& name, size_t bytes) { if (idx != lastIdx) { @@ -106,9 +106,9 @@ int main(int argc, char* argv[]) printf("\n"); } if (bytes != -1) - NOD::Printf(_S("\r%s %" PRISize " B"), name.c_str(), bytes); + nod::Printf(_S("\r%s %" PRISize " B"), name.c_str(), bytes); else - NOD::Printf(_S("\r%s"), name.c_str()); + nod::Printf(_S("\r%s"), name.c_str()); fflush(stdout); }; @@ -116,14 +116,14 @@ int main(int argc, char* argv[]) if (argc < 8) { - NOD::SystemString outPath(argv[4]); + nod::SystemString outPath(argv[4]); outPath.append(_S(".iso")); - NOD::DiscBuilderGCN b(outPath.c_str(), gameId.utf8_str().c_str(), gameTitle.utf8_str().c_str(), 0x0003EB60, progFunc); + nod::DiscBuilderGCN b(outPath.c_str(), gameId.utf8_str().c_str(), gameTitle.utf8_str().c_str(), 0x0003EB60, progFunc); ret = b.buildFromDirectory(argv[4], argv[5], argv[6]); } else { - NOD::DiscBuilderGCN b(argv[7], gameId.utf8_str().c_str(), gameTitle.utf8_str().c_str(), 0x0003EB60, progFunc); + nod::DiscBuilderGCN b(argv[7], gameId.utf8_str().c_str(), gameTitle.utf8_str().c_str(), 0x0003EB60, progFunc); ret = b.buildFromDirectory(argv[4], argv[5], argv[6]); } @@ -135,29 +135,29 @@ int main(int argc, char* argv[]) { #if NOD_UCS2 if (wcslen(argv[2]) < 6) - NOD::LogModule.report(LogVisor::FatalError, _S("game-id is not at least 6 characters")); + nod::LogModule.report(logvisor::Fatal, _S("game-id is not at least 6 characters")); #else if (strlen(argv[2]) < 6) - NOD::LogModule.report(LogVisor::FatalError, _S("game-id is not at least 6 characters")); + nod::LogModule.report(logvisor::Fatal, _S("game-id is not at least 6 characters")); #endif /* Pre-validate paths */ - NOD::Sstat theStat; - if (NOD::Stat(argv[4], &theStat) || !S_ISDIR(theStat.st_mode)) - NOD::LogModule.report(LogVisor::FatalError, _S("unable to stat %s as directory"), argv[4]); - if (NOD::Stat(argv[5], &theStat) || !S_ISREG(theStat.st_mode)) - NOD::LogModule.report(LogVisor::FatalError, _S("unable to stat %s as file"), argv[5]); - if (NOD::Stat(argv[6], &theStat) || !S_ISREG(theStat.st_mode)) - NOD::LogModule.report(LogVisor::FatalError, _S("unable to stat %s as file"), argv[6]); - if (NOD::Stat(argv[7], &theStat) || !S_ISREG(theStat.st_mode)) - NOD::LogModule.report(LogVisor::FatalError, _S("unable to stat %s as file"), argv[7]); + nod::Sstat theStat; + if (nod::Stat(argv[4], &theStat) || !S_ISDIR(theStat.st_mode)) + nod::LogModule.report(logvisor::Fatal, _S("unable to stat %s as directory"), argv[4]); + if (nod::Stat(argv[5], &theStat) || !S_ISREG(theStat.st_mode)) + nod::LogModule.report(logvisor::Fatal, _S("unable to stat %s as file"), argv[5]); + if (nod::Stat(argv[6], &theStat) || !S_ISREG(theStat.st_mode)) + nod::LogModule.report(logvisor::Fatal, _S("unable to stat %s as file"), argv[6]); + if (nod::Stat(argv[7], &theStat) || !S_ISREG(theStat.st_mode)) + nod::LogModule.report(logvisor::Fatal, _S("unable to stat %s as file"), argv[7]); - NOD::SystemString gameIdSys(argv[2]); - NOD::SystemUTF8View gameId(gameIdSys); - NOD::SystemString gameTitleSys(argv[3]); - NOD::SystemUTF8View gameTitle(gameTitleSys); + nod::SystemString gameIdSys(argv[2]); + nod::SystemUTF8View gameId(gameIdSys); + nod::SystemString gameTitleSys(argv[3]); + nod::SystemUTF8View gameTitle(gameTitleSys); size_t lastIdx = -1; - auto progFunc = [&](size_t idx, const NOD::SystemString& name, size_t bytes) + auto progFunc = [&](size_t idx, const nod::SystemString& name, size_t bytes) { if (idx != lastIdx) { @@ -165,9 +165,9 @@ int main(int argc, char* argv[]) printf("\n"); } if (bytes != -1) - NOD::Printf(_S("\r%s %" PRISize " B"), name.c_str(), bytes); + nod::Printf(_S("\r%s %" PRISize " B"), name.c_str(), bytes); else - NOD::Printf(_S("\r%s"), name.c_str()); + nod::Printf(_S("\r%s"), name.c_str()); fflush(stdout); }; @@ -176,14 +176,14 @@ int main(int argc, char* argv[]) if (argc < 9) { - NOD::SystemString outPath(argv[4]); + nod::SystemString outPath(argv[4]); outPath.append(_S(".iso")); - NOD::DiscBuilderWii b(outPath.c_str(), gameId.utf8_str().c_str(), gameTitle.utf8_str().c_str(), dual, progFunc); + nod::DiscBuilderWii b(outPath.c_str(), gameId.utf8_str().c_str(), gameTitle.utf8_str().c_str(), dual, progFunc); ret = b.buildFromDirectory(argv[4], argv[5], argv[6], argv[7]); } else { - NOD::DiscBuilderWii b(argv[8], gameId.utf8_str().c_str(), gameTitle.utf8_str().c_str(), dual, progFunc); + nod::DiscBuilderWii b(argv[8], gameId.utf8_str().c_str(), gameTitle.utf8_str().c_str(), dual, progFunc); ret = b.buildFromDirectory(argv[4], argv[5], argv[6], argv[7]); } diff --git a/include/NOD/DirectoryEnumerator.hpp b/include/nod/DirectoryEnumerator.hpp similarity index 99% rename from include/NOD/DirectoryEnumerator.hpp rename to include/nod/DirectoryEnumerator.hpp index 1a02cb0..93e4638 100644 --- a/include/NOD/DirectoryEnumerator.hpp +++ b/include/nod/DirectoryEnumerator.hpp @@ -3,7 +3,7 @@ #include "Util.hpp" -namespace NOD +namespace nod { struct CaseInsensitiveCompare diff --git a/include/NOD/DiscBase.hpp b/include/nod/DiscBase.hpp similarity index 98% rename from include/NOD/DiscBase.hpp rename to include/nod/DiscBase.hpp index 43e1537..9efc704 100644 --- a/include/NOD/DiscBase.hpp +++ b/include/nod/DiscBase.hpp @@ -12,7 +12,7 @@ #include "IDiscIO.hpp" #include "IFileIO.hpp" -namespace NOD +namespace nod { class FSTNode @@ -150,7 +150,7 @@ public: { if (m_kind != Kind::File) { - LogModule.report(LogVisor::Error, "unable to stream a non-file %s", m_name.c_str()); + LogModule.report(logvisor::Error, "unable to stream a non-file %s", m_name.c_str()); return std::unique_ptr(); } return m_parent.beginReadStream(m_discOffset + offset); @@ -159,7 +159,7 @@ public: { if (m_kind != Kind::File) { - LogModule.report(LogVisor::Error, "unable to buffer a non-file %s", m_name.c_str()); + LogModule.report(logvisor::Error, "unable to buffer a non-file %s", m_name.c_str()); return std::unique_ptr(); } uint8_t* buf = new uint8_t[m_discLength]; diff --git a/include/NOD/DiscGCN.hpp b/include/nod/DiscGCN.hpp similarity index 97% rename from include/NOD/DiscGCN.hpp rename to include/nod/DiscGCN.hpp index 565c13c..6d21fbd 100644 --- a/include/NOD/DiscGCN.hpp +++ b/include/nod/DiscGCN.hpp @@ -3,7 +3,7 @@ #include "DiscBase.hpp" -namespace NOD +namespace nod { class DiscGCN : public DiscBase diff --git a/include/NOD/DiscWii.hpp b/include/nod/DiscWii.hpp similarity index 98% rename from include/NOD/DiscWii.hpp rename to include/nod/DiscWii.hpp index d5d26a8..720084e 100644 --- a/include/NOD/DiscWii.hpp +++ b/include/nod/DiscWii.hpp @@ -3,7 +3,7 @@ #include "DiscBase.hpp" -namespace NOD +namespace nod { class DiscWii : public DiscBase diff --git a/include/NOD/IDiscIO.hpp b/include/nod/IDiscIO.hpp similarity index 85% rename from include/NOD/IDiscIO.hpp rename to include/nod/IDiscIO.hpp index d82ff1f..7858a6c 100644 --- a/include/NOD/IDiscIO.hpp +++ b/include/nod/IDiscIO.hpp @@ -7,11 +7,11 @@ #include #if NOD_ATHENA -#include -#include +#include +#include #endif -namespace NOD +namespace nod { class IDiscIO @@ -54,17 +54,17 @@ struct IPartWriteStream #if NOD_ATHENA -class AthenaPartReadStream : public Athena::io::IStreamReader +class AthenaPartReadStream : public athena::io::IStreamReader { std::unique_ptr m_rs; public: AthenaPartReadStream(std::unique_ptr&& rs) : m_rs(std::move(rs)) {} - inline void seek(atInt64 off, Athena::SeekOrigin origin) + inline void seek(atInt64 off, athena::SeekOrigin origin) { - if (origin == Athena::Begin) + if (origin == athena::Begin) m_rs->seek(off, SEEK_SET); - else if (origin == Athena::Current) + else if (origin == athena::Current) m_rs->seek(off, SEEK_CUR); } inline atUint64 position() const {return m_rs->position();} diff --git a/include/NOD/IFileIO.hpp b/include/nod/IFileIO.hpp similarity index 98% rename from include/NOD/IFileIO.hpp rename to include/nod/IFileIO.hpp index 21ebd71..009c1c9 100644 --- a/include/NOD/IFileIO.hpp +++ b/include/nod/IFileIO.hpp @@ -6,7 +6,7 @@ #include "IDiscIO.hpp" #include "Util.hpp" -namespace NOD +namespace nod { class IFileIO diff --git a/include/NOD/Util.hpp b/include/nod/Util.hpp similarity index 95% rename from include/NOD/Util.hpp rename to include/nod/Util.hpp index 24c459f..cad10f0 100644 --- a/include/NOD/Util.hpp +++ b/include/nod/Util.hpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include "logvisor/logvisor.hpp" #ifdef _MSC_VER #pragma warning(disable : 4996) @@ -47,7 +47,7 @@ #undef min #undef max -namespace NOD +namespace nod { /* define our own min/max to avoid MSVC BS */ template @@ -56,7 +56,7 @@ template inline T max(T a, T b) { return a > b ? a : b; } /* Log Module */ -extern LogVisor::LogModule LogModule; +extern logvisor::Module LogModule; /* filesystem char type */ #if _WIN32 && UNICODE @@ -272,7 +272,7 @@ static inline FILE* Fopen(const SystemChar* path, const SystemChar* mode, FileLo LockFileEx((HANDLE)(uintptr_t)_fileno(fp), (lock == FileLockType::Write) ? LOCKFILE_EXCLUSIVE_LOCK : 0, 0, 0, 1, &ov); #else if (flock(fileno(fp), ((lock == FileLockType::Write) ? LOCK_EX : LOCK_SH) | LOCK_NB)) - LogModule.report(LogVisor::Error, "flock %s: %s", path, strerror(errno)); + LogModule.report(logvisor::Error, "flock %s: %s", path, strerror(errno)); #endif } @@ -309,16 +309,16 @@ static inline bool CheckFreeSpace(const SystemChar* path, size_t reqSz) wchar_t* end; DWORD ret = GetFullPathNameW(path, 1024, buf, &end); if (!ret || ret > 1024) - LogModule.report(LogVisor::FatalError, _S("GetFullPathNameW %s"), path); + LogModule.report(logvisor::Fatal, _S("GetFullPathNameW %s"), path); if (end) end[0] = L'\0'; if (!GetDiskFreeSpaceExW(buf, &freeBytes, nullptr, nullptr)) - LogModule.report(LogVisor::FatalError, _S("GetDiskFreeSpaceExW %s: %d"), path, GetLastError()); + LogModule.report(logvisor::Fatal, _S("GetDiskFreeSpaceExW %s: %d"), path, GetLastError()); return reqSz < freeBytes.QuadPart; #else struct statvfs svfs; if (statvfs(path, &svfs)) - LogModule.report(LogVisor::FatalError, "statvfs %s: %s", path, strerror(errno)); + LogModule.report(logvisor::Fatal, "statvfs %s: %s", path, strerror(errno)); return reqSz < svfs.f_frsize * svfs.f_bavail; #endif } diff --git a/include/NOD/aes.hpp b/include/nod/aes.hpp similarity index 96% rename from include/NOD/aes.hpp rename to include/nod/aes.hpp index a22556a..72af741 100644 --- a/include/NOD/aes.hpp +++ b/include/nod/aes.hpp @@ -5,7 +5,7 @@ #include #include -namespace NOD +namespace nod { class IAES diff --git a/include/NOD/NOD.hpp b/include/nod/nod.hpp similarity index 91% rename from include/NOD/NOD.hpp rename to include/nod/nod.hpp index d878785..f2afb2b 100644 --- a/include/NOD/NOD.hpp +++ b/include/nod/nod.hpp @@ -3,10 +3,10 @@ #include #include -#include +#include "logvisor/logvisor.hpp" #include "Util.hpp" -namespace NOD +namespace nod { class DiscBase; diff --git a/include/NOD/sha1.h b/include/nod/sha1.h similarity index 100% rename from include/NOD/sha1.h rename to include/nod/sha1.h diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 5f21860..80e5382 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -4,7 +4,7 @@ set(PLAT_SRCS FileIOFILE.cpp) else() set(PLAT_SRCS FileIOWin32.cpp) endif() -add_library(NOD +add_library(nod aes.cpp sha1.c DiscBase.cpp @@ -13,9 +13,9 @@ add_library(NOD DiscIOWBFS.cpp DiscWii.cpp DirectoryEnumerator.cpp - NOD.cpp + nod.cpp ${PLAT_SRCS} ${NOD_HEADERS}) -if(NOT WIN32) +if(NOT MSVC) set_source_files_properties(aes.cpp PROPERTIES COMPILE_FLAGS -maes) endif() diff --git a/lib/DirectoryEnumerator.cpp b/lib/DirectoryEnumerator.cpp index 7ad4aaa..48e37d1 100644 --- a/lib/DirectoryEnumerator.cpp +++ b/lib/DirectoryEnumerator.cpp @@ -7,9 +7,9 @@ #include -#include "NOD/DirectoryEnumerator.hpp" +#include "nod/DirectoryEnumerator.hpp" -namespace NOD +namespace nod { DirectoryEnumerator::DirectoryEnumerator(const SystemChar* path, Mode mode, diff --git a/lib/DiscBase.cpp b/lib/DiscBase.cpp index eb31c8d..0844f3b 100644 --- a/lib/DiscBase.cpp +++ b/lib/DiscBase.cpp @@ -1,7 +1,7 @@ -#include "NOD/DiscBase.hpp" -#include "NOD/IFileIO.hpp" -#include "NOD/DirectoryEnumerator.hpp" -#include "NOD/NOD.hpp" +#include "nod/DiscBase.hpp" +#include "nod/IFileIO.hpp" +#include "nod/DirectoryEnumerator.hpp" +#include "nod/nod.hpp" #include #include @@ -35,7 +35,7 @@ static void* memmem(const void *haystack, size_t hlen, const void *needle, size_ #include -namespace NOD +namespace nod { void DiscBase::IPartition::parseFST(IPartReadStream& s) @@ -101,7 +101,7 @@ bool DiscBase::IPartition::Node::extractToDirectory(const SystemString& basePath ctx.progressCB(getName()); if (Mkdir(path.c_str(), 0755) && errno != EEXIST) { - LogModule.report(LogVisor::Error, _S("unable to mkdir '%s'"), path.c_str()); + LogModule.report(logvisor::Error, _S("unable to mkdir '%s'"), path.c_str()); return false; } for (Node& subnode : *this) @@ -130,7 +130,7 @@ bool DiscBase::IPartition::extractToDirectory(const SystemString& path, Sstat theStat; if (Mkdir(path.c_str(), 0755) && errno != EEXIST) { - LogModule.report(LogVisor::Error, _S("unable to mkdir '%s'"), path.c_str()); + LogModule.report(logvisor::Error, _S("unable to mkdir '%s'"), path.c_str()); return false; } @@ -158,7 +158,7 @@ bool DiscBase::IPartition::extractToDirectory(const SystemString& path, SystemString fsPath = path + _S("/fsroot"); if (Mkdir(fsPath.c_str(), 0755) && errno != EEXIST) { - LogModule.report(LogVisor::Error, _S("unable to mkdir '%s'"), fsPath.c_str()); + LogModule.report(logvisor::Error, _S("unable to mkdir '%s'"), fsPath.c_str()); return false; } @@ -177,17 +177,17 @@ static uint64_t GetInode(const SystemChar* path) FILE_ATTRIBUTE_NORMAL, nullptr); if (!fp) - LogModule.report(LogVisor::FatalError, _S("unable to open %s"), path); + LogModule.report(logvisor::Fatal, _S("unable to open %s"), path); BY_HANDLE_FILE_INFORMATION info; if (!GetFileInformationByHandle(fp, &info)) - LogModule.report(LogVisor::FatalError, _S("unable to GetFileInformationByHandle %s"), path); + LogModule.report(logvisor::Fatal, _S("unable to GetFileInformationByHandle %s"), path); inode = uint64_t(info.nFileIndexHigh) << 32; inode |= uint64_t(info.nFileIndexLow); CloseHandle(fp); #else struct stat st; if (stat(path, &st)) - LogModule.report(LogVisor::FatalError, _S("unable to stat %s"), path); + LogModule.report(logvisor::Fatal, _S("unable to stat %s"), path); inode = uint64_t(st.st_ino); #endif return inode; @@ -277,7 +277,7 @@ void DiscBuilderBase::PartitionBuilderBase::recursiveBuildNodes(IPartWriteStream ++m_parent.m_progressIdx; while (xferSz < e.m_fileSz) { - size_t rdSz = rs->read(buf, NOD::min(size_t(0x8000ul), e.m_fileSz - xferSz)); + size_t rdSz = rs->read(buf, nod::min(size_t(0x8000ul), e.m_fileSz - xferSz)); if (!rdSz) break; ws.write(buf, rdSz); @@ -329,7 +329,7 @@ bool DiscBuilderBase::PartitionBuilderBase::buildFromDirectory(IPartWriteStream& const SystemChar* apploaderIn) { if (!dirIn || !dolIn || !apploaderIn) - LogModule.report(LogVisor::FatalError, _S("all arguments must be supplied to buildFromDirectory()")); + LogModule.report(logvisor::Fatal, _S("all arguments must be supplied to buildFromDirectory()")); /* Clear file */ ++m_parent.m_progressIdx; @@ -343,7 +343,7 @@ bool DiscBuilderBase::PartitionBuilderBase::buildFromDirectory(IPartWriteStream& { Sstat dolStat; if (Stat(dolIn, &dolStat)) - LogModule.report(LogVisor::FatalError, _S("unable to stat %s"), dolIn); + LogModule.report(logvisor::Fatal, _S("unable to stat %s"), dolIn); size_t fileSz = ROUND_UP_32(dolStat.st_size); uint64_t fileOff = userAllocate(fileSz, ws); m_dolOffset = fileOff; diff --git a/lib/DiscGCN.cpp b/lib/DiscGCN.cpp index 7e62779..671becc 100644 --- a/lib/DiscGCN.cpp +++ b/lib/DiscGCN.cpp @@ -1,7 +1,7 @@ -#include "NOD/DiscGCN.hpp" +#include "nod/DiscGCN.hpp" #define BUFFER_SZ 0x8000 -namespace NOD +namespace nod { class PartitionGCN : public DiscBase::IPartition @@ -152,7 +152,7 @@ public: m_curUser &= 0xfffffffffffffff0; if (m_curUser < 0x30000) { - LogModule.report(LogVisor::FatalError, "user area low mark reached"); + LogModule.report(logvisor::Fatal, "user area low mark reached"); return -1; } static_cast(ws).seek(m_curUser); @@ -194,7 +194,7 @@ public: ws->write(buf, rdSz); xferSz += rdSz; if (0x2440 + xferSz >= m_curUser) - LogModule.report(LogVisor::FatalError, + LogModule.report(logvisor::Fatal, "apploader flows into user area (one or the other is too big)"); m_parent.m_progressCB(m_parent.m_progressIdx, apploaderName, xferSz); } @@ -211,7 +211,7 @@ public: fstSz = ROUND_UP_32(fstSz); if (fstOff + fstSz >= m_curUser) - LogModule.report(LogVisor::FatalError, + LogModule.report(logvisor::Fatal, "FST flows into user area (one or the other is too big)"); ws = beginWriteStream(0x420); @@ -236,7 +236,7 @@ bool DiscBuilderGCN::buildFromDirectory(const SystemChar* dirIn, const SystemCha if (!CheckFreeSpace(m_outPath, 0x57058000)) { - LogModule.report(LogVisor::Error, _S("not enough free disk space for %s"), m_outPath); + LogModule.report(logvisor::Error, _S("not enough free disk space for %s"), m_outPath); return false; } ++m_progressIdx; diff --git a/lib/DiscIOISO.cpp b/lib/DiscIOISO.cpp index c4e8a33..c887c7f 100644 --- a/lib/DiscIOISO.cpp +++ b/lib/DiscIOISO.cpp @@ -1,9 +1,9 @@ #include -#include "NOD/Util.hpp" -#include "NOD/IDiscIO.hpp" -#include "NOD/IFileIO.hpp" +#include "nod/Util.hpp" +#include "nod/IDiscIO.hpp" +#include "nod/IFileIO.hpp" -namespace NOD +namespace nod { class DiscIOISO : public IDiscIO diff --git a/lib/DiscIOWBFS.cpp b/lib/DiscIOWBFS.cpp index 2088386..6aefa4a 100644 --- a/lib/DiscIOWBFS.cpp +++ b/lib/DiscIOWBFS.cpp @@ -1,10 +1,10 @@ #include #include -#include "NOD/Util.hpp" -#include "NOD/IDiscIO.hpp" -#include "NOD/IFileIO.hpp" +#include "nod/Util.hpp" +#include "nod/IDiscIO.hpp" +#include "nod/IFileIO.hpp" -namespace NOD +namespace nod { #define ALIGN_LBA(x) (((x)+p->hd_sec_sz-1)&(~(p->hd_sec_sz-1))) @@ -80,7 +80,7 @@ class DiscIOWBFS : public IDiscIO rs.seek(off, SEEK_SET); if (rs.read(buf, count*512ULL) != count*512ULL) { - LogModule.report(LogVisor::FatalError, "error reading disc"); + LogModule.report(logvisor::Fatal, "error reading disc"); return 1; } return 0; @@ -97,7 +97,7 @@ public: WBFS* p = &wbfs; WBFSHead tmpHead; if (rs->read(&tmpHead, sizeof(tmpHead)) != sizeof(tmpHead)) - LogModule.report(LogVisor::FatalError, "unable to read WBFS head"); + LogModule.report(logvisor::Fatal, "unable to read WBFS head"); unsigned hd_sector_size = 1 << tmpHead.hd_sec_sz_s; unsigned num_hd_sector = SBig(tmpHead.n_hd_sec); @@ -105,7 +105,7 @@ public: WBFSHead* head = (WBFSHead*)wbfsHead.get(); rs->seek(0, SEEK_SET); if (rs->read(head, hd_sector_size) != hd_sector_size) - LogModule.report(LogVisor::FatalError, "unable to read WBFS head"); + LogModule.report(logvisor::Fatal, "unable to read WBFS head"); //constants, but put here for consistancy p->wii_sec_sz = 0x8000; @@ -115,10 +115,10 @@ public: p->part_lba = 0; _wbfsReadSector(*rs, p->part_lba, 1, head); if (hd_sector_size && head->hd_sec_sz_s != size_to_shift(hd_sector_size)) { - LogModule.report(LogVisor::FatalError, "hd sector size doesn't match"); + LogModule.report(logvisor::Fatal, "hd sector size doesn't match"); } if (num_hd_sector && head->n_hd_sec != SBig(num_hd_sector)) { - LogModule.report(LogVisor::FatalError, "hd num sector doesn't match"); + LogModule.report(logvisor::Fatal, "hd num sector doesn't match"); } p->hd_sec_sz = 1<hd_sec_sz_s; p->hd_sec_sz_s = head->hd_sec_sz_s; @@ -146,7 +146,7 @@ public: { wbfsDiscInfo.reset(new uint8_t[p->disc_info_sz]); if (!wbfsDiscInfo) - LogModule.report(LogVisor::FatalError, "allocating memory"); + LogModule.report(logvisor::Fatal, "allocating memory"); _wbfsReadSector(*rs, p->part_lba+1, disc_info_sz_lba, wbfsDiscInfo.get()); p->n_disc_open++; //for(i=0;in_wbfs_sec_per_disc;i++) diff --git a/lib/DiscWii.cpp b/lib/DiscWii.cpp index 6de2490..b5ee0f4 100644 --- a/lib/DiscWii.cpp +++ b/lib/DiscWii.cpp @@ -1,10 +1,10 @@ #include #include -#include "NOD/DiscWii.hpp" -#include "NOD/aes.hpp" -#include "NOD/sha1.h" +#include "nod/DiscWii.hpp" +#include "nod/aes.hpp" +#include "nod/sha1.h" -namespace NOD +namespace nod { static const uint8_t COMMON_KEYS[2][16] = @@ -348,7 +348,7 @@ public: std::unique_ptr rs = m_parent.getDiscIO().beginReadStream(m_offset + 0x2B4); uint32_t h3; if (rs->read(&h3, 4) != 4) - LogModule.report(LogVisor::FatalError, _S("unable to read H3 offset from %s"), pathOut); + LogModule.report(logvisor::Fatal, _S("unable to read H3 offset from %s"), pathOut); h3 = SBig(h3); h3Off = uint64_t(h3) << 2; } @@ -358,7 +358,7 @@ public: std::unique_ptr rs = m_parent.getDiscIO().beginReadStream(m_offset); while (rem) { - size_t rdSz = NOD::min(rem, size_t(8192ul)); + size_t rdSz = nod::min(rem, size_t(8192ul)); rs->read(buf, rdSz); ws->write(buf, rdSz); rem -= rdSz; @@ -410,7 +410,7 @@ DiscWii::DiscWii(std::unique_ptr&& dio) kind = part.partType; break; default: - LogModule.report(LogVisor::FatalError, "invalid partition type %d", part.partType); + LogModule.report(logvisor::Fatal, "invalid partition type %d", part.partType); } m_partitions.emplace_back(new PartitionWii(*this, kind, part.partDataOff << 2)); } @@ -512,7 +512,7 @@ public: } if (m_fio->write(m_buf, 0x200000) != 0x200000) - LogModule.report(LogVisor::FatalError, "unable to write full disc group"); + LogModule.report(logvisor::Fatal, "unable to write full disc group"); } public: @@ -520,7 +520,7 @@ public: : m_parent(parent), m_baseOffset(baseOffset), m_offset(offset) { if (offset % 0x1F0000) - LogModule.report(LogVisor::FatalError, "partition write stream MUST begin on 0x1F0000-aligned boundary"); + LogModule.report(logvisor::Fatal, "partition write stream MUST begin on 0x1F0000-aligned boundary"); size_t group = m_offset / 0x1F0000; m_fio = m_parent.m_parent.getFileIO().beginWriteStream(m_baseOffset + group * 0x200000); m_curGroup = group; @@ -597,14 +597,14 @@ public: reqSz = ROUND_UP_32(reqSz); if (m_curUser + reqSz >= 0x1FB450000) { - LogModule.report(LogVisor::FatalError, "partition exceeds maximum single-partition capacity"); + LogModule.report(logvisor::Fatal, "partition exceeds maximum single-partition capacity"); return -1; } uint64_t ret = m_curUser; PartWriteStream& cws = static_cast(ws); if (cws.m_offset > ret) { - LogModule.report(LogVisor::FatalError, "partition overwrite error"); + LogModule.report(logvisor::Fatal, "partition overwrite error"); return -1; } while (cws.m_offset < ret) @@ -634,27 +634,27 @@ public: uint8_t tkey[16]; { if (ph->beginReadStream(0x1BF)->read(tkey, 16) != 16) - LogModule.report(LogVisor::FatalError, _S("unable to read title key from %s"), partHeadIn); + LogModule.report(logvisor::Fatal, _S("unable to read title key from %s"), partHeadIn); } uint8_t tkeyiv[16] = {}; { if (ph->beginReadStream(0x1DC)->read(tkeyiv, 8) != 8) - LogModule.report(LogVisor::FatalError, _S("unable to read title key IV from %s"), partHeadIn); + LogModule.report(logvisor::Fatal, _S("unable to read title key IV from %s"), partHeadIn); } uint8_t ccIdx; { if (ph->beginReadStream(0x1F1)->read(&ccIdx, 1) != 1) - LogModule.report(LogVisor::FatalError, _S("unable to read common key index from %s"), partHeadIn); + LogModule.report(logvisor::Fatal, _S("unable to read common key index from %s"), partHeadIn); if (ccIdx > 1) - LogModule.report(LogVisor::FatalError, _S("common key index may only be 0 or 1")); + LogModule.report(logvisor::Fatal, _S("common key index may only be 0 or 1")); } uint32_t tmdSz; { if (ph->beginReadStream(0x2A4)->read(&tmdSz, 4) != 4) - LogModule.report(LogVisor::FatalError, _S("unable to read TMD size from %s"), partHeadIn); + LogModule.report(logvisor::Fatal, _S("unable to read TMD size from %s"), partHeadIn); tmdSz = SBig(tmdSz); } @@ -662,7 +662,7 @@ public: { uint32_t h3Ptr; if (ph->beginReadStream(0x2B4)->read(&h3Ptr, 4) != 4) - LogModule.report(LogVisor::FatalError, _S("unable to read H3 pointer from %s"), partHeadIn); + LogModule.report(logvisor::Fatal, _S("unable to read H3 pointer from %s"), partHeadIn); h3Off = uint64_t(SBig(h3Ptr)) << 2; } @@ -670,14 +670,14 @@ public: { uint32_t dataPtr; if (ph->beginReadStream(0x2B8)->read(&dataPtr, 4) != 4) - LogModule.report(LogVisor::FatalError, _S("unable to read data pointer from %s"), partHeadIn); + LogModule.report(logvisor::Fatal, _S("unable to read data pointer from %s"), partHeadIn); dataOff = uint64_t(SBig(dataPtr)) << 2; } m_userOffset = dataOff; std::unique_ptr tmdData(new uint8_t[tmdSz]); if (ph->beginReadStream(0x2C0)->read(tmdData.get(), tmdSz) != tmdSz) - LogModule.report(LogVisor::FatalError, _S("unable to read TMD from %s"), partHeadIn); + LogModule.report(logvisor::Fatal, _S("unable to read TMD from %s"), partHeadIn); /* Copy partition head up to H3 table */ std::unique_ptr ws = m_parent.getFileIO().beginWriteStream(m_baseOffset); @@ -732,7 +732,7 @@ public: /* Get Apploader Size */ Sstat theStat; if (Stat(apploaderIn, &theStat)) - LogModule.report(LogVisor::FatalError, _S("unable to stat %s"), apploaderIn); + LogModule.report(logvisor::Fatal, _S("unable to stat %s"), apploaderIn); /* Compute boot table members and write */ size_t fstOff = 0x2440 + ROUND_UP_32(theStat.st_size); @@ -741,7 +741,7 @@ public: fstSz = ROUND_UP_32(fstSz); if (fstOff + fstSz >= 0x1F0000) - LogModule.report(LogVisor::FatalError, + LogModule.report(logvisor::Fatal, "FST flows into user area (one or the other is too big)"); cws->write(nullptr, 0x420 - sizeof(Header)); @@ -767,14 +767,14 @@ public: cws->write(buf, rdSz); xferSz += rdSz; if (0x2440 + xferSz >= 0x1F0000) - LogModule.report(LogVisor::FatalError, + LogModule.report(logvisor::Fatal, "apploader flows into user area (one or the other is too big)"); m_parent.m_progressCB(m_parent.m_progressIdx, apploaderName, xferSz); } size_t fstOffRel = fstOff - 0x2440; if (xferSz > fstOffRel) - LogModule.report(LogVisor::FatalError, "apploader unexpectedly flows into FST"); + LogModule.report(logvisor::Fatal, "apploader unexpectedly flows into FST"); for (size_t i=0 ; iwrite("\xff", 1); @@ -856,7 +856,7 @@ bool DiscBuilderWii::buildFromDirectory(const SystemChar* dirIn, const SystemCha if (!CheckFreeSpace(m_outPath, m_discCapacity)) { - LogModule.report(LogVisor::Error, _S("not enough free disk space for %s"), m_outPath); + LogModule.report(logvisor::Error, _S("not enough free disk space for %s"), m_outPath); return false; } ++m_progressIdx; @@ -867,7 +867,7 @@ bool DiscBuilderWii::buildFromDirectory(const SystemChar* dirIn, const SystemCha filledSz = pb.buildFromDirectory(dirIn, dolIn, apploaderIn, partHeadIn); if (filledSz >= m_discCapacity) { - LogModule.report(LogVisor::FatalError, "data partition exceeds disc capacity"); + LogModule.report(logvisor::Fatal, "data partition exceeds disc capacity"); return false; } diff --git a/lib/FileIOFILE.cpp b/lib/FileIOFILE.cpp index f3a411c..60d5bbd 100644 --- a/lib/FileIOFILE.cpp +++ b/lib/FileIOFILE.cpp @@ -1,10 +1,10 @@ #include #include #include -#include "NOD/Util.hpp" -#include "NOD/IFileIO.hpp" +#include "nod/Util.hpp" +#include "nod/IFileIO.hpp" -namespace NOD +namespace nod { class FileIOFILE : public IFileIO @@ -46,7 +46,7 @@ public: { fp = fopen(path.c_str(), "wb"); if (!fp) - LogModule.report(LogVisor::FatalError, _S("unable to open '%s' for writing"), path.c_str()); + LogModule.report(logvisor::Fatal, _S("unable to open '%s' for writing"), path.c_str()); } WriteStream(const SystemString& path, uint64_t offset, int64_t maxWriteSize) : m_maxWriteSize(maxWriteSize) @@ -61,7 +61,7 @@ public: FSeek(fp, offset, SEEK_SET); return; FailLoc: - LogModule.report(LogVisor::FatalError, _S("unable to open '%s' for writing"), path.c_str()); + LogModule.report(logvisor::Fatal, _S("unable to open '%s' for writing"), path.c_str()); } ~WriteStream() { @@ -72,7 +72,7 @@ public: if (m_maxWriteSize >= 0) { if (FTell(fp) + length > m_maxWriteSize) - LogModule.report(LogVisor::FatalError, _S("write operation exceeds file's %" PRIi64 "-byte limit"), m_maxWriteSize); + LogModule.report(logvisor::Fatal, _S("write operation exceeds file's %" PRIi64 "-byte limit"), m_maxWriteSize); } return fwrite(buf, 1, length, fp); } @@ -82,16 +82,16 @@ public: uint8_t buf[0x7c00]; while (length) { - uint64_t thisSz = NOD::min(uint64_t(0x7c00), length); + uint64_t thisSz = nod::min(uint64_t(0x7c00), length); uint64_t readSz = discio.read(buf, thisSz); if (thisSz != readSz) { - LogModule.report(LogVisor::FatalError, "unable to read enough from disc"); + LogModule.report(logvisor::Fatal, "unable to read enough from disc"); return read; } if (write(buf, readSz) != readSz) { - LogModule.report(LogVisor::FatalError, "unable to write in file"); + LogModule.report(logvisor::Fatal, "unable to write in file"); return read; } length -= thisSz; @@ -116,7 +116,7 @@ public: { fp = fopen(path.c_str(), "rb"); if (!fp) - LogModule.report(LogVisor::FatalError, _S("unable to open '%s' for reading"), path.c_str()); + LogModule.report(logvisor::Fatal, _S("unable to open '%s' for reading"), path.c_str()); } ReadStream(const SystemString& path, uint64_t offset) : ReadStream(path) @@ -145,15 +145,15 @@ public: uint8_t buf[0x7c00]; while (length) { - uint64_t thisSz = NOD::min(uint64_t(0x7c00), length); + uint64_t thisSz = nod::min(uint64_t(0x7c00), length); if (read(buf, thisSz) != thisSz) { - LogModule.report(LogVisor::FatalError, "unable to read enough from file"); + LogModule.report(logvisor::Fatal, "unable to read enough from file"); return written; } if (discio.write(buf, thisSz) != thisSz) { - LogModule.report(LogVisor::FatalError, "unable to write enough to disc"); + LogModule.report(logvisor::Fatal, "unable to write enough to disc"); return written; } length -= thisSz; diff --git a/lib/FileIOWin32.cpp b/lib/FileIOWin32.cpp index 662c82a..941f948 100644 --- a/lib/FileIOWin32.cpp +++ b/lib/FileIOWin32.cpp @@ -1,10 +1,10 @@ #include #include #include -#include "NOD/Util.hpp" -#include "NOD/IFileIO.hpp" +#include "nod/Util.hpp" +#include "nod/IFileIO.hpp" -namespace NOD +namespace nod { class FileIOWin32 : public IFileIO @@ -53,7 +53,7 @@ public: fp = CreateFileW(path.c_str(), GENERIC_WRITE, FILE_SHARE_WRITE, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr); if (fp == INVALID_HANDLE_VALUE) - LogModule.report(LogVisor::FatalError, _S("unable to open '%s' for writing"), path.c_str()); + LogModule.report(logvisor::Fatal, _S("unable to open '%s' for writing"), path.c_str()); } WriteStream(const SystemString& path, uint64_t offset, int64_t maxWriteSize) : m_maxWriteSize(maxWriteSize) @@ -61,7 +61,7 @@ public: fp = CreateFileW(path.c_str(), GENERIC_WRITE, FILE_SHARE_WRITE, nullptr, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr); if (fp == INVALID_HANDLE_VALUE) - LogModule.report(LogVisor::FatalError, _S("unable to open '%s' for writing"), path.c_str()); + LogModule.report(logvisor::Fatal, _S("unable to open '%s' for writing"), path.c_str()); LARGE_INTEGER lioffset; lioffset.QuadPart = offset; SetFilePointerEx(fp, lioffset, nullptr, FILE_BEGIN); @@ -78,7 +78,7 @@ public: LARGE_INTEGER res; SetFilePointerEx(fp, li, &res, FILE_CURRENT); if (res.QuadPart + int64_t(length) > m_maxWriteSize) - LogModule.report(LogVisor::FatalError, _S("write operation exceeds file's %" PRIi64 "-byte limit"), m_maxWriteSize); + LogModule.report(logvisor::Fatal, _S("write operation exceeds file's %" PRIi64 "-byte limit"), m_maxWriteSize); } DWORD ret = 0; @@ -91,16 +91,16 @@ public: uint8_t buf[0x7c00]; while (length) { - uint64_t thisSz = NOD::min(uint64_t(0x7c00), length); + uint64_t thisSz = nod::min(uint64_t(0x7c00), length); uint64_t readSz = discio.read(buf, thisSz); if (thisSz != readSz) { - LogModule.report(LogVisor::FatalError, "unable to read enough from disc"); + LogModule.report(logvisor::Fatal, "unable to read enough from disc"); return read; } if (write(buf, readSz) != readSz) { - LogModule.report(LogVisor::FatalError, "unable to write in file"); + LogModule.report(logvisor::Fatal, "unable to write in file"); return read; } length -= thisSz; @@ -126,7 +126,7 @@ public: fp = CreateFileW(path.c_str(), GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr); if (fp == INVALID_HANDLE_VALUE) - LogModule.report(LogVisor::FatalError, _S("unable to open '%s' for reading"), path.c_str()); + LogModule.report(logvisor::Fatal, _S("unable to open '%s' for reading"), path.c_str()); } ReadStream(const SystemString& path, uint64_t offset) : ReadStream(path) @@ -164,15 +164,15 @@ public: uint8_t buf[0x7c00]; while (length) { - uint64_t thisSz = NOD::min(uint64_t(0x7c00), length); + uint64_t thisSz = nod::min(uint64_t(0x7c00), length); if (read(buf, thisSz) != thisSz) { - LogModule.report(LogVisor::FatalError, "unable to read enough from file"); + LogModule.report(logvisor::Fatal, "unable to read enough from file"); return written; } if (discio.write(buf, thisSz) != thisSz) { - LogModule.report(LogVisor::FatalError, "unable to write enough to disc"); + LogModule.report(logvisor::Fatal, "unable to write enough to disc"); return written; } length -= thisSz; diff --git a/lib/aes.cpp b/lib/aes.cpp index 2d7a56f..a0520a8 100644 --- a/lib/aes.cpp +++ b/lib/aes.cpp @@ -1,4 +1,4 @@ -#include "NOD/aes.hpp" +#include "nod/aes.hpp" #include #include @@ -8,7 +8,7 @@ #include #endif -namespace NOD +namespace nod { /* rotates x one bit to the left */ diff --git a/lib/NOD.cpp b/lib/nod.cpp similarity index 76% rename from lib/NOD.cpp rename to lib/nod.cpp index f66bb4c..e8b1d6e 100644 --- a/lib/NOD.cpp +++ b/lib/nod.cpp @@ -1,11 +1,11 @@ #include -#include "NOD/NOD.hpp" -#include "NOD/DiscBase.hpp" +#include "nod/nod.hpp" +#include "nod/DiscBase.hpp" -namespace NOD +namespace nod { -LogVisor::LogModule LogModule("NODLib"); +logvisor::Module LogModule("nod"); std::unique_ptr NewDiscIOISO(const SystemChar* path); std::unique_ptr NewDiscIOWBFS(const SystemChar* path); @@ -16,7 +16,7 @@ std::unique_ptr OpenDiscFromImage(const SystemChar* path, bool& isWii) std::unique_ptr fio = NewFileIO(path); if (!fio->exists()) { - LogModule.report(LogVisor::Error, _S("Unable to open '%s'"), path); + LogModule.report(logvisor::Error, _S("Unable to open '%s'"), path); return std::unique_ptr(); } std::unique_ptr rs = fio->beginReadStream(); @@ -25,9 +25,9 @@ std::unique_ptr OpenDiscFromImage(const SystemChar* path, bool& isWii) std::unique_ptr discIO; uint32_t magic = 0; if (rs->read(&magic, 4) != 4) - LogModule.report(LogVisor::FatalError, _S("Unable to read magic from '%s'"), path); + LogModule.report(logvisor::Fatal, _S("Unable to read magic from '%s'"), path); - if (magic == NOD::SBig((uint32_t)'WBFS')) + if (magic == nod::SBig((uint32_t)'WBFS')) { discIO = NewDiscIOWBFS(path); isWii = true; @@ -36,7 +36,7 @@ std::unique_ptr OpenDiscFromImage(const SystemChar* path, bool& isWii) { rs->seek(0x18, SEEK_SET); rs->read(&magic, 4); - magic = NOD::SBig(magic); + magic = nod::SBig(magic); if (magic == 0x5D1C9EA3) { discIO = NewDiscIOISO(path); @@ -45,7 +45,7 @@ std::unique_ptr OpenDiscFromImage(const SystemChar* path, bool& isWii) else { rs->read(&magic, 4); - magic = NOD::SBig(magic); + magic = nod::SBig(magic); if (magic == 0xC2339F3D) discIO = NewDiscIOISO(path); } @@ -53,7 +53,7 @@ std::unique_ptr OpenDiscFromImage(const SystemChar* path, bool& isWii) if (!discIO) { - LogModule.report(LogVisor::Error, _S("'%s' is not a valid image"), path); + LogModule.report(logvisor::Error, _S("'%s' is not a valid image"), path); return std::unique_ptr(); } diff --git a/lib/sha1.c b/lib/sha1.c index 093a8c8..d98f353 100644 --- a/lib/sha1.c +++ b/lib/sha1.c @@ -5,7 +5,7 @@ #include #include -#include "NOD/sha1.h" +#include "nod/sha1.h" #ifdef __BIG_ENDIAN__ # define SHA_BIG_ENDIAN diff --git a/log-visor b/log-visor deleted file mode 160000 index 55b81ec..0000000 --- a/log-visor +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 55b81ec091e9f0e57bd7d092a396916234b1ada5 diff --git a/logvisor b/logvisor new file mode 160000 index 0000000..db41551 --- /dev/null +++ b/logvisor @@ -0,0 +1 @@ +Subproject commit db415516f6742bd3fe4d2616d478b232cc33ab34