Skip to content

Commit

Permalink
update mp3 hook
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirteenAG committed May 25, 2024
1 parent e400b86 commit 67f047b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 29 deletions.
41 changes: 15 additions & 26 deletions source/MaxPayne3.XboxRainDroplets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,6 @@
#include "FusionDxHook.h"

//static auto ppDevice = *hook::get_pattern<uint32_t>("68 ? ? ? ? 68 ? ? ? ? 8B D7 83 CA 10", 1);
uint32_t jmpaddr;
void __declspec(naked) sub_12D4470()
{
//static auto pDevice = *(LPDIRECT3DDEVICE9*)ppDevice;

//if (pDevice)
{
#ifdef DEBUG
WaterDrops::ms_rainIntensity = 1.0f; // todo: disable
#endif // DEBUG
WaterDrops::Process();
WaterDrops::Render();
WaterDrops::ms_rainIntensity = 0.0f;
}

_asm jmp jmpaddr
}

void Init()
{
Expand All @@ -45,11 +28,8 @@ void Init()

FusionDxHook::Init();

auto pattern = hook::pattern("83 EC 08 F3 0F 10 05 ? ? ? ? 8D 04 24 50");
jmpaddr = (uint32_t)pattern.get_first();

//this enables something for next hook to work
pattern = hook::pattern("38 1D ? ? ? ? 75 21 E8");
auto pattern = hook::pattern("38 1D ? ? ? ? 75 21 E8");
injector::WriteMemory<uint8_t>(pattern.get_first(6), 0xEB, true);

static bool bAmbientCheck = false;
Expand All @@ -67,7 +47,16 @@ void Init()
}; injector::MakeInline<AmbientCheckHook>(pattern.get_first(0), pattern.get_first(6));

pattern = hook::pattern("68 ? ? ? ? E8 ? ? ? ? 8B 15 ? ? ? ? 8B 0D ? ? ? ? 8B 04 95 ? ? ? ? 83 C4 08 03 C1");
injector::WriteMemory(pattern.get_first(1), sub_12D4470, true);
static SafetyHookMid shsub_12D4470 = safetyhook::create_mid(*pattern.get_first<void*>(1),
[](SafetyHookContext& ctx)
{
#ifdef DEBUG
WaterDrops::ms_rainIntensity = 1.0f;
#endif // DEBUG
WaterDrops::Process();
WaterDrops::Render();
WaterDrops::ms_rainIntensity = 0.0f;
});

pattern = hook::pattern("F3 0F 11 6E ? F3 0F 11 46 ? 5E 5B");
struct CameraHook
Expand Down Expand Up @@ -96,10 +85,10 @@ void Init()
WaterDrops::Reset();
};

FusionDxHook::D3D10::onPresentEvent += [](IDXGISwapChain* pSwapChain)
{
//Sire::Init(Sire::SIRE_RENDERER_DX10, pSwapChain);
};
//FusionDxHook::D3D10::onPresentEvent += [](IDXGISwapChain* pSwapChain)
//{
// //Sire::Init(Sire::SIRE_RENDERER_DX10, pSwapChain);
//};

FusionDxHook::D3D11::onPresentEvent += [](IDXGISwapChain* pSwapChain)
{
Expand Down
6 changes: 3 additions & 3 deletions source/resources/inis/MaxPayne3.XboxRainDroplets.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[MAIN]
MinSize = 5
MaxSize = 16
MaxDrops = 3500
MaxMovingDrops = 6000
MaxDrops = 350
MaxMovingDrops = 600
RadialMovement = 1
EnableGravity = 1
SpeedAdjuster = 1.0
MoveStep = 10.0
MoveStep = 1.0

0 comments on commit 67f047b

Please sign in to comment.