Skip to content

Commit

Permalink
steam update
Browse files Browse the repository at this point in the history
  • Loading branch information
ermaccer committed Oct 8, 2021
1 parent 2b17d89 commit 04287c5
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 104 deletions.
29 changes: 5 additions & 24 deletions MK11Hook/code/MKCharacter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,28 @@

void MKCharacter::SetLife(float life)
{
((void(__fastcall*)(MKCharacter*, float))_addr(0x1404C8070))(this, life);
((void(__fastcall*)(MKCharacter*, float))_addr(0x1404C80A0))(this, life);
}

void MKCharacter::SetScale(FVector * scale)
{
((void(__fastcall*)(MKCharacter*, FVector*))_addr(0x141161920))(this, scale);
((void(__fastcall*)(MKCharacter*, FVector*))_addr(0x1411619F0))(this, scale);
}

void MKCharacter::SetSpeed(float speed)
{
((void(__fastcall*)(MKCharacter*, float))_addr(0x1404C3D50))(this, speed);
((void(__fastcall*)(MKCharacter*, float))_addr(0x1404C3D80))(this, speed);
}

void MKCharacter::SetMeter(eMeterValues meter, float value)
{
((void(__fastcall*)(MKCharacter*, eMeterValues, float))_addr(0x1405FA670))(this, meter, value);
}

void MKCharacter::SetEasyKrushingBlows(bool enable)
{
((void(__fastcall*)(MKCharacter*, int, int))_addr(0x1404C71B0))(this, enable, 1);
}

void MKCharacter::SetItem(int64 ptr, char * slot)
{
((void(__fastcall*)(MKCharacter*, int64, char*))_addr(0x140818380))(this, ptr, slot);
}

void MKCharacter::SetBreakersActive(bool enable)
{
((void(__fastcall*)(MKCharacter*, int, int))_addr(0x1404C5C00))(this, enable, 1);
}

void MKCharacter::SetBreakers(int amount)
{
((void(__fastcall*)(MKCharacter*, int))_addr(0x1404C8AE0))(this,amount);
((void(__fastcall*)(MKCharacter*, int, int))_addr(0x1404C71E0))(this, enable, 1);
}

