Skip to content
This repository has been archived by the owner on Jun 2, 2023. It is now read-only.

Commit

Permalink
Merge pull request #19 from yescallop/master
Browse files Browse the repository at this point in the history
Fix Steam compatibility and directory creation
  • Loading branch information
arcusmaximus authored Apr 12, 2023
2 parents b114e8a + 47b4741 commit 9590c3c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Common/Directory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

using namespace std;

void Directory::Create(const std::wstring& folderPath)
void Directory::Create(const wstring& folderPath)
{
CreateDirectory(folderPath.c_str(), nullptr);
filesystem::create_directories(folderPath);
}

vector<wstring> Directory::GetFiles(const wstring& folderPath, const wstring& pattern)
Expand Down
11 changes: 7 additions & 4 deletions KirikiriUnencryptedArchive/Patcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,14 @@ void Patcher::CustomTVPRegisterStorageMedia(iTVPStorageMedia* pMedia)
{
ttstr mediaName;
pMedia->GetName(mediaName);
Debugger::Log(L"Hooking storage media \"%s\"", mediaName.c_str());

void** pVtable = *(void***)pMedia;
OriginalStorageMediaOpen[pMedia] = (decltype(CustomStorageMediaOpen)*)pVtable[6];
MemoryUtil::WritePointer(&pVtable[6], CustomStorageMediaOpen);
if (mediaName != ttstr(L"steam")) {
Debugger::Log(L"Hooking storage media \"%s\"", mediaName.c_str());

void** pVtable = *(void***)pMedia;
OriginalStorageMediaOpen[pMedia] = (decltype(CustomStorageMediaOpen)*)pVtable[6];
MemoryUtil::WritePointer(&pVtable[6], CustomStorageMediaOpen);
}

OriginalTVPRegisterStorageMedia(pMedia);
}
Expand Down
1 change: 1 addition & 0 deletions KirikiriUnencryptedArchive/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <algorithm>
#include <cassert>
#include <exception>
#include <filesystem>
#include <functional>
#include <map>
#include <ranges>
Expand Down

0 comments on commit 9590c3c

Please sign in to comment.