Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ermaccer committed Jun 3, 2021
1 parent 705faaa commit 4cc406b
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 15 deletions.
Binary file removed MK11Hook/MK11Hook.aps
Binary file not shown.
Binary file modified MK11Hook/MK11Hook.rc
Binary file not shown.
2 changes: 1 addition & 1 deletion MK11Hook/code/eSettingsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void eSettingsManager::Init()
iHookMenuOpenKey = ini.ReadInteger("Settings", "iHookMenuOpenKey", VK_F1);

bUseLegacyCharacterModifier = ini.ReadBoolean("Settings", "bUseLegacyCharacterModifier", false);

bMakeAllAbilities1Slot = ini.ReadBoolean("Settings", "bMakeAllAbilities1Slot", false);
iFreeCameraKeyXPlus = ini.ReadInteger("Settings", "iFreeCameraKeyXPlus", 0);
iFreeCameraKeyXMinus = ini.ReadInteger("Settings", "iFreeCameraKeyXMinus", 0);

Expand Down
2 changes: 1 addition & 1 deletion MK11Hook/code/eSettingsManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class eSettingsManager {
int iHookMenuOpenKey;

bool bUseLegacyCharacterModifier;

bool bMakeAllAbilities1Slot;
// free camera keys
int iFreeCameraKeyXPlus;
int iFreeCameraKeyXMinus;
Expand Down
18 changes: 14 additions & 4 deletions MK11Hook/code/mk11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -567,9 +567,6 @@ void MK11Hooks::HookSetCharacter(int64 chr, char * name, int64 ptr, int64 unk)
}


struct FString {
char* string;
};

void MK11Hooks::HookSetCharacterBloodColor(int64 obj, int64 name, FLinearColor * color)
{
Expand Down Expand Up @@ -784,6 +781,12 @@ int64 MK11::GetCinemaByName(char * a1, char * a2, char * a3, int id)
return ((int64(__fastcall*)(char*, char*, char*, int))_mk11addr(0x140CEE9B0))(a1,a2,a3,id);
}

int64 MK11::GetUser(PLAYER_NUM plr)
{
__int64 gameinfo = *(__int64*)_mk11addr(GFG_GAME_INFO);
return ((int64(__fastcall*)(int64, PLAYER_NUM))_mk11addr(0x14056F150))(gameinfo, plr);
}


void __fastcall MK11::CamSetPos(int64 ptr, FVector * pos)
{
Expand Down Expand Up @@ -883,5 +886,12 @@ void MK11::SetKryptCharacterClass(int64 ptr, char * name, int unk)
((void(__fastcall*)(int64, char*, int))_mk11addr(0x142395E20))(ptr, name, unk);
}

FName::FName(char * text, int num)
{
((void(__thiscall*)(FName*, char*, int))_mk11addr(0x141A69CC0))(this, text, num);
}


char * FName::ToString(const char* str)
{
((void*(__thiscall*)(FName*, const char*))_mk11addr(0x141AFBEC0))(this, str);
}
19 changes: 18 additions & 1 deletion MK11Hook/code/mk11.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#define GALLERY_INFO 0x14348A610


#define MK11HOOK_VERSION "0.4"
#define MK11HOOK_VERSION "0.4.1"

enum PLAYER_NUM
{
Expand Down Expand Up @@ -43,6 +43,22 @@ struct FRotator {
int Roll;
};

class FString {
public:
char buffer[512];
};

class FName
{
public:
int Index;
int Number;

FName(char* text, int num);
char* ToString(const char* string);
};


struct MKCameraObj {
char pad[0x6BC];
FVector pos;
Expand Down Expand Up @@ -112,6 +128,7 @@ namespace MK11 {
int64 GetCinemaByName(char* a1, char* a2, char* a3, int id);


int64 GetUser(PLAYER_NUM plr);



Expand Down
12 changes: 5 additions & 7 deletions MK11Hook/code/mk11menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,10 @@ const char* szCharacters[] = {
"RAN_DefaultPreset_02",
"RAN_E",
"RAN_NoMask",
// more weird stuff
"LIU_Story_FireGod",
"LIU_Tower_FireGod",


};

Expand Down Expand Up @@ -1089,6 +1093,7 @@ void MK11Menu::Draw()
ImGui::EndTabItem();

}

ImGui::End();
}

Expand All @@ -1113,13 +1118,6 @@ void MK11Menu::Process()
void MK11Menu::UpdateControls()
{

if (GetAsyncKeyState(VK_F1))
{
if (GetTickCount64() - timer <= 150) return;
timer = GetTickCount64();
bIsActive ^= 1;
}

if (GetAsyncKeyState(VK_F5))
{
if (GetTickCount64() - timer <= 150) return;
Expand Down
2 changes: 1 addition & 1 deletion MK11Hook/code/mk11menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ enum eCHRModifierModes {

class MK11Menu {
private:
bool bIsActive;
int iCurrentTab;
public:
bool bIsActive;
bool bSlowMotionEnabled;
float fSlowMotionSpeed;
bool bFreezeWorld;
Expand Down
7 changes: 7 additions & 0 deletions MK11Hook/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ LRESULT __stdcall WndProc(const HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
TheMenu->mouseScroll = wParam;
// todo
break;
case WM_KEYDOWN:
if (wParam == SettingsMgr->iHookMenuOpenKey)
TheMenu->bIsActive ^= 1;
break;
default:
break;
}
Expand Down Expand Up @@ -354,6 +358,9 @@ void OnInitializeHook()
InjectHook(_mk11addr(0x140976E6A), tramp->Jump(MK11::SetKryptCharacterClass));


if (SettingsMgr->bMakeAllAbilities1Slot)
InjectHook(_mk11addr(0x140720E90), tramp->Jump(GenericTrueReturn), PATCH_JUMP);

}


Expand Down

0 comments on commit 4cc406b

Please sign in to comment.