CharacterInfo * MKCharacter::GetCharacterData(int unk)
{
CharacterInfo* inf = ((CharacterInfo*(__fastcall*)(MKCharacter*,int))_addr(0x140C0DE60))(this, unk);
CharacterInfo* inf = ((CharacterInfo*(__fastcall*)(MKCharacter*,int))_addr(0x140C0E130))(this, unk);

printf("========\n");
printf("PTR: %x\n", inf);
Expand Down
4 changes: 0 additions & 4 deletions MK11Hook/code/MKCharacter.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,7 @@ class MKCharacter {
void SetLife(float life);
void SetScale(FVector* scale);
void SetSpeed(float speed);
void SetMeter(eMeterValues meter, float value);
void SetEasyKrushingBlows(bool enable);
void SetItem(int64 ptr, char* slot);
void SetBreakersActive(bool enable);
void SetBreakers(int amount);

CharacterInfo* GetCharacterData(int unk);

Expand Down
10 changes: 5 additions & 5 deletions MK11Hook/code/MKModifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@

TagAssistModifier::TagAssistModifier(const char * character)
{
((void(__fastcall*)(BaseModifier*,const char*, int))_addr(0x1405457D0))(this, character, 0);
((void(__fastcall*)(BaseModifier*,const char*, int))_addr(0x140545800))(this, character, 0);
}

void TagAssistModifier::Activate(int64 info)
{
//140558320
((void(__fastcall*)(BaseModifier*, int64))_addr(0x140558320))(this, info);
((void(__fastcall*)(BaseModifier*, int64))_addr(0x140558350))(this, info);
}

TagAssistModifierObject * TagAssistModifier::CreateObject()
{
return ((TagAssistModifierObject*(__fastcall*)(BaseModifier*))_addr(0x140560420))(this);
return ((TagAssistModifierObject*(__fastcall*)(BaseModifier*))_addr(0x140560450))(this);
}

void MKModifier::ActivateModifier(BaseModifier * modifier, MKCharacter * obj)
{
((void(__fastcall*)(MKModifier*, BaseModifier*, MKCharacter*))_addr(0x140B85960))(this, modifier, obj);
((void(__fastcall*)(MKModifier*, BaseModifier*, MKCharacter*))_addr(0x140B85BD0))(this, modifier, obj);
}

void TagAssistModifierObject::Activate(MKCharacter* obj)
{
((void(__fastcall*)(TagAssistModifierObject*, MKCharacter*))_addr(0x1405581A0))(this, obj);
((void(__fastcall*)(TagAssistModifierObject*, MKCharacter*))_addr(0x1405581D0))(this, obj);
}
2 changes: 1 addition & 1 deletion MK11Hook/code/eNotifManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void eNotificationManager::Draw()
if (m_bIsNotificationActive)
{
ImGui::SetNextWindowPos(ImVec2(5, 10));
ImGui::SetNextWindowSize(ImVec2(ImGui::GetIO().DisplaySize.x / 3, 0.0f));
ImGui::SetNextWindowSize(ImVec2(ImGui::GetIO().DisplaySize.x - 15.0f, 0.0f));
ImGui::Begin("setup", nullptr, ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoInputs
| ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing);
ImGui::TextUnformatted(szMessageBuffer);
Expand Down
59 changes: 23 additions & 36 deletions MK11Hook/code/mk11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ void __fastcall MK11Hooks::HookProcessStuff()

if (GetObj(PLAYER1))
{
GetObj(PLAYER1)->SetBreakersActive(true);
GetObj(PLAYER1)->SetBreakers(1000);
if (TheMenu->m_bInfiniteHealthP1)
GetObj(PLAYER1)->SetLife(1000.0f);

Expand Down Expand Up @@ -65,8 +63,6 @@ void __fastcall MK11Hooks::HookProcessStuff()

if (GetObj(PLAYER2))
{
GetObj(PLAYER2)->SetBreakersActive(true);
GetObj(PLAYER2)->SetBreakers(1000);
if (TheMenu->m_bInfiniteHealthP2)
GetObj(PLAYER2)->SetLife(1000.0f);

Expand Down Expand Up @@ -143,7 +139,7 @@ void __fastcall MK11Hooks::HookProcessStuff()

}

((void(__fastcall*)())_addr(0x141153C50))();
((void(__fastcall*)())_addr(0x141153D20))();
}

void MK11Hooks::PreLoadHook(int64 a1, int64 a2, int a3)
Expand Down Expand Up @@ -205,7 +201,7 @@ void __fastcall MK11Hooks::HookStartupFightRecording(int64 eventID, int64 a2, in



((void(__fastcall*)(int64, int64, int64, int64))_addr(0x141159BE0))(eventID, a2, a3, a4);
((void(__fastcall*)(int64, int64, int64, int64))_addr(0x141159CB0))(eventID, a2, a3, a4);

}

Expand Down Expand Up @@ -253,14 +249,14 @@ int64 __fastcall MK11Hooks::HookLoadCharacter(int64 ptr, char * name)
}

}
return ((int64(__fastcall*)(int64, char*))_addr(0x1408F8830))(ptr, name);
return ((int64(__fastcall*)(int64, char*))_addr(0x1408F8500))(ptr, name);

}

int64 MK11Hooks::HookSetProperty(int64 ptr, char * name, int64 unk)
{
hud_property = ptr;
return ((int64(__fastcall*)(int64, char*, int64))_addr(0x141A6B8B0))(ptr, name, unk);
return ((int64(__fastcall*)(int64, char*, int64))_addr(0x141A6BE90))(ptr, name, unk);
}

void MK11Hooks::HookReadPropertyValue(int64 ptr, int* unk, int* value)
Expand All @@ -281,7 +277,7 @@ int64 MK11Hooks::HookLoadouts(int64 ptr)
if (TheMenu->m_bDisableGearLoadouts)
return true;
else
return ((int64(__fastcall*)(int64))_addr(0x14086F930))(ptr);
return ((int64(__fastcall*)(int64))_addr(0x14086F670))(ptr);
}

void MK11Hooks::HookDispatch(int64 ptr, int a2)
Expand All @@ -300,7 +296,7 @@ void MK11Hooks::HookDispatch(int64 ptr, int a2)
((void(*)(int64, int))*(int64*)(arg + 0xD8))(ptr, a2);
}
else
((int64(__fastcall*)(int64, int))_addr(0x141172F20))(ptr, a2);
((int64(__fastcall*)(int64, int))_addr(0x141172FF0))(ptr, a2);

}

Expand Down Expand Up @@ -351,13 +347,13 @@ void MK11Hooks::HookSetLadderScreen(int64 chr, char * name, int64 ptr, int64 unk

MKCharacter* GetObj(PLAYER_NUM plr)
{
return ((MKCharacter*(__fastcall*)(PLAYER_NUM))_addr(0x1408F8B00))(plr);
return ((MKCharacter*(__fastcall*)(PLAYER_NUM))_addr(0x1408F87D0))(plr);
}

int64 GetInfo(PLAYER_NUM plr)
{
int64 gameinfo = *(__int64*)_addr(GFG_GAME_INFO);
return ((int64(__fastcall*)(int64, PLAYER_NUM))_addr(0x14056F130))(gameinfo, plr);
return ((int64(__fastcall*)(int64, PLAYER_NUM))_addr(0x14056F160))(gameinfo, plr);
}


Expand All @@ -372,12 +368,12 @@ void GetCharacterPosition(FVector * vec, PLAYER_NUM plr)

void HideHUD()
{
((void(__fastcall*)(int, int))_addr(0x1408F5550))(8, 8);
((void(__fastcall*)(int, int))_addr(0x1408F5220))(8, 8);
}

void ShowHUD()
{
((void(__fastcall*)(int, int))_addr(0x1408F5E90))(8, 8);
((void(__fastcall*)(int, int))_addr(0x1408F5B60))(8, 8);
}

void SetCharacterMKX(PLAYER_NUM plr, char * name)
Expand All @@ -389,24 +385,23 @@ void SetCharacterMKX(PLAYER_NUM plr, char * name)

void SetCharacter(int64 chr, char * name, int64 ptr, int64 unk)
{
((void(__fastcall*)(int64, const char*, int64, int64))_addr(0x1405982F0))(chr, name, ptr, unk);
((void(__fastcall*)(int64, const char*, int64, int64))_addr(0x140598320))(chr, name, ptr, unk);

}

void SetCharacterLevel(int64 chr, int level)
{
((void(__fastcall*)(int64, int))_addr(0x1405997C0))(chr, level);
((void(__fastcall*)(int64, int))_addr(0x1405997F0))(chr, level);
}

void SetCharacterAltPal(int64 chr, int value)
{

((void(__fastcall*)(int64, int))_addr(0x14059DE20))(chr, value);
((void(__fastcall*)(int64, int))_addr(0x14059DE50))(chr, value);
}

void SetCharacterLoadout(int64 chr, int64 loadout)
{
((void(__fastcall*)(int64, int64))_addr(0x1405998F0))(chr, loadout);
((void(__fastcall*)(int64, int64))_addr(0x140599920))(chr, loadout);
}


Expand All @@ -422,25 +417,19 @@ char * GetCharacterName(PLAYER_NUM plr)

void SlowGameTimeForXTicks(float speed, int ticks)
{
((void(__fastcall*)(float, int, int))_addr(0x1405C04A0))(speed, ticks, 0);
}

void SetSpeed(float speed)
{
int64 gameinfo = *(__int64*)_addr(GFG_GAME_INFO);
((void(__fastcall*)(int64, float))_addr(0x140599510))(gameinfo, speed);
((void(__fastcall*)(float, int, int))_addr(0x1405C0280))(speed, ticks, 0);
}

void SetCharacterEnergy(int64 obj, int type, float energy)
{
((void(__fastcall*)(int64, int, float))_addr(0x1405FA670))(obj, type, energy);
((void(__fastcall*)(int64, int, float))_addr(0x1405FA450))(obj, type, energy);
}

void SetStage(const char * stage)
{
__int64 gameinfo = *(__int64*)_addr(GFG_GAME_INFO);

((void(__fastcall*)(int64, const char*))_addr(0x140599CA0))(gameinfo, stage);
((void(__fastcall*)(int64, const char*))_addr(0x140599CD0))(gameinfo, stage);
}


Expand Down Expand Up @@ -491,32 +480,30 @@ void SetKryptCharacter(int64 ptr, char * name)

printf("MK11Hook::SetKryptCharacter() | Loading character %s\n", name);

((void(__fastcall*)(int64, char*))_addr(0x140821CD0))(ptr, name);
((void(__fastcall*)(int64, char*))_addr(0x140821A50))(ptr, name);
}

void SetKryptCharacterL(int64 ptr, char * name, int unk)
{
//if (TheMenu->bChangeKryptCharacter)
// name = 0;
((void(__fastcall*)(int64, char*, int))_addr(0x141A69CC0))(ptr, name, unk);
((void(__fastcall*)(int64, char*, int))_addr(0x141A6A2A0))(ptr, name, unk);
}

void SetKryptCharacterClass(int64 ptr, char * name, int unk)
{
if (TheMenu->m_bKryptModifier)
name = TheMenu->szCurrentKryptCharacterClass;
((void(__fastcall*)(int64, char*, int))_addr(0x142395E20))(ptr, name, unk);
((void(__fastcall*)(int64, char*, int))_addr(0x142396240))(ptr, name, unk);
}

MKModifier* GetModifierManager()
{
int64 info = ((int64(__fastcall*)())_addr(0x140679670))();
return ((MKModifier*(__fastcall*)(int64))_addr(0x14067B240))(info);
int64 info = ((int64(__fastcall*)())_addr(0x140679430))();
return ((MKModifier*(__fastcall*)(int64))_addr(0x14067B000))(info);
}

void LoadModifierAssets()
{
int64 gameinfo = *(__int64*)_addr(GFG_GAME_INFO);
((void(__fastcall*)(int64, bool))_addr(0x14057D590))(gameinfo, 1);
((void(__fastcall*)(int64, bool))_addr(0x14057D5C0))(gameinfo, 1);

}
3 changes: 1 addition & 2 deletions MK11Hook/code/mk11.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "MKStructs.h"
#include "MKCharacter.h"
#include "MKModifier.h"
#define GFG_GAME_INFO 0x14348ED10
#define GFG_GAME_INFO 0x1434990A0


#define MK11HOOK_VERSION "0.4.4"
Expand Down Expand Up @@ -58,7 +58,6 @@ char* GetCharacterName(PLAYER_NUM plr);


void SlowGameTimeForXTicks(float speed, int ticks);
void SetSpeed(float speed);



Expand Down
12 changes: 2 additions & 10 deletions MK11Hook/code/mkcamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,19 @@ void MKCamera::SetPosition(FVector * pos)
{
TheCamera = this;
camPos = *pos;
//*(float*)(this + 0x6BC) = pos->X;
//*(float*)(this + 0x6BC + 4) = pos->Y;
//*(float*)(this + 0x6BC + 8) = pos->Z;

((void(__fastcall*)(MKCamera*, FVector*))_addr(0x141A12280))(this, pos);
((void(__fastcall*)(MKCamera*, FVector*))_addr(0x141A12830))(this, pos);
}

void MKCamera::SetRotation(FRotator * rot)
{
TheCamera = this;
camRot = *rot;
//*(int*)(this + 0x6BC + 12) = rot->Pitch;
//*(int*)(this + 0x6BC + 12 + 4) = rot->Yaw;
//*(int*)(this + 0x6BC + 12 + 8) = rot->Roll;
((void(__fastcall*)(MKCamera*, FRotator*))_addr(0x141A12C60))(this, rot);
((void(__fastcall*)(MKCamera*, FRotator*))_addr(0x141A13210))(this, rot);
}

void MKCamera::SetFOV(float FOV)
{
camFov = FOV;
//*(float*)(this + 0x6BC + 24) = FOV;
}

float MKCamera::GetFOV()
Expand Down
Loading

0 comments on commit 04287c5

Please sign in to comment.