mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-01 14:20:42 -07:00
gitadora: (arena model) F: drive fix (#484)
## Link to GitHub Issue, if one exists N/A ## Description of change prevents the game from creating folders on F: drive ## Testing tested with M32-007-2025092400
This commit is contained in:
@@ -18,6 +18,32 @@ namespace games::gitadora {
|
||||
bool TWOCHANNEL = false;
|
||||
std::optional<unsigned int> CAB_TYPE = std::nullopt;
|
||||
|
||||
/*
|
||||
* Prevent GitaDora from creating folders on F drive
|
||||
*/
|
||||
|
||||
#ifdef SPICE64
|
||||
static DWORD WINAPI GetLogicalDrives_hook() {
|
||||
return GetLogicalDrives() | 0x20;
|
||||
}
|
||||
|
||||
static UINT WINAPI GetDriveTypeA_hook(LPCSTR lpRootPathName) {
|
||||
if (!strcmp(lpRootPathName, "F:\\")) {
|
||||
return DRIVE_FIXED;
|
||||
}
|
||||
|
||||
return GetDriveTypeA(lpRootPathName);
|
||||
}
|
||||
|
||||
static BOOL WINAPI CreateDirectoryA_hook(LPCSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes) {
|
||||
if (!strncmp(lpPathName, "F:/", 3)) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return CreateDirectoryA(lpPathName, lpSecurityAttributes);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* GitaDora checks if the IP address has changed, and if it has it throws 5-1506-0000 like jubeat.
|
||||
* We don't want this so we patch it out.
|
||||
@@ -238,6 +264,11 @@ namespace games::gitadora {
|
||||
// test/service/coin buttons
|
||||
bi2x_hook_init();
|
||||
|
||||
// f: drive hook
|
||||
detour::iat_try("GetLogicalDrives", GetLogicalDrives_hook, avs::game::DLL_INSTANCE);
|
||||
detour::iat_try("GetDriveTypeA", GetDriveTypeA_hook, avs::game::DLL_INSTANCE);
|
||||
detour::iat_try("CreateDirectoryA", CreateDirectoryA_hook, avs::game::DLL_INSTANCE);
|
||||
|
||||
// volume change prevention
|
||||
hooks::audio::mme::init(avs::game::DLL_INSTANCE);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user