Skip to content

Commit

Permalink
no DOF toggle, fix p2 infinite supermoves cheat
Browse files Browse the repository at this point in the history
  • Loading branch information
ermaccer committed Aug 24, 2024
1 parent 5023c2f commit afd63c0
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 10 deletions.
Binary file modified MK11Hook/MK11Hook.rc
Binary file not shown.
7 changes: 4 additions & 3 deletions MK11Hook/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "helper/eGamepadManager.h"
#include "helper/eAbilityNames.h"

#include <iostream>
#include <Commctrl.h>

#pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
Expand Down Expand Up @@ -88,6 +87,10 @@ void OnInitializeHook()
InjectHook(_pattern(PATID_SetKryptCharacterL_Hook), tramp->Jump(SetKryptCharacterL));
InjectHook(_pattern(PATID_SetKryptCharacterClass_Hook), tramp->Jump(SetKryptCharacterClass));


ReadCall(_pattern(PATID_ProcessDOFSettings), pProcessDOFSettings);
InjectHook(_pattern(PATID_ProcessDOFSettings), tramp->Jump(ProcessDOFSettings), PATCH_CALL);

//gamepad
if (SettingsMgr->bEnableGamepadSupport)
{
Expand Down Expand Up @@ -157,11 +160,9 @@ bool ValidateGameVersion()
break;
}
}

}

return true;

}

extern "C"
Expand Down
1 change: 0 additions & 1 deletion MK11Hook/mk/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ void HideHUD()
static uintptr_t pat = _pattern(PATID_HideHUD);
if (pat)
((void(__fastcall*)(int, int))pat)(8, 8);

}

void ShowHUD()
Expand Down
2 changes: 1 addition & 1 deletion MK11Hook/mk/GameInfo.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once
#include "PlayerInfo.h"
#include "../utils.h"
#include "..\utils.h"

#define TOTAL_ABILITIES 20

Expand Down
11 changes: 11 additions & 0 deletions MK11Hook/plugin/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

int64 hud_property = 0;

void(__fastcall* pProcessDOFSettings)(int64, int64, int64, int64) = 0;


void ProcessDOFSettings(int64 settings, int64 a2, int64 newSettings, int64 a4)
{
if (pProcessDOFSettings)
pProcessDOFSettings(settings, a2, newSettings, a4);

if (TheMenu->m_bDisableDOF)
*(int*)(settings + 36) = 0;
}

void MKProcDispatch_Hook()
{
Expand Down
3 changes: 3 additions & 0 deletions MK11Hook/plugin/Hooks.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
#include "..\helper\eMouse.h"
#include "PluginInterface.h"

extern void(__fastcall* pProcessDOFSettings)(int64, int64, int64, int64);
void ProcessDOFSettings(int64 settings, int64 a2, int64 newSettings, int64 a4);

void MKProcDispatch_Hook();
void Dispatch_Hook(int64 ptr, int a2);
void RecordEvent_Hook(int64 eventID, int64 a2, int64 a3, int64 a4);
Expand Down
7 changes: 4 additions & 3 deletions MK11Hook/plugin/Menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -614,8 +614,8 @@ const char* szStageNames[]{
"BGND_TournamentLVECT",
"BGND_TournamentLVFKT",
"BGND_WuShiDragonGrotto",

};

const char* szCameraModes[TOTAL_CUSTOM_CAMERAS] = {
"Third Person",
"Third Person #2",
Expand Down Expand Up @@ -1517,6 +1517,7 @@ void MK11Menu::DrawCameraTab()


ImGui::Separator();
ImGui::Checkbox("Disable DOF", &m_bDisableDOF);
ImGui::Checkbox("Force Camera To Move", &m_bForceCameraUpdate);
ImGui::SameLine(); ShowHelpMarker("Check this option if camera doesn't move in cinematics.");

Expand Down Expand Up @@ -1685,9 +1686,9 @@ void MK11Menu::DrawCheatsTab()
if (ImGui::Checkbox("P2##ixr", &m_bInfiniteXraysP2))
{
if (m_bInfiniteXraysP2)
GetObj(PLAYER2)->SetFastUppercutRecovery(true);
GetObj(PLAYER2)->SetXRayInfinite(true);
else
GetObj(PLAYER2)->SetFastUppercutRecovery(false);
GetObj(PLAYER2)->SetXRayInfinite(false);
}
ImGui::NextColumn();

Expand Down
3 changes: 2 additions & 1 deletion MK11Hook/plugin/Menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "../utils.h"


#define MK11HOOK_VERSION "0.5.7"
#define MK11HOOK_VERSION "0.5.8"

enum eCustomCameras {
CAMERA_3RDPERSON,
Expand Down Expand Up @@ -74,6 +74,7 @@ class MK11Menu {
bool m_bHideHUD = false;
bool m_bAutoHideHUD = false;
bool m_bMouseControl = false;
bool m_bDisableDOF = false;

// cheats
bool m_bInfiniteHealthP1 = false;
Expand Down
5 changes: 4 additions & 1 deletion MK11Hook/plugin/PatternSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ void PatternSolver::Initialize()

ms_patterns[PATID_GetScaleform] = GetPattern("83 3D ? ? ? ? ? 74 72 45 8B C4 8B 15", 2);

ms_patterns[PATID_ProcessDOFSettings] = GetPattern("48 8D 4B 44 E8 ? ? ? ? 48 8D 44 24", 4);

auto end = std::chrono::high_resolution_clock::now();

auto time = std::chrono::duration_cast<std::chrono::milliseconds>(end - begin);
Expand Down Expand Up @@ -234,7 +236,8 @@ const char* PatternSolver::GetPatternName(int id)
"GetNames",
"USkeletalMeshComponent_GetBoneName",
"XInputGetState_Hook",
"GetScaleform"
"GetScaleform",
"ProcessDOFSettings"
};

return szPatternNames[id];
Expand Down
1 change: 1 addition & 0 deletions MK11Hook/plugin/PatternSolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ enum EPatternID {

PATID_XInputGetState_Hook,
PATID_GetScaleform,
PATID_ProcessDOFSettings,

PATID_Total_Patterns
};
Expand Down

0 comments on commit afd63c0

Please sign in to comment.