Let us start here, from square one. No, from Zero!

This commit is contained in:
smpn2
2022-09-30 22:45:51 +09:00
parent 14215af0d1
commit b7a60638a4
1005 changed files with 303069 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
#include "avs/game.h"
#include "hpm.h"
#include "util/detour.h"
#include "util/libutils.h"
#include "util/logging.h"
#include <mmsystem.h>
namespace games::hpm {
BOOL WINAPI SetCurrentDirectoryW_hook(LPCTSTR lpPathName) {
return true;
}
static decltype(mixerSetControlDetails)* mixerSetControlDetails_real = nullptr;
static MMRESULT WINAPI mixerSetControlDetails_hook(HMIXEROBJ hmxobj, LPMIXERCONTROLDETAILS pmxcd, DWORD fdwDetails) {
mixerSetControlDetails_real(hmxobj, pmxcd, fdwDetails);
return MMSYSERR_NOERROR;
}
HPMGame::HPMGame() : Game("HELLO! Pop'n Music") {
}
void HPMGame::attach() {
Game::attach();
HMODULE kernel32_module = libutils::try_module("kernel32.dll");
// patches
detour::inline_hook((void *) SetCurrentDirectoryW_hook, libutils::try_proc(
kernel32_module, "SetCurrentDirectoryW"));
mixerSetControlDetails_real = detour::iat_try("mixerSetControlDetails", mixerSetControlDetails_hook, avs::game::DLL_INSTANCE);
}
}