├── MK1Hook ├── unreal │ ├── UObject.cpp │ ├── FRotator.h │ ├── FQuat.h │ ├── FEngineLoop.h │ ├── FString.cpp │ ├── FString.h │ ├── FMath.h │ ├── FMath.cpp │ ├── FEngineLoop.cpp │ ├── UObject.h │ ├── ULevel.h │ ├── UWorld.cpp │ ├── FName.h │ ├── UWorld.h │ ├── TArray.h │ ├── FMatrix.h │ ├── SkeletalMesh.h │ ├── FName.cpp │ ├── FVector.h │ ├── SkeletalMesh.cpp │ └── FMatrix.cpp ├── MK1Hook.rc ├── mk │ ├── MissionInfo.cpp │ ├── VMProc.cpp │ ├── MissionInfo.h │ ├── MKObject.cpp │ ├── Scaleform.h │ ├── MKObject.h │ ├── VMProc.h │ ├── Scaleform.cpp │ ├── PlayerInfo.h │ ├── FightingTeamDefinition.h │ ├── MKModifier.h │ ├── GameInfo.h │ ├── CharacterDefinition.h │ ├── ContentDefinition.h │ ├── MKCamera.h │ ├── MKCharacter.h │ ├── CharacterDefinition.cpp │ ├── PlayerInfo.cpp │ ├── FightingTeamDefinition.cpp │ ├── Engine.h │ ├── MKCamera.cpp │ ├── MKScript.h │ └── MKModifier.cpp ├── steam_api64.lib ├── gui │ ├── const.h │ ├── log.h │ ├── notifications.h │ ├── log.cpp │ ├── imgui │ │ ├── imgui_impl_dx11.h │ │ └── imgui_impl_dx12.h │ ├── dx12hook.h │ ├── notifications.cpp │ └── gui_impl.h ├── utils │ ├── addr.h │ ├── addr.cpp │ ├── core.h │ └── IniReader.h ├── framework.h ├── pch.cpp ├── utils.h ├── plugin │ ├── SteamAPI.h │ ├── Settings.h │ ├── PluginInterface.h │ ├── Hooks.h │ └── API.h ├── helper │ ├── eMouse.h │ ├── eMath.h │ ├── eMath.cpp │ ├── eMouse.cpp │ ├── eGamepadManager.h │ ├── eKeyboardMan.cpp │ └── eKeyboardMan.h ├── resource.h ├── pch.h ├── steam │ ├── OAuthCommon.h │ ├── SteamSalt.h │ ├── AppTicketCommon.h │ ├── ESteamBufferMethod.h │ ├── BridgeCommon.h │ ├── TSteamOfflineStatus.h │ ├── TSteamUpdateStats.h │ ├── ESteamSeekMethod.h │ ├── SteamAPI.h │ ├── TSteamAppVersion.h │ ├── SteamclientAPI.h │ ├── Steamworks.h │ ├── TSteamAppDependencyInfo.h │ ├── TSteamSubscriptionStats.h │ ├── TSteamDiscountQualifier.h │ ├── TSteamPrepurchaseReceiptInfo.h │ ├── ESteamPaymentCardType.h │ ├── TSteamSubscriptionDiscount.h │ ├── MusicCommon.h │ ├── TSteamExternalBillingInfo.h │ ├── TSteamProgress.h │ ├── FriendGameInfo.h │ ├── IClientStreamLauncher.h │ ├── ISteamStreamLauncher001.h │ ├── ESteamServerType.h │ ├── ESteamAppUpdateStatsQueryType.h │ ├── ESteamFindFilter.h │ ├── MasterServerUpdaterCommon.h │ ├── UnifiedMessagesCommon.h │ ├── TSteamAppLaunchOption.h │ ├── EVoiceResult.h │ ├── ISteamOAuth001.h │ ├── ISteamContentServer001.h │ ├── StreamLauncherCommon.h │ ├── TSteamError.h │ ├── TSteamSubscriptionBillingInfo.h │ ├── ESteamSubscriptionBillingInfoType.h │ ├── TSteamAppStats.h │ ├── TSteamGlobalUserID.h │ ├── IClientGameCoordinator.h │ ├── TSteamPrepurchaseInfo.h │ ├── TSteamSubscriptionReceipt.h │ ├── Win32Library.h │ ├── POSIXLibrary.h │ ├── ISteamMusic001.h │ ├── ISteamUnifiedMessages001.h │ ├── IClientUnifiedMessages.h │ ├── ISteamContentServer002.h │ ├── ESteamNotify.h │ ├── TSteamApp.h │ ├── ISteamApps001.h │ ├── IClientProductBuilder.h │ ├── ISteamAppList001.h │ ├── TSteamSplitLocalUserID.h │ ├── ISteamRemoteStorage001.h │ ├── IClientStreamClient.h │ ├── ISteamUtils001.h │ ├── ISteamApps002.h │ ├── ISteamAppTicket001.h │ ├── ESteamSubscriptionStatus.h │ ├── MatchMakingKeyValuePair.h │ ├── ContentServerCommon.h │ ├── ISteamApps003.h │ ├── TSteamPaymentCardReceiptInfo.h │ ├── IClientContentServer.h │ ├── TSteamSubscription.h │ ├── ECurrencyCode.h │ ├── IClientDeviceAuth.h │ ├── ISteamController001.h │ ├── ISteamGameCoordinator001.h │ ├── IClientApps.h │ ├── ISteamRemoteStorage002.h │ ├── ClientCommon.h │ ├── ISteam2Bridge001.h │ ├── TSteamElemInfo.h │ ├── TSteamPaymentCardInfo.h │ ├── GameStatsCommon.h │ └── ISteamGameStats001.h └── minhook │ └── src │ ├── hde │ └── pstdint.h │ └── buffer.h ├── SamplePlugin ├── PluginInfo.h ├── framework.h ├── pch.cpp ├── pch.h ├── SDK.h └── SamplePlugin.vcxproj.filters ├── README.md ├── MK1Hook.sln └── .gitattributes /MK1Hook/unreal/UObject.cpp: -------------------------------------------------------------------------------- 1 | #include "UObject.h" 2 | -------------------------------------------------------------------------------- /MK1Hook/MK1Hook.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ermaccer/MK1Hook/HEAD/MK1Hook/MK1Hook.rc -------------------------------------------------------------------------------- /MK1Hook/mk/MissionInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "MissionInfo.h" 2 | #include "..\plugin\Menu.h" 3 | -------------------------------------------------------------------------------- /SamplePlugin/PluginInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define PLUGIN_API __declspec(dllexport) -------------------------------------------------------------------------------- /MK1Hook/steam_api64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ermaccer/MK1Hook/HEAD/MK1Hook/steam_api64.lib -------------------------------------------------------------------------------- /MK1Hook/gui/const.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | static int const NUM_BACK_BUFFERS = 3; 4 | -------------------------------------------------------------------------------- /MK1Hook/unreal/FRotator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct FRotator { 4 | int Pitch; 5 | int Yaw; 6 | int Roll; 7 | }; -------------------------------------------------------------------------------- /MK1Hook/mk/VMProc.cpp: -------------------------------------------------------------------------------- 1 | #include "VMProc.h" 2 | 3 | unsigned int VMProc::GetCurrentFunction() 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /MK1Hook/unreal/FQuat.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | struct FQuat 3 | { 4 | float X; 5 | float Y; 6 | float Z; 7 | float W; 8 | }; 9 | -------------------------------------------------------------------------------- /MK1Hook/unreal/FEngineLoop.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "..\utils.h" 3 | 4 | class FEngineLoop { 5 | public: 6 | void Tick(); 7 | }; -------------------------------------------------------------------------------- /MK1Hook/utils/addr.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | typedef __int64 int64; 3 | 4 | 5 | int64 GetEntryPoint(); 6 | int64 _addr(int64 addr); 7 | -------------------------------------------------------------------------------- /MK1Hook/unreal/FString.cpp: -------------------------------------------------------------------------------- 1 | #include "FString.h" 2 | 3 | wchar_t* FString::GetStr() 4 | { 5 | return (wchar_t*)(&Data[0]); 6 | } 7 | -------------------------------------------------------------------------------- /MK1Hook/mk/MissionInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../utils.h" 3 | 4 | 5 | class MissionInfo { 6 | public: 7 | 8 | 9 | }; 10 | -------------------------------------------------------------------------------- /MK1Hook/unreal/FString.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "TArray.h" 3 | 4 | class FString : public TArray< wchar_t > { 5 | public: 6 | wchar_t* GetStr(); 7 | }; -------------------------------------------------------------------------------- /MK1Hook/unreal/FMath.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | class FMath { 5 | public: 6 | float TrigFLOAT[16384]; 7 | 8 | FMath(); 9 | }; 10 | 11 | extern FMath GMath; -------------------------------------------------------------------------------- /MK1Hook/framework.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 4 | // Windows Header Files 5 | #include 6 | -------------------------------------------------------------------------------- /MK1Hook/mk/MKObject.cpp: -------------------------------------------------------------------------------- 1 | #include "MKObject.h" 2 | 3 | void MKObject::GetPos(FVector* dest) 4 | { 5 | int64 obj = *(int64*)((int64)this + 312); 6 | *dest = *(FVector*)(obj + 292); 7 | } -------------------------------------------------------------------------------- /SamplePlugin/framework.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 4 | // Windows Header Files 5 | #include 6 | -------------------------------------------------------------------------------- /MK1Hook/mk/Scaleform.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "..\utils.h" 3 | 4 | class Scaleform { 5 | public: 6 | char pad[64]; 7 | bool m_bActive; 8 | }; 9 | 10 | 11 | Scaleform* GetScaleform(); -------------------------------------------------------------------------------- /MK1Hook/mk/MKObject.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "..\utils.h" 3 | #include "..\unreal\FVector.h" 4 | 5 | // TODO 6 | class MKObject { 7 | public: 8 | 9 | void GetPos(FVector* dest); 10 | }; -------------------------------------------------------------------------------- /MK1Hook/pch.cpp: -------------------------------------------------------------------------------- 1 | // pch.cpp: source file corresponding to the pre-compiled header 2 | 3 | #include "pch.h" 4 | 5 | // When you are using pre-compiled headers, this source file is necessary for compilation to succeed. 6 | -------------------------------------------------------------------------------- /SamplePlugin/pch.cpp: -------------------------------------------------------------------------------- 1 | // pch.cpp: source file corresponding to the pre-compiled header 2 | 3 | #include "pch.h" 4 | 5 | // When you are using pre-compiled headers, this source file is necessary for compilation to succeed. 6 | -------------------------------------------------------------------------------- /MK1Hook/mk/VMProc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "..\unreal\TArray.h" 3 | class VMProc { 4 | public: 5 | char pad[0x68]; 6 | TArray args; 7 | 8 | void PushArg(); 9 | 10 | unsigned int GetCurrentFunction(); 11 | }; -------------------------------------------------------------------------------- /MK1Hook/mk/Scaleform.cpp: -------------------------------------------------------------------------------- 1 | #include "Scaleform.h" 2 | 3 | Scaleform* GetScaleform() 4 | { 5 | static uintptr_t pat = _pattern(PATID_GetScaleform); 6 | if (pat) 7 | return ((Scaleform*(__fastcall*)())pat)(); 8 | 9 | return nullptr; 10 | } 11 | -------------------------------------------------------------------------------- /MK1Hook/gui/log.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #define LOGNAME L"mk1hook_log.txt" 4 | 5 | 6 | class eLog { 7 | public: 8 | static wchar_t path[MAX_PATH]; 9 | 10 | static void Initialize(); 11 | static void Message(const char* function, const char* format, ...); 12 | }; -------------------------------------------------------------------------------- /MK1Hook/utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "utils/addr.h" 3 | #include "utils/MemoryMgr.h" 4 | #include "utils/Trampoline.h" 5 | #include "utils/Patterns.h" 6 | #include "utils/core.h" 7 | #include "plugin/PatternSolver.h" 8 | #include "gui/log.h" 9 | 10 | 11 | using namespace Memory::VP; -------------------------------------------------------------------------------- /MK1Hook/plugin/SteamAPI.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // uses open steamworks 4 | 5 | bool SteamAPI_Initialize(); 6 | void SteamAPI_Destroy(); 7 | 8 | namespace SteamAPI { 9 | unsigned int GetApplicationID(); 10 | const char* GetUsername(); 11 | bool IsAppInstalled(unsigned int appID); 12 | } -------------------------------------------------------------------------------- /MK1Hook/unreal/FMath.cpp: -------------------------------------------------------------------------------- 1 | #include "FMath.h" 2 | #include 3 | 4 | FMath GMath; 5 | 6 | FMath::FMath() 7 | { 8 | for (int i = 0; i < 16384; ++i) 9 | { 10 | float value = i * 2.0f * 3.141592653589793f / 16384.0f; 11 | this->TrigFLOAT[i] = sinf(value); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /MK1Hook/unreal/FEngineLoop.cpp: -------------------------------------------------------------------------------- 1 | #include "FEngineLoop.h" 2 | #include "..\plugin\Hooks.h" 3 | 4 | void FEngineLoop::Tick() 5 | { 6 | static uintptr_t pat = _pattern(PATID_FEngineLoop_Tick); 7 | if (pat) 8 | { 9 | ((void(__fastcall*)(FEngineLoop*))pat)(this); 10 | PluginDispatch(); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /MK1Hook/utils/addr.cpp: -------------------------------------------------------------------------------- 1 | #include "..\pch.h" 2 | #include "addr.h" 3 | 4 | int64 GetEntryPoint() 5 | { 6 | static int64 addr = reinterpret_cast(GetModuleHandle(nullptr)); 7 | return addr; 8 | } 9 | 10 | int64 _addr(int64 addr) 11 | { 12 | static int64 ImageBase = 0x140000000; 13 | return GetEntryPoint() - ImageBase + addr; 14 | } 15 | -------------------------------------------------------------------------------- /MK1Hook/utils/core.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #define VALIDATE_SIZE(struc, size) static_assert(sizeof(struc) == size, "Invalid structure size of " #struc) 5 | #define VALIDATE_OFFSET(struc, member, offset) \ 6 | static_assert(offsetof(struc, member) == offset, "The offset of " #member " in " #struc " is not " #offset "...") 7 | 8 | -------------------------------------------------------------------------------- /MK1Hook/unreal/UObject.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "FName.h" 3 | #include 4 | 5 | class UClass; 6 | 7 | class UObject { 8 | public: 9 | void* vtable; 10 | 11 | int Flags; 12 | int Index; 13 | UClass* Class; 14 | FName Name; 15 | UObject* Outer; 16 | }; 17 | 18 | 19 | class UClass : public UObject { 20 | public: 21 | 22 | }; 23 | -------------------------------------------------------------------------------- /MK1Hook/helper/eMouse.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class eMouse { 4 | public: 5 | int x; 6 | int y; 7 | 8 | int deltaX; 9 | int deltaY; 10 | bool gotDelta; 11 | 12 | eMouse(); 13 | 14 | void Clear(); 15 | 16 | static void UpdateMouse(); 17 | 18 | static eMouse mouse; 19 | 20 | 21 | static int GetDeltaX(); 22 | static int GetDeltaY(); 23 | 24 | static void LockMouse(); 25 | }; 26 | 27 | -------------------------------------------------------------------------------- /MK1Hook/unreal/ULevel.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "TArray.h" 3 | #include "UObject.h" 4 | #include "UWorld.h" 5 | 6 | class UWorld; 7 | 8 | class ULevel { 9 | public: 10 | char pad[152]; 11 | TArray Actors; 12 | }; 13 | VALIDATE_OFFSET(ULevel, Actors, 0x98); 14 | 15 | class ULevelStreaming { 16 | public: 17 | char pad[296]; 18 | ULevel* LoadedLevel; 19 | }; 20 | VALIDATE_OFFSET(ULevelStreaming, LoadedLevel, 0x128); -------------------------------------------------------------------------------- /MK1Hook/gui/notifications.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class eNotificationManager { 4 | public: 5 | char szMessageBuffer[2048] = {}; 6 | bool m_bIsNotificationActive; 7 | float m_fNotifAlpha; 8 | 9 | void Init(); 10 | 11 | void Update(); 12 | void UpdateAlpha(); 13 | void Draw(); 14 | void SetNotificationTime(int time); 15 | void PushNotification(const char* format, ...); 16 | }; 17 | 18 | extern eNotificationManager* Notifications; -------------------------------------------------------------------------------- /MK1Hook/unreal/UWorld.cpp: -------------------------------------------------------------------------------- 1 | #include "UWorld.h" 2 | UWorld** UWorld::GWorld = nullptr; 3 | void UWorld::FindWorld() 4 | { 5 | static uintptr_t pat = _pattern(PATID_UWorld_GWorld); 6 | if (pat) 7 | { 8 | unsigned int offset = *(unsigned int*)(pat); 9 | UWorld::GWorld = (UWorld**)(pat + offset + 4); 10 | } 11 | } 12 | 13 | UWorld* GetWorld() 14 | { 15 | if (UWorld::GWorld) 16 | return *UWorld::GWorld; 17 | 18 | return nullptr; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /MK1Hook/unreal/FName.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "FString.h" 3 | #include "..\utils.h" 4 | 5 | enum EFindName 6 | { 7 | FNAME_Find, 8 | FNAME_Add, 9 | FNAME_Replace, 10 | }; 11 | 12 | 13 | class FName { 14 | public: 15 | int Index; 16 | int Number; 17 | 18 | FString* ToString(FString* str); 19 | 20 | FName(); 21 | FName(const char* Name, EFindName FindType, int formal); 22 | FName(const wchar_t* Name, EFindName FindType, int formal); 23 | }; 24 | -------------------------------------------------------------------------------- /MK1Hook/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by MK1Hook.rc 4 | 5 | // Next default values for new objects 6 | // 7 | #ifdef APSTUDIO_INVOKED 8 | #ifndef APSTUDIO_READONLY_SYMBOLS 9 | #define _APS_NEXT_RESOURCE_VALUE 101 10 | #define _APS_NEXT_COMMAND_VALUE 40001 11 | #define _APS_NEXT_CONTROL_VALUE 1001 12 | #define _APS_NEXT_SYMED_VALUE 101 13 | #endif 14 | #endif 15 | -------------------------------------------------------------------------------- /MK1Hook/helper/eMath.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "..\unreal\FVector.h" 3 | #include "..\unreal\FQuat.h" 4 | 5 | #include 6 | #define M_PI 3.14159265358979323846f 7 | 8 | #define degToRad(angleInDegrees) ((angleInDegrees) * M_PI / 180.0) 9 | #define radToDeg(angleInRadians) ((angleInRadians) * 180.0 / M_PI) 10 | 11 | class eMath { 12 | public: 13 | static FVector quat2vec(FQuat q); 14 | static bool areVecsEqual(FVector v1, FVector v2); 15 | }; -------------------------------------------------------------------------------- /MK1Hook/unreal/UWorld.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "..\utils.h" 3 | #include "..\unreal\TArray.h" 4 | #include "ULevel.h" 5 | 6 | 7 | class UWorld { 8 | public: 9 | char pad[48]; 10 | ULevel* PersistentLevel; 11 | char _pad[88]; 12 | TArray StreamingLevels; 13 | 14 | static UWorld** GWorld; 15 | static void FindWorld(); 16 | }; 17 | VALIDATE_OFFSET(UWorld, PersistentLevel, 0x30); 18 | VALIDATE_OFFSET(UWorld, StreamingLevels, 0x90); 19 | 20 | 21 | 22 | 23 | UWorld* GetWorld(); -------------------------------------------------------------------------------- /MK1Hook/unreal/TArray.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | template < class T > class TArray { 5 | public: 6 | T* Data; 7 | int Count; 8 | int Max; 9 | 10 | TArray(); 11 | T& Get(int id) { return this->Data[id]; }; 12 | void Add(T data); 13 | 14 | }; 15 | 16 | template 17 | inline TArray::TArray() 18 | { 19 | Data = nullptr; 20 | Count = 0; 21 | Max = 0; 22 | } 23 | 24 | template 25 | inline void TArray::Add(T InputData) 26 | { 27 | Data[Count++] = InputData; 28 | } 29 | -------------------------------------------------------------------------------- /MK1Hook/mk/PlayerInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "..\utils.h" 3 | 4 | // 0x81C3FA9 - makedrone 5 | 6 | struct AIDroneInfo { 7 | unsigned char ScriptID; 8 | unsigned char Level; 9 | char pad[78]; 10 | }; 11 | 12 | class AIDrone { 13 | public: 14 | // integer in mk12, previously float 15 | int GetDroneLevel(); 16 | void Set(const char* script); 17 | 18 | static int ScriptToID(const char* script); 19 | }; 20 | 21 | class PlayerInfo { 22 | public: 23 | void AdjustMeter(float value); 24 | void SetMeter(float value); 25 | void SetDamageMult(float value); 26 | AIDrone* GetDrone(); 27 | }; -------------------------------------------------------------------------------- /MK1Hook/pch.h: -------------------------------------------------------------------------------- 1 | // pch.h: This is a precompiled header file. 2 | // Files listed below are compiled only once, improving build performance for future builds. 3 | // This also affects IntelliSense performance, including code completion and many code browsing features. 4 | // However, files listed here are ALL re-compiled if any one of them is updated between builds. 5 | // Do not add files here that you will be updating frequently as this negates the performance advantage. 6 | 7 | #ifndef PCH_H 8 | #define PCH_H 9 | 10 | // add headers that you want to pre-compile here 11 | #include "framework.h" 12 | 13 | #endif //PCH_H 14 | -------------------------------------------------------------------------------- /SamplePlugin/pch.h: -------------------------------------------------------------------------------- 1 | // pch.h: This is a precompiled header file. 2 | // Files listed below are compiled only once, improving build performance for future builds. 3 | // This also affects IntelliSense performance, including code completion and many code browsing features. 4 | // However, files listed here are ALL re-compiled if any one of them is updated between builds. 5 | // Do not add files here that you will be updating frequently as this negates the performance advantage. 6 | 7 | #ifndef PCH_H 8 | #define PCH_H 9 | 10 | // add headers that you want to pre-compile here 11 | #include "framework.h" 12 | 13 | #endif //PCH_H 14 | -------------------------------------------------------------------------------- /MK1Hook/unreal/FMatrix.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "FRotator.h" 3 | #include "FVector.h" 4 | #include "..\utils.h" 5 | 6 | struct FTransform { 7 | FVector Rotation; 8 | float pad0; 9 | FVector Translation; 10 | float pad1; 11 | FVector Scale3D; 12 | float pad2; 13 | }; 14 | 15 | 16 | class FMatrix { 17 | public: 18 | float M[4][4] = {}; 19 | 20 | FMatrix(); 21 | FMatrix(FRotator*); 22 | 23 | void MakeFromX(FVector* XAxis); 24 | void Rotator(FVector* result); 25 | 26 | FVector GetRight(); 27 | FVector GetForward(); 28 | FVector GetUp(); 29 | FVector GetPos(); 30 | }; 31 | 32 | FVector FindLookAtRotation(FVector* start, FVector* target); -------------------------------------------------------------------------------- /MK1Hook/unreal/SkeletalMesh.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "TArray.h" 3 | #include "FVector.h" 4 | #include "FQuat.h" 5 | #include "FName.h" 6 | #include "FMatrix.h" 7 | #include "..\utils.h" 8 | 9 | class USkeletalMesh { 10 | public: 11 | int GetNumBones(); 12 | }; 13 | 14 | class USkeletalMeshComponent { 15 | public: 16 | char pad[0x5B8]; 17 | USkeletalMesh* SkeletalMesh; 18 | void GetBoneMatrix(FMatrix* result, int id); 19 | void GetBoneMatrix(const wchar_t* name, FMatrix* result); 20 | void GetBoneLocation(const wchar_t* name, FVector* result); 21 | void GetBoneRotation(const wchar_t* name, FVector* result); 22 | 23 | void GetBoneName(FName* result, int id); 24 | 25 | int GetBoneIndexFromString(const wchar_t* BoneName); 26 | }; -------------------------------------------------------------------------------- /MK1Hook/utils/IniReader.h: -------------------------------------------------------------------------------- 1 | #ifndef INIREADER_H 2 | #define INIREADER_H 3 | class CIniReader 4 | { 5 | public: 6 | CIniReader(char* szFileName); 7 | int ReadInteger(char* szSection, char* szKey, int iDefaultValue); 8 | float ReadFloat(char* szSection, char* szKey, float fltDefaultValue); 9 | bool ReadBoolean(char* szSection, char* szKey, bool bolDefaultValue); 10 | char* ReadString(char* szSection, char* szKey, const char* szDefaultValue); 11 | void WriteInteger(char* szSection, char* szKey, int iValue); 12 | void WriteFloat(char* szSection, char* szKey, float fltValue); 13 | void WriteBoolean(char* szSection, char* szKey, bool bolValue); 14 | void WriteString(char* szSection, char* szKey, char* szValue); 15 | private: 16 | char m_szFileName[255]; 17 | }; 18 | #endif//INIREADER_H -------------------------------------------------------------------------------- /MK1Hook/unreal/FName.cpp: -------------------------------------------------------------------------------- 1 | #include "FName.h" 2 | 3 | FString* FName::ToString(FString* str) 4 | { 5 | static uintptr_t pat = _pattern(PATID_FName_ToString); 6 | if (pat) 7 | return ((FString * (__thiscall*)(FName*, FString*))pat)(this, str); 8 | 9 | return nullptr; 10 | } 11 | 12 | FName::FName() 13 | { 14 | Index = -1; 15 | Number = 0; 16 | } 17 | 18 | FName::FName(const char* Name, EFindName FindType, int formal) 19 | { 20 | static uintptr_t pat = _pattern(PATID_FName_FNameChar); 21 | if (pat) 22 | ((void(__fastcall*)(FName*, const char*, EFindName, int))pat)(this, Name, FindType, formal); 23 | } 24 | 25 | FName::FName(const wchar_t* Name, EFindName FindType, int formal) 26 | { 27 | static uintptr_t pat = _pattern(PATID_FName_FName); 28 | if (pat) 29 | ((void(__fastcall*)(FName*, const wchar_t*, EFindName, int))pat)(this, Name, FindType, formal); 30 | } 31 | -------------------------------------------------------------------------------- /MK1Hook/mk/FightingTeamDefinition.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../utils.h" 3 | 4 | 5 | #define TEAM_MAIN_OFFSET 8 6 | #define TEAM_PARTNER_OFFSET 600 7 | 8 | 9 | enum TEAM_INFO_MODE { 10 | MODE_SINGLE, 11 | MODE_KAMEO, 12 | MODE_TAG, 13 | TOTAL_TEAM_MODES 14 | }; 15 | 16 | 17 | class FightingTeamDefinition { 18 | public: 19 | char pad[80]; 20 | int teamID; 21 | 22 | void SetMode(TEAM_INFO_MODE mode); 23 | bool IsPartnerMode(); 24 | 25 | int64 GetDefinitions(); 26 | int64 GetClass(); 27 | 28 | static int64 GetKameoClass(); 29 | static int64 GetTagClass(); 30 | }; 31 | 32 | 33 | extern int64(*pTeamInfo_SetKameoMode)(FightingTeamDefinition*, bool); 34 | extern int64(*pTeamInfo_SetTagMode)(FightingTeamDefinition*, bool); 35 | extern int64(*pTeamInfo_SetSingleMode)(FightingTeamDefinition*, bool); 36 | 37 | 38 | extern int64(*pTeamInfo_GetKameoClass)(); 39 | extern int64(*pTeamInfo_GetTagClass)(); -------------------------------------------------------------------------------- /MK1Hook/mk/MKModifier.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../utils.h" 3 | #include "../unreal/FName.h" 4 | #include "../unreal/TArray.h" 5 | #include "../unreal/FString.h" 6 | #include "GameInfo.h" 7 | 8 | 9 | class BaseModifier { 10 | public: 11 | char _pad[104] = {}; 12 | }; 13 | VALIDATE_SIZE(BaseModifier, 104); 14 | 15 | class GlobalModifier : public BaseModifier { 16 | public: 17 | GlobalModifier(); 18 | GlobalModifier(FString name, float level = 1.0f); 19 | }; 20 | 21 | class TeamModifier : public BaseModifier { 22 | public: 23 | TeamModifier(); 24 | TeamModifier(FString name, float level = 1.0f); 25 | }; 26 | 27 | 28 | 29 | class MKModifier { 30 | public: 31 | static void ActivateModifier(int64 fightObject, const char* name); 32 | static void ActivateModifier(const char* name, PLAYER_NUM player); 33 | }; 34 | 35 | extern void(*pGlobalModifier_Constructor)(GlobalModifier*, wchar_t*, float); 36 | extern void(*pTeamModifier_Constructor)(TeamModifier*, wchar_t*, float); -------------------------------------------------------------------------------- /MK1Hook/helper/eMath.cpp: -------------------------------------------------------------------------------- 1 | #include "eMath.h" 2 | 3 | FVector eMath::quat2vec(FQuat q) 4 | { 5 | FVector result; 6 | 7 | float ysqr = q.Y * q.Y; 8 | 9 | float t0 = +2.0f * (q.W * q.X + q.Y * q.Z); 10 | float t1 = +1.0f - 2.0f * (q.X * q.X + ysqr); 11 | float roll = (float)atan2(t0, t1); 12 | 13 | float t2 = +2.0f * (q.W * q.Y - q.Z * q.X); 14 | t2 = ((t2 > 1.0f) ? 1.0f : t2); 15 | t2 = ((t2 < -1.0f) ? -1.0f : t2); 16 | 17 | float pitch = (float)asin(t2); 18 | float t3 = +2.0f * (q.W * q.Z + q.X * q.Y); 19 | float t4 = +1.0f - 2.0f * (ysqr + q.Z * q.Z); 20 | float yaw = (float)atan2(t3, t4); 21 | 22 | result.X = roll / M_PI * 180; 23 | result.Y = pitch / M_PI * 180; 24 | result.Z = yaw / M_PI * 180; 25 | return result; 26 | } 27 | 28 | bool eMath::areVecsEqual(FVector v1, FVector v2) 29 | { 30 | if (fabs(v1.X - v2.X) < 0.1f && 31 | (fabs(v1.Y - v2.Y) < 0.1f) && 32 | (fabs(v1.Z - v2.Z) < 0.1f)) 33 | return true; 34 | else 35 | return false; 36 | } 37 | -------------------------------------------------------------------------------- /MK1Hook/mk/GameInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "PlayerInfo.h" 3 | #include "FightingTeamDefinition.h" 4 | #include "..\utils.h" 5 | 6 | 7 | enum TEAM_NUM 8 | { 9 | TEAM1, 10 | TEAM2 11 | }; 12 | 13 | enum PLAYER_NUM 14 | { 15 | PLAYER1, 16 | PLAYER2, 17 | PLAYER3, 18 | PLAYER4, 19 | MAX_PLAYERS, 20 | }; 21 | 22 | enum eCharacterClass { 23 | Base = 1, 24 | Kameo = 2, 25 | Kitbash = 4, 26 | TOTAL_CHARACTER_CLASSES = 3, 27 | }; 28 | 29 | 30 | class FGGameInfo { 31 | public: 32 | static void FindGameInfo(); 33 | static uintptr_t pGameInfo; 34 | 35 | void Exec(char* line); 36 | void SetGameSpeed(float speed); 37 | 38 | PlayerInfo* GetInfo(PLAYER_NUM plr); 39 | int64 GetObj(PLAYER_NUM plr); 40 | 41 | int64 GetMissionInfo(); 42 | int64 GetMissionInfo_ptr(int64 missionInfo); 43 | 44 | FightingTeamDefinition* GetTeam(TEAM_NUM id); 45 | 46 | static void SetStage(int64 backgroundInfo, char* name); 47 | }; 48 | 49 | FGGameInfo* GetGameInfo(); 50 | 51 | 52 | -------------------------------------------------------------------------------- /MK1Hook/gui/log.cpp: -------------------------------------------------------------------------------- 1 | #include "log.h" 2 | #include 3 | #include 4 | #include 5 | 6 | wchar_t eLog::path[MAX_PATH]; 7 | 8 | void eLog::Initialize() 9 | { 10 | GetModuleFileNameW(NULL, path, MAX_PATH); 11 | 12 | wchar_t* end = wcsrchr(path, L'\\'); 13 | if (end) 14 | end[1] = 0x00; 15 | wcscat(path, LOGNAME); 16 | 17 | FILE* cls = _wfopen(path, L"w"); 18 | fclose(cls); 19 | FILE* log = _wfopen(path, L"a+"); 20 | time_t ttime = time(0); 21 | fprintf(log, "Logging Started - %s", ctime(&ttime)); 22 | fclose(log); 23 | } 24 | 25 | void eLog::Message(const char* function, const char* format, ...) 26 | { 27 | char msg[2048]; 28 | 29 | va_list args; 30 | va_start(args, format); 31 | vsprintf(msg, format, args); 32 | va_end(args); 33 | 34 | FILE* log = _wfopen(path, L"a+"); 35 | 36 | if (log) 37 | { 38 | fprintf(log, "%s | %s\n", function, msg); 39 | fclose(log); 40 | } 41 | 42 | printf("%s | %s\n", function, msg); 43 | } 44 | 45 | -------------------------------------------------------------------------------- /MK1Hook/mk/CharacterDefinition.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "..\utils.h" 3 | #include "Engine.h" 4 | #include "..\unreal\FName.h" 5 | 6 | #define AI_DATA_OFFSET 280 7 | 8 | struct CharacterContentDefinitionInfo { 9 | char pad[16]; 10 | FName path; 11 | char _pad[16]; 12 | FName skin; 13 | char __pad[528]; 14 | 15 | void Set(FString name, int type = 7); 16 | 17 | }; 18 | VALIDATE_SIZE(CharacterContentDefinitionInfo, 576); 19 | 20 | class CharacterDefinitionV2 { 21 | public: 22 | char pad[0xD0]; 23 | char _pad[16]; 24 | FName path; 25 | char __pad[16]; 26 | FName skin; 27 | FName extraMoveset; 28 | 29 | void Set(CharacterContentDefinitionInfo* info); 30 | void SetPartner(CharacterContentDefinitionInfo* info); 31 | 32 | void SetAIDrone(int mko, int level); 33 | int GetAIDroneLevel(); 34 | int GetAIDroneScript(); 35 | }; 36 | 37 | VALIDATE_OFFSET(CharacterDefinitionV2, path, 0xE0); 38 | VALIDATE_OFFSET(CharacterDefinitionV2, skin, 0xF8); 39 | VALIDATE_OFFSET(CharacterDefinitionV2, extraMoveset, 0x100); -------------------------------------------------------------------------------- /MK1Hook/mk/ContentDefinition.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "..\utils.h" 3 | #include "..\unreal\FName.h" 4 | 5 | struct MKSkeletalObjSoftPtr { 6 | char pad[16]; 7 | FName path; 8 | char _pad[16]; 9 | }; 10 | VALIDATE_SIZE(MKSkeletalObjSoftPtr, 40); 11 | 12 | class ContentDefinition { 13 | public: 14 | char _pad[0xA8]; 15 | TArray skins; 16 | }; 17 | 18 | 19 | class KameoContentDefinition { 20 | public: 21 | char _pad[0xA8]; 22 | TArray skins; 23 | }; 24 | 25 | 26 | // 27 | void ContentDefinition_Log(ContentDefinition* chr); 28 | void ContentDefinition_CacheForEasySwap(ContentDefinition* chr); 29 | void ContentDefinition_LoadHook(ContentDefinition* chr); 30 | 31 | void ContentDefinition_Load(ContentDefinition* chr, int64 a2); 32 | void KameoContentDefinition_Load(KameoContentDefinition* chr, int64 a2); 33 | 34 | 35 | extern void(*orgContentDefinition_Load)(ContentDefinition*, int64); 36 | extern void(*orgKameoContentDefinition_Load)(KameoContentDefinition*, int64); -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MK1Hook 2 | A plugin for Mortal Kombat 1. 3 | 4 | # Installation 5 | 6 | **MK1Hook was only tested with latest Steam version!** 7 | 8 | You can download binary files from [Releases](https://github.com/ermaccer/MK1Hook/releases) page. Extract **mk1hook.zip** 9 | to MK12\Binaries\Win64 folder of Mortal Kombat 1 (so that **dsound.dll** ends up near **SDL2.dll**). 10 | 11 | If you are not sure how to find your Mortal Kombat 1 folder, search for it in your Steam library then right click on the entry and select Manage->Browse local files. 12 | 13 | # Usage 14 | 15 | If installed correctly, a notification will appear informing that the plugin was installed 16 | and is ready to use. By default **F1** will open or close in-game menu. 17 | 18 | ![Preview](https://raw.githubusercontent.com/ermaccer/ermaccer.github.io/gh-pages/assets/mods/mk1/mk1hook/menu.jpg) 19 | 20 | 21 | # Issues 22 | 23 | - Changing game resolution will freeze the game with hook installed, ideally install the mod after setting game up. 24 | 25 | 26 | Read more on https://ermaccer.github.io/posts/mk1hook/ -------------------------------------------------------------------------------- /MK1Hook/mk/MKCamera.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../utils.h" 3 | #include "../unreal/FMatrix.h" 4 | #include "Engine.h" 5 | 6 | 7 | struct FMinimalViewInfo 8 | { 9 | FVector Location; 10 | FVector Rotation; 11 | float FOV; 12 | 13 | float DesiredFOV; 14 | float OrthoWidth; 15 | float OrthoNearClipPlane; 16 | float AspectRatio; 17 | unsigned __int32 bConstrainAspectRatio : 1; 18 | unsigned __int32 bUseFieldOfViewForLOD : 1; 19 | }; 20 | 21 | 22 | struct FCameraCacheEntry { 23 | float TimeStamp; 24 | char pad[12]; 25 | FMinimalViewInfo POV; 26 | }; 27 | 28 | 29 | 30 | class MKCamera { 31 | public: 32 | char pad[0x248]; 33 | int64 PCOwner; 34 | int64 TransformComponent; 35 | int CameraStyle[2]; 36 | float DefaultFOV; 37 | float LockedFOV; 38 | char _pad[6392]; 39 | FCameraCacheEntry CameraCache; 40 | void FillCameraCache(FMinimalViewInfo* NewInfo); 41 | void HookedFillCameraCache(FMinimalViewInfo* NewInfo); 42 | 43 | FMatrix GetMatrix(); 44 | }; 45 | VALIDATE_OFFSET(MKCamera, PCOwner, 0x248); 46 | VALIDATE_OFFSET(MKCamera, CameraCache, 0x1B60); 47 | 48 | extern MKCamera* TheCamera; -------------------------------------------------------------------------------- /MK1Hook/steam/OAuthCommon.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef OAUTHCOMMON_H 18 | #define OAUTHCOMMON_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | 24 | #define STEAMOAUTH_INTERFACE_VERSION_001 "SteamOAuth001" 25 | 26 | 27 | #endif // OAUTHCOMMON_H 28 | -------------------------------------------------------------------------------- /MK1Hook/steam/SteamSalt.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef STEAMSALT_H 18 | #define STEAMSALT_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | typedef struct SteamSalt 24 | { 25 | unsigned char uchSalt[STEAM_SALT_SIZE]; 26 | } SteamSalt_t; 27 | 28 | #endif // STEAMSALT_H 29 | -------------------------------------------------------------------------------- /MK1Hook/mk/MKCharacter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "PlayerInfo.h" 3 | #include "CharacterDefinition.h" 4 | #include "GameInfo.h" 5 | #include "MKScript.h" 6 | #include "MKObject.h" 7 | 8 | #include "..\unreal\SkeletalMesh.h" 9 | #include "..\unreal\FRotator.h" 10 | #include "..\unreal\FVector.h" 11 | #include "..\utils.h" 12 | 13 | #include "..\plugin\Hooks.h" 14 | 15 | class MKCharacterActor : public MKObject { 16 | public: 17 | USkeletalMeshComponent* GetSkeleton(); 18 | USkeletalMeshComponent* GetHead(); 19 | }; 20 | 21 | 22 | class MKCharacter : public MKObject { 23 | public: 24 | void SetLife(float life); 25 | void SetScale(FVector* scale); 26 | void SetSpeed(float speed); 27 | void SetFlag(int offset, bool status); 28 | 29 | void SetFastUppercutRecovery(bool enable); 30 | void SetXRayInfinite(bool enable); 31 | void SetXRayNoRequirement(bool enable); 32 | void SetEasyBrutalities(bool enable); 33 | 34 | void ExecuteScript(MKScript* script, unsigned int function); 35 | void ExecuteSpecialMove(int64 powerAttackDef); 36 | void ExecuteScriptDataFunction(int64 scriptDataFunction); 37 | 38 | AIDrone* GetDrone(); 39 | 40 | 41 | int64 GetFlags(); 42 | 43 | 44 | int GetFlagsOffset(); 45 | }; 46 | 47 | 48 | -------------------------------------------------------------------------------- /MK1Hook/steam/AppTicketCommon.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef APPTICKETCOMMON_H 18 | #define APPTICKETCOMMON_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #define STEAMAPPTICKET_INTERFACE_VERSION_001 "STEAMAPPTICKET_INTERFACE_VERSION001" 24 | 25 | #endif // APPTICKETCOMMON_H 26 | -------------------------------------------------------------------------------- /MK1Hook/plugin/Settings.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | struct eMouseSettings { 5 | int sens; 6 | bool invert_y; 7 | bool invert_x; 8 | }; 9 | 10 | class eSettingsManager { 11 | public: 12 | eSettingsManager(); 13 | 14 | bool bEnableConsoleWindow; 15 | bool bUseInvasionsCH15Characters; 16 | 17 | bool bEnableGamepadSupport; 18 | 19 | 20 | // generic 21 | int iHookMenuOpenKey; 22 | int iToggleCustomCamKey; 23 | int iToggleSlowMoKey = VK_F5; 24 | int iToggleFreezeWorldKey = VK_F2; 25 | int iToggleFreeCameraKey; 26 | int iToggleHUDKey; 27 | // free camera keys 28 | int iFreeCameraKeyForward; 29 | int iFreeCameraKeyBackward; 30 | int iFreeCameraKeyLeft; 31 | int iFreeCameraKeyRight; 32 | int iFreeCameraKeyUp; 33 | int iFreeCameraKeyDown; 34 | 35 | 36 | int iFreeCameraKeyYawPlus; 37 | int iFreeCameraKeyYawMinus; 38 | 39 | int iFreeCameraKeyPitchPlus; 40 | int iFreeCameraKeyPitchMinus; 41 | 42 | int iFreeCameraKeyRollMinus; 43 | int iFreeCameraKeyRollPlus; 44 | 45 | 46 | 47 | int iFreeCameraKeyFOVPlus; 48 | int iFreeCameraKeyFOVMinus; 49 | 50 | eMouseSettings mouse; 51 | 52 | float fMenuScale; 53 | 54 | void SaveSettings(); 55 | void ResetKeys(); 56 | }; 57 | 58 | extern eSettingsManager* SettingsMgr; -------------------------------------------------------------------------------- /MK1Hook/steam/ESteamBufferMethod.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ESTEAMBUFFERMETHOD_H 18 | #define ESTEAMBUFFERMETHOD_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | typedef enum ESteamBufferMethod 24 | { 25 | eSteamBufferMethodFBF = 0, 26 | eSteamBufferMethodNBF = 1 27 | } ESteamBufferMethod; 28 | 29 | #endif // ESTEAMBUFFERMETHOD_H 30 | 31 | -------------------------------------------------------------------------------- /MK1Hook/steam/BridgeCommon.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef BRIDGECOMMON_H 18 | #define BRIDGECOMMON_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #define STEAM2BRIDGE_INTERFACE_VERSION_001 "STEAM2BRIDGE_INTERFACE_VERSION001" 24 | #define STEAM2BRIDGE_INTERFACE_VERSION_002 "STEAM2BRIDGE_INTERFACE_VERSION002" 25 | 26 | #endif // BRIDGECOMMON_H 27 | -------------------------------------------------------------------------------- /MK1Hook/steam/TSteamOfflineStatus.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef TSTEAMOFFLINESTATUS_H 18 | #define TSTEAMOFFLINESTATUS_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | 24 | typedef struct TSteamOfflineStatus 25 | { 26 | int eOfflineNow; 27 | int eOfflineNextSession; 28 | } TSteamOfflineStatus; 29 | 30 | 31 | #endif // TSTEAMOFFLINESTATUS_H 32 | -------------------------------------------------------------------------------- /MK1Hook/steam/TSteamUpdateStats.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef TSTEAMUPDATESTATS_H 18 | #define TSTEAMUPDATESTATS_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | typedef struct TSteamUpdateStats 24 | { 25 | SteamUnsigned64_t uBytesTotal; 26 | SteamUnsigned64_t uBytesPresent; 27 | 28 | } TSteamUpdateStats; 29 | 30 | 31 | #endif // TSTEAMUPDATESTATS_H 32 | -------------------------------------------------------------------------------- /MK1Hook/plugin/PluginInterface.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | #define PROJECT_NAME "MK12HOOK" 7 | 8 | class PluginInfo { 9 | private: 10 | HMODULE hModule; 11 | char szPluginName[128]; 12 | char szPluginProject[128]; 13 | char szPluginTabName[128]; 14 | 15 | public: 16 | const char* (*pluginGetPluginName)(void) = nullptr; 17 | const char* (*pluginGetPluginProject)(void) = nullptr; 18 | const char* (*pluginGetPluginTabName)(void) = nullptr; 19 | void (*pluginOnFrameTick)(void) = nullptr; 20 | void (*pluginOnInitialize)() = nullptr; 21 | void (*pluginOnFightStartup)(void) = nullptr; 22 | void (*pluginOnShutdown)(void) = nullptr; 23 | void (*pluginTabFunction)(void) = nullptr; 24 | 25 | 26 | const char* GetPluginName(); 27 | const char* GetPluginTabName(); 28 | const char* GetPluginProject(); 29 | 30 | bool Load(wchar_t* path); 31 | void Unload(); 32 | }; 33 | 34 | 35 | 36 | class PluginInterface { 37 | public: 38 | static std::vector plugins; 39 | 40 | static void ScanFolder(wchar_t* path); 41 | static void LoadPlugins(); 42 | static void UnloadPlugins(); 43 | 44 | static void OnFrameTick(); 45 | static void OnFightStartup(); 46 | 47 | static void ProcessPluginTabs(); 48 | 49 | static int GetNumPlugins(); 50 | }; -------------------------------------------------------------------------------- /MK1Hook/steam/ESteamSeekMethod.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ESTEAMSEEKMETHOD_H 18 | #define ESTEAMSEEKMETHOD_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | 24 | typedef enum ESteamSeekMethod 25 | { 26 | eSteamSeekMethodSet = 0, 27 | eSteamSeekMethodCur = 1, 28 | eSteamSeekMethodEnd = 2 29 | } ESteamSeekMethod; 30 | 31 | 32 | #endif // ESTEAMSEEKMETHOD_H 33 | -------------------------------------------------------------------------------- /MK1Hook/steam/SteamAPI.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | 18 | #ifndef STEAMAPI_H 19 | #define STEAMAPI_H 20 | #ifdef _WIN32 21 | #pragma once 22 | #endif 23 | 24 | 25 | // includes 26 | #include "SteamTypes.h" 27 | 28 | // extern function declarations 29 | #include "Steam.h" 30 | 31 | 32 | // inline interface utils 33 | #include "Interface_OSW.h" 34 | 35 | 36 | 37 | #endif // STEAMAPI_H 38 | -------------------------------------------------------------------------------- /MK1Hook/steam/TSteamAppVersion.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef TSTEAMAPPVERSION_H 18 | #define TSTEAMAPPVERSION_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | typedef struct TSteamAppVersion 24 | { 25 | char *szLabel; 26 | unsigned int uMaxLabelChars; 27 | unsigned int uVersionId; 28 | int bIsNotAvailable; 29 | } TSteamAppVersion; 30 | 31 | #endif // TSTEAMAPPVERSION_H 32 | -------------------------------------------------------------------------------- /MK1Hook/steam/SteamclientAPI.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | 18 | #ifndef STEAMCLIENTAPI_H 19 | #define STEAMCLIENTAPI_H 20 | #ifdef _WIN32 21 | #pragma once 22 | #endif 23 | 24 | 25 | // includes 26 | #include "SteamTypes.h" 27 | 28 | // extern function declarations 29 | #include "Steamclient.h" 30 | 31 | // inline interface utils 32 | #include "Interface_OSW.h" 33 | 34 | 35 | 36 | #endif // STEAMCLIENTAPI_H 37 | -------------------------------------------------------------------------------- /MK1Hook/steam/Steamworks.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef STEAMWORKS_H 18 | #define STEAMWORKS_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #include "SteamTypes.h" 24 | 25 | #ifndef NO_STEAM 26 | // steam.dll 27 | #include "SteamAPI.h" 28 | #endif 29 | 30 | #ifndef NO_STEAMCLIENT 31 | // steamclient.dll / steam_api.dll 32 | #include "SteamclientAPI.h" 33 | #endif 34 | 35 | #endif // STEAMWORKS_H 36 | -------------------------------------------------------------------------------- /MK1Hook/steam/TSteamAppDependencyInfo.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef TSTEAMAPPDEPENDENCYINFO_H 18 | #define TSTEAMAPPDEPENDENCYINFO_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | typedef struct TSteamAppDependencyInfo 24 | { 25 | unsigned int AppId; 26 | unsigned int IsRequired; 27 | char szMountName[STEAM_MAX_PATH]; 28 | } TSteamAppDependencyInfo; 29 | 30 | 31 | #endif // TSTEAMAPPDEPENDENCYINFO_H 32 | -------------------------------------------------------------------------------- /MK1Hook/steam/TSteamSubscriptionStats.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef TSTEAMSUBSCRIPTIONSTATS_H 18 | #define TSTEAMSUBSCRIPTIONSTATS_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | typedef struct TSteamSubscriptionStats 24 | { 25 | unsigned int uNumSubscriptions; 26 | unsigned int uMaxNameChars; 27 | unsigned int uMaxApps; 28 | 29 | } TSteamSubscriptionStats; 30 | 31 | #endif // TSTEAMSUBSCRIPTIONSTATS_H 32 | -------------------------------------------------------------------------------- /MK1Hook/mk/CharacterDefinition.cpp: -------------------------------------------------------------------------------- 1 | #include "CharacterDefinition.h" 2 | #include "..\plugin\Menu.h" 3 | 4 | void CharacterDefinitionV2::Set(CharacterContentDefinitionInfo* info) 5 | { 6 | static uintptr_t pat = _pattern(PATID_CharacterDefinition_Set); 7 | if (pat) 8 | ((void(__fastcall*)(CharacterDefinitionV2*, CharacterContentDefinitionInfo*))pat)(this, info); 9 | } 10 | 11 | void CharacterDefinitionV2::SetPartner(CharacterContentDefinitionInfo* info) 12 | { 13 | static uintptr_t pat = _pattern(PATID_CharacterDefinition_SetPartner); 14 | if (pat) 15 | ((void(__fastcall*)(CharacterDefinitionV2*, CharacterContentDefinitionInfo*))pat)(this, info); 16 | } 17 | 18 | void CharacterDefinitionV2::SetAIDrone(int mko, int level) 19 | { 20 | *(char*)((int64)this + AI_DATA_OFFSET) = mko; 21 | *(char*)((int64)this + AI_DATA_OFFSET + 1) = level; 22 | } 23 | 24 | int CharacterDefinitionV2::GetAIDroneLevel() 25 | { 26 | return *(char*)((int64)this + AI_DATA_OFFSET + 1); 27 | } 28 | 29 | int CharacterDefinitionV2::GetAIDroneScript() 30 | { 31 | return *(char*)((int64)this + AI_DATA_OFFSET); 32 | } 33 | 34 | void CharacterContentDefinitionInfo::Set(FString name, int type) 35 | { 36 | static uintptr_t pat = _pattern(PATID_CharacterContentDefinition_Get); 37 | if (pat) 38 | ((void(__thiscall*)(CharacterContentDefinitionInfo*, FString, int))pat)(this, name, type); 39 | } -------------------------------------------------------------------------------- /MK1Hook/steam/TSteamDiscountQualifier.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef TSTEAMDISCOUNTQUALIFIER_H 18 | #define TSTEAMDISCOUNTQUALIFIER_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | typedef struct TSteamDiscountQualifier 24 | { 25 | char szName[STEAM_MAX_PATH]; 26 | unsigned int uRequiredSubscription; 27 | int bIsDisqualifier; 28 | } TSteamDiscountQualifier; 29 | 30 | 31 | #endif // TSTEAMDISCOUNTQUALIFIER_H 32 | -------------------------------------------------------------------------------- /MK1Hook/steam/TSteamPrepurchaseReceiptInfo.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef TSTEAMPREPURCHASERECEIPTINFO_H 18 | #define TSTEAMPREPURCHASERECEIPTINFO_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | typedef struct TSteamPrepurchaseReceiptInfo 24 | { 25 | char szTypeOfProofOfPurchase[ STEAM_TYPE_OF_PROOF_OF_PURCHASE_SIZE + 1]; 26 | } TSteamPrepurchaseReceiptInfo; 27 | 28 | 29 | #endif // TSTEAMPREPURCHASERECEIPTINFO_H 30 | -------------------------------------------------------------------------------- /MK1Hook/plugin/Hooks.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "..\mk\Engine.h" 3 | #include "..\mk\MKCharacter.h" 4 | #include "..\mk\CharacterDefinition.h" 5 | #include "..\mk\MKModifier.h" 6 | #include "Menu.h" 7 | #include "..\gui\notifications.h" 8 | #include "..\helper\eMouse.h" 9 | #include "..\helper\eGamepadManager.h" 10 | #include "PluginInterface.h" 11 | 12 | extern void(__fastcall* pProcessPostProcessSettings)(int64, int64, float); 13 | extern void(__fastcall* orgFightStartup)(int64); 14 | extern void(*orgLoadMainMenuBGND)(int64 bgndInfo, FName name); 15 | extern void(*pSetPartnerCharacter)(int64, FString, int, int); 16 | 17 | 18 | 19 | void ProcessPostProcessSettings(int64 settings, int64 newSettings, float a3); 20 | 21 | void PluginDispatch(); 22 | void PluginFightStartup(int64 ptr); 23 | void PluginFightStartupSkipDialogue(int64 ptr); 24 | void PluginFightStartupAddModifiers(int64 ptr); 25 | void PluginFightStartupTeamModeChange(); 26 | void PluginFightStartupCacheLoadedCharacters(); 27 | void PluginOnJump(char* mkoName); 28 | 29 | void USceneComponent_SetRelativeScale3D(int64 obj, FVector* scale); 30 | 31 | void FightStartup_Hook(int64 ptr); 32 | void LoadMainMenuBGND_Hook(int64 bgndInfo, FName name); 33 | void SetPartnerCharacter_Hook(int64 ptr, FString name, int plrNum, int flag); 34 | 35 | extern void (*orgUSceneComponent_SetWorldScale3D)(int64 obj, FVector* scale); -------------------------------------------------------------------------------- /MK1Hook/steam/ESteamPaymentCardType.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ESTEAMPAYMENTCARDTYPE_H 18 | #define ESTEAMPAYMENTCARDTYPE_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | typedef enum ESteamPaymentCardType 24 | { 25 | eVisa = 1, 26 | eMaster = 2, 27 | eAmericanExpress = 3, 28 | eDiscover = 4, 29 | eDinnersClub = 5, 30 | eJCB = 6, 31 | } ESteamPaymentCardType; 32 | 33 | #endif // ESTEAMPAYMENTCARDTYPE_H 34 | -------------------------------------------------------------------------------- /MK1Hook/steam/TSteamSubscriptionDiscount.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef TSTEAMSUBSCRIPTIONDISCOUNT_H 18 | #define TSTEAMSUBSCRIPTIONDISCOUNT_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | typedef struct TSteamSubscriptionDiscount 24 | { 25 | char szName[STEAM_MAX_PATH]; 26 | unsigned int uDiscountInCents; 27 | unsigned int uNumQualifiers; 28 | } TSteamSubscriptionDiscount; 29 | 30 | #endif // TSTEAMSUBSCRIPTIONDISCOUNT_H 31 | -------------------------------------------------------------------------------- /MK1Hook/steam/MusicCommon.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef MUSICCOMMON_H 18 | #define MUSICCOMMON_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | enum AudioPlayback_Status 24 | { 25 | AudioPlayback_Undefined = 0, 26 | AudioPlayback_Playing = 1, 27 | AudioPlayback_Paused = 2, 28 | AudioPlayback_Idle = 3 29 | }; 30 | 31 | #define STEAMMUSIC_INTERFACE_VERSION_001 "STEAMMUSIC_INTERFACE_VERSION001" 32 | 33 | #endif // MUSICCOMMON_H 34 | -------------------------------------------------------------------------------- /MK1Hook/steam/TSteamExternalBillingInfo.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef TSTEAMEXTERNALBILLINGINFO_H 18 | #define TSTEAMEXTERNALBILLINGINFO_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | typedef struct TSteamExternalBillingInfo 24 | { 25 | char szAccountName[ STEAM_EXTERNAL_ACCOUNTNAME_SIZE + 1 ]; 26 | char szPassword[ STEAM_EXTERNAL_ACCOUNTPASSWORD_SIZE + 1 ]; 27 | } TSteamExternalBillingInfo; 28 | 29 | #endif // TSTEAMEXTERNALBILLINGINFO_H 30 | -------------------------------------------------------------------------------- /MK1Hook/steam/TSteamProgress.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef TSTEAMPROGRESS_H 18 | #define TSTEAMPROGRESS_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | typedef struct TSteamProgress 24 | { 25 | int bValid; // non-zero if call provides progress info 26 | unsigned int uPercentDone; // 0 to 100 if bValid 27 | char szProgress[ STEAM_MAX_PATH ]; // additional progress info 28 | } TSteamProgress; 29 | 30 | #endif // TSTEAMPROGRESS_H 31 | -------------------------------------------------------------------------------- /MK1Hook/steam/FriendGameInfo.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef FRIENDGAMEINFO_H 18 | #define FRIENDGAMEINFO_H 19 | #ifndef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #pragma pack( push, 8 ) 24 | 25 | // friend game played information 26 | struct FriendGameInfo_t 27 | { 28 | CGameID m_gameID; 29 | uint32 m_unGameIP; 30 | uint16 m_usGamePort; 31 | uint16 m_usQueryPort; 32 | CSteamID m_steamIDLobby; 33 | }; 34 | 35 | #pragma pack( pop ) 36 | 37 | 38 | #endif // FRIENDGAMEINFO_H 39 | -------------------------------------------------------------------------------- /MK1Hook/steam/IClientStreamLauncher.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ICLIENTSTREAMLAUNCHER_H 18 | #define ICLIENTSTREAMLAUNCHER_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #include "SteamTypes.h" 24 | #include "StreamLauncherCommon.h" 25 | 26 | abstract_class UNSAFE_INTERFACE IClientStreamLauncher 27 | { 28 | public: 29 | virtual EStreamLauncherResult StartStreaming( const char *cszFilePath ) = 0; 30 | virtual void StopStreaming() = 0; 31 | }; 32 | 33 | #endif // ICLIENTSTREAMLAUNCHER_H 34 | -------------------------------------------------------------------------------- /MK1Hook/steam/ISteamStreamLauncher001.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ISTEAMSTREAMLAUNCHER001_H 18 | #define ISTEAMSTREAMLAUNCHER001_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #include "SteamTypes.h" 24 | #include "StreamLauncherCommon.h" 25 | 26 | abstract_class ISteamStreamLauncher001 27 | { 28 | public: 29 | virtual EStreamLauncherResult StartStreaming( const char *cszFilePath ) = 0; 30 | virtual void StopStreaming() = 0; 31 | }; 32 | 33 | #endif // ISTEAMSTREAMLAUNCHER001_H 34 | 35 | -------------------------------------------------------------------------------- /MK1Hook/steam/ESteamServerType.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ESTEAMSERVERTYPE_H 18 | #define ESTEAMSERVERTYPE_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | typedef enum ESteamServerType 24 | { 25 | eSteamValveCDKeyValidationServer = 0, 26 | eSteamHalfLifeMasterServer = 1, 27 | eSteamFriendsServer = 2, 28 | eSteamCSERServer = 3, 29 | eSteamHalfLife2MasterServer = 4, 30 | eSteamRDKFMasterServer = 5, 31 | eMaxServerTypes = 6, 32 | } ESteamServerType; 33 | 34 | #endif // ESTEAMSERVERTYPE_H 35 | -------------------------------------------------------------------------------- /MK1Hook/steam/ESteamAppUpdateStatsQueryType.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ESTEAMAPPUPDATESTATSQUERYTYPE_H 18 | #define ESTEAMAPPUPDATESTATSQUERYTYPE_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | typedef enum ESteamAppUpdateStatsQueryType 24 | { 25 | ePhysicalBytesReceivedThisSession = 1, 26 | eAppReadyToLaunchStatus = 2, 27 | eAppPreloadStatus = 3, 28 | eAppEntireDepot = 4, 29 | eCacheBytesPresent = 5, 30 | } ESteamAppUpdateStatsQueryType; 31 | 32 | #endif // ESTEAMAPPUPDATESTATSQUERYTYPE_H 33 | -------------------------------------------------------------------------------- /MK1Hook/steam/ESteamFindFilter.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ESTEAMFINDFILTER_H 18 | #define ESTEAMFINDFILTER_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | typedef enum ESteamFindFilter /* Filter elements returned by SteamFind{First,Next} */ 24 | { 25 | eSteamFindLocalOnly, /* limit search to local filesystem */ 26 | eSteamFindRemoteOnly, /* limit search to remote repository */ 27 | eSteamFindAll /* do not limit search (duplicates allowed) */ 28 | } ESteamFindFilter; 29 | 30 | #endif // ESTEAMFINDFILTER_H 31 | -------------------------------------------------------------------------------- /MK1Hook/steam/MasterServerUpdaterCommon.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef MASTERSERVERUPDATERCOMMON_H 18 | #define MASTERSERVERUPDATERCOMMON_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #define CLIENTMASTERSERVERUPDATER_INTERFACE_VERSION "CLIENTMASTERSERVERUPDATER_INTERFACE_VERSION001" 24 | 25 | #define STEAMMASTERSERVERUPDATER_INTERFACE_VERSION_001 "SteamMasterServerUpdater001" 26 | 27 | 28 | 29 | #define MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE ((uint16)-1) 30 | 31 | 32 | 33 | #endif // MASTERSERVERUPDATERCOMMON_H 34 | -------------------------------------------------------------------------------- /MK1Hook/steam/UnifiedMessagesCommon.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef UNIFIEDMESSAGESCOMMON_H 18 | #define UNIFIEDMESSAGESCOMMON_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | 24 | // versions 25 | #define CLIENTUNIFIEDMESSAGES_INTERFACE_VERSION "CLIENTUNIFIEDMESSAGES_INTERFACE_VERSION001" 26 | #define STEAMUNIFIEDMESSAGES_INTERFACE_VERSION_001 "STEAMUNIFIEDMESSAGES_INTERFACE_VERSION001" 27 | 28 | 29 | // callbacks 30 | #pragma pack( push, 8 ) 31 | 32 | 33 | #pragma pack( pop ) 34 | 35 | 36 | #endif // UNIFIEDMESSAGESCOMMON_H 37 | -------------------------------------------------------------------------------- /MK1Hook/mk/PlayerInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "PlayerInfo.h" 2 | 3 | void PlayerInfo::AdjustMeter(float value) 4 | { 5 | static uintptr_t pat = _pattern(PATID_PlayerInfo_AdjustMeter); 6 | if (pat) 7 | ((void(__fastcall*)(PlayerInfo*, float, bool, bool))pat)(this, value, 1, 0); 8 | } 9 | 10 | void PlayerInfo::SetMeter(float value) 11 | { 12 | // wrapper cuz set meter is either inlined or gone 13 | AdjustMeter(value); 14 | } 15 | 16 | void PlayerInfo::SetDamageMult(float value) 17 | { 18 | *(float*)((int64)this + 216) = value; 19 | } 20 | 21 | AIDrone* PlayerInfo::GetDrone() 22 | { 23 | static uintptr_t pat = _pattern(PATID_PlayerInfo_GetDrone); 24 | if (pat) 25 | return ((AIDrone * (__fastcall*)(PlayerInfo*))pat)(this); 26 | return nullptr; 27 | } 28 | 29 | int AIDrone::GetDroneLevel() 30 | { 31 | static uintptr_t pat = _pattern(PATID_AIDrone_GetLevel); 32 | if (pat) 33 | return ((int(__fastcall*)(AIDrone*))pat)(this); 34 | return 0; 35 | } 36 | 37 | void AIDrone::Set(const char* script) 38 | { 39 | static uintptr_t pat = _pattern(PATID_AIDrone_Set); 40 | if (pat) 41 | ((void(__fastcall*)(AIDrone*, int))pat)(this, ScriptToID(script)); 42 | } 43 | int AIDrone::ScriptToID(const char* script) 44 | { 45 | if (strcmp(script, "AIButtonMasher.mko") == 0) 46 | return 1; 47 | if (strcmp(script, "AIDummy.mko") == 0) 48 | return 5; 49 | if (strcmp(script, "AINormal.mko") == 0) 50 | return 4; 51 | if (strcmp(script, "AIVerifier.mko") == 0) 52 | return 6; 53 | 54 | return 0; 55 | } 56 | -------------------------------------------------------------------------------- /MK1Hook/helper/eMouse.cpp: -------------------------------------------------------------------------------- 1 | #include "eMouse.h" 2 | #include 3 | #include 4 | #include "../gui/gui_impl.h" 5 | #include "../plugin/Menu.h" 6 | #include "../plugin/Settings.h" 7 | 8 | 9 | eMouse eMouse::mouse; 10 | 11 | eMouse::eMouse() 12 | { 13 | Clear(); 14 | } 15 | 16 | void eMouse::Clear() 17 | { 18 | x = 0; 19 | y = 0; 20 | deltaX = 0; 21 | deltaY = 0; 22 | gotDelta = false; 23 | } 24 | 25 | void eMouse::UpdateMouse() 26 | { 27 | if (!TheMenu->m_bIsActive && TheMenu->m_bMouseControl && TheMenu->m_bIsFocused) 28 | { 29 | mouse.Clear(); 30 | POINT point; 31 | GetCursorPos(&point); 32 | 33 | if (!mouse.gotDelta) 34 | { 35 | eMouse::LockMouse(); 36 | mouse.gotDelta = true; 37 | } 38 | 39 | POINT center; 40 | GetCursorPos(¢er); 41 | 42 | mouse.deltaX = point.x - center.x; 43 | mouse.deltaY = point.y - center.y; 44 | mouse.deltaX *= SettingsMgr->mouse.sens; 45 | mouse.deltaY *= SettingsMgr->mouse.sens; 46 | mouse.gotDelta = false; 47 | } 48 | } 49 | 50 | 51 | int eMouse::GetDeltaX() 52 | { 53 | return SettingsMgr->mouse.invert_x ? -mouse.deltaX : mouse.deltaX; 54 | } 55 | 56 | int eMouse::GetDeltaY() 57 | { 58 | return SettingsMgr->mouse.invert_y ? mouse.deltaY : -mouse.deltaY; 59 | } 60 | 61 | void eMouse::LockMouse() 62 | { 63 | if (GUIImplementation::ms_hWindow) 64 | { 65 | RECT rect; 66 | GetWindowRect(GUIImplementation::ms_hWindow, &rect); 67 | 68 | SetCursorPos(rect.right / 2, rect.bottom / 2); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /MK1Hook/steam/TSteamAppLaunchOption.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef TSTEAMAPPLAUNCHOPTION_H 18 | #define TSTEAMAPPLAUNCHOPTION_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | typedef struct TSteamAppLaunchOption 24 | { 25 | char *szDesc; 26 | unsigned int uMaxDescChars; 27 | char *szCmdLine; 28 | unsigned int uMaxCmdLineChars; 29 | unsigned int uIndex; 30 | unsigned int uIconIndex; 31 | int bNoDesktopShortcut; 32 | int bNoStartMenuShortcut; 33 | int bIsLongRunningUnattended; 34 | 35 | } TSteamAppLaunchOption; 36 | 37 | #endif // TSTEAMAPPLAUNCHOPTION_H 38 | -------------------------------------------------------------------------------- /SamplePlugin/SDK.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | typedef __int64 MKCharacter; 4 | typedef __int64 PlayerInfo; 5 | typedef __int64 FGGameInfo; 6 | 7 | enum PLAYER_NUM 8 | { 9 | PLAYER1, 10 | PLAYER2, 11 | PLAYER3, 12 | PLAYER4, 13 | MAX_PLAYERS, 14 | }; 15 | 16 | #include 17 | 18 | class MK12HOOKSDK { 19 | public: 20 | static MKCharacter* (*GetCharacterObject)(PLAYER_NUM); 21 | static PlayerInfo* (*GetPlayerInfo)(PLAYER_NUM); 22 | static FGGameInfo* (*GetGameInfo)(void); 23 | static bool (*IsMenuActive)(void); 24 | static bool (*ImGui_Checkbox)(const char*, bool*); 25 | static void (*ImGui_Text)(const char*); 26 | static bool (*ImGui_Button)(const char*); 27 | static bool (*ImGui_InputInt)(const char*, int*); 28 | static bool (*ImGui_InputFloat)(const char*, float*); 29 | static bool (*ImGui_InputText)(const char*, char*, size_t); 30 | static bool (*ImGui_BeginCombo)(const char*, const char*); 31 | static void (*ImGui_EndCombo)(); 32 | static bool (*ImGui_Selectable)(const char*, bool); 33 | static void (*ImGui_SetItemDefaultFocus)(); 34 | static void (*ImGui_Separator)(); 35 | static bool (*ImGui_CollapsingHeader)(const char*); 36 | static bool (*ImGui_ColorEdit4)(const char*, float*); 37 | static uintptr_t(*GetPattern)(const char*, int); 38 | static int (*CreateHook)(LPVOID, LPVOID, LPVOID*); 39 | static void (*PushNotif)(int, const char*); 40 | static const char* (*GetVersion)(); 41 | 42 | static bool ms_bIsInitialized; 43 | static void Initialize(); 44 | static bool IsOK(); 45 | }; -------------------------------------------------------------------------------- /MK1Hook/steam/EVoiceResult.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef EVOICERESULT_H 18 | #define EVOICERESULT_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | 24 | // Error codes for use with the voice functions 25 | typedef enum EVoiceResult 26 | { 27 | k_EVoiceResultOK = 0, 28 | k_EVoiceResultNotInitialized = 1, 29 | k_EVoiceResultNotRecording = 2, 30 | k_EVoiceResultNoData = 3, 31 | k_EVoiceResultBufferTooSmall = 4, 32 | k_EVoiceResultDataCorrupted = 5, 33 | k_EVoiceResultRestricted = 6, 34 | k_EVoiceResultUnsupportedCodec = 7, 35 | } EVoiceResult; 36 | 37 | #endif // EVOICERESULT_H 38 | -------------------------------------------------------------------------------- /MK1Hook/steam/ISteamOAuth001.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ISTEAMOAUTH001_H 18 | #define ISTEAMOAUTH001_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #include "SteamTypes.h" 24 | #include "OAuthCommon.h" 25 | 26 | 27 | abstract_class OBSOLETE_INTERFACE ISteamOAuth001 28 | { 29 | public: 30 | virtual SteamAPICall_t RequestOAuthTokenForApp( const char *cszOAuthScope ) = 0; 31 | virtual bool GetOAuthTokenForApp( void *pubBuffer, int32 cubBuffer, uint32 *puTokenSize ) = 0; 32 | virtual void InvalidateOAuthTokenForApp() = 0; 33 | }; 34 | 35 | 36 | #endif // ISTEAMOAUTH001_H 37 | 38 | -------------------------------------------------------------------------------- /MK1Hook/steam/ISteamContentServer001.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ISTEAMCONTENTSERVER001_H 18 | #define ISTEAMCONTENTSERVER001_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #include "SteamTypes.h" 24 | #include "ContentServerCommon.h" 25 | 26 | abstract_class ISteamContentServer001 27 | { 28 | public: 29 | virtual bool LogOn( uint32 uContentServerID ) = 0; 30 | virtual bool LogOff() = 0; 31 | 32 | virtual bool BLoggedOn() = 0; 33 | 34 | virtual void SendClientContentAuthRequest( CSteamID steamID, uint32 unContentID ) = 0; 35 | }; 36 | 37 | 38 | #endif // ISTEAMCONTENTSERVER001_H 39 | -------------------------------------------------------------------------------- /MK1Hook/steam/StreamLauncherCommon.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef STREAMLAUNCHERCOMMON_H 18 | #define STREAMLAUNCHERCOMMON_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | 24 | // versions 25 | #define CLIENTSTREAMLAUNCHER_INTERFACE_VERSION "CLIENTSTREAMLAUNCHER_INTERFACE_VERSION001" 26 | #define STEAMSTREAMLAUNCHER_INTERFACE_VERSION_001 "STEAMSTREAMLAUNCHER_INTERFACE_VERSION001" 27 | 28 | enum EStreamLauncherResult 29 | { 30 | // TODO: Reverse this enum 31 | }; 32 | 33 | // callbacks 34 | #pragma pack( push, 8 ) 35 | 36 | 37 | #pragma pack( pop ) 38 | 39 | 40 | #endif // STREAMLAUNCHERCOMMON_H 41 | -------------------------------------------------------------------------------- /MK1Hook/steam/TSteamError.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef TSTEAMERROR_H 18 | #define TSTEAMERROR_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | typedef enum EDetailedPlatformErrorType 24 | { 25 | eNoDetailedErrorAvailable, 26 | eStandardCerrno, 27 | eWin32LastError, 28 | eWinSockLastError, 29 | eDetailedPlatformErrorCount 30 | } EDetailedPlatformErrorType; 31 | 32 | typedef struct TSteamError 33 | { 34 | ESteamError eSteamError; 35 | EDetailedPlatformErrorType eDetailedErrorType; 36 | int nDetailedErrorCode; 37 | char szDesc[STEAM_MAX_PATH]; 38 | } TSteamError; 39 | 40 | #endif // TSTEAMERROR_H 41 | -------------------------------------------------------------------------------- /MK1Hook/mk/FightingTeamDefinition.cpp: -------------------------------------------------------------------------------- 1 | #include "FightingTeamDefinition.h" 2 | 3 | int64(*pTeamInfo_SetKameoMode)(FightingTeamDefinition*, bool) = nullptr; 4 | int64(*pTeamInfo_SetTagMode)(FightingTeamDefinition*, bool) = nullptr; 5 | int64(*pTeamInfo_SetSingleMode)(FightingTeamDefinition*, bool) = nullptr; 6 | int64(*pTeamInfo_GetKameoClass)() = nullptr; 7 | int64(*pTeamInfo_GetTagClass)() = nullptr; 8 | 9 | void FightingTeamDefinition::SetMode(TEAM_INFO_MODE mode) 10 | { 11 | switch (mode) 12 | { 13 | case MODE_SINGLE: 14 | pTeamInfo_SetSingleMode(this, false); 15 | break; 16 | case MODE_KAMEO: 17 | pTeamInfo_SetKameoMode(this, false); 18 | break; 19 | case MODE_TAG: 20 | pTeamInfo_SetTagMode(this, false); 21 | break; 22 | default: 23 | break; 24 | } 25 | } 26 | 27 | bool FightingTeamDefinition::IsPartnerMode() 28 | { 29 | int64 teamClass = GetClass(); 30 | 31 | if (teamClass == GetKameoClass() || teamClass == GetTagClass()) 32 | return true; 33 | 34 | return false; 35 | } 36 | 37 | int64 FightingTeamDefinition::GetDefinitions() 38 | { 39 | static uintptr_t pat = _pattern(PATID_TeamInfo_GetDefinitions); 40 | if (pat) 41 | return ((int64(__thiscall*)(FightingTeamDefinition*))pat)(this); 42 | 43 | return 0; 44 | } 45 | 46 | int64 FightingTeamDefinition::GetClass() 47 | { 48 | return *(int64*)((int64)this + 136); 49 | } 50 | 51 | int64 FightingTeamDefinition::GetKameoClass() 52 | { 53 | return pTeamInfo_GetKameoClass(); 54 | } 55 | 56 | int64 FightingTeamDefinition::GetTagClass() 57 | { 58 | return pTeamInfo_GetTagClass(); 59 | } 60 | -------------------------------------------------------------------------------- /MK1Hook/steam/TSteamSubscriptionBillingInfo.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef TSTEAMSUBSCRIPTIONBILLINGINFO_H 18 | #define TSTEAMSUBSCRIPTIONBILLINGINFO_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | typedef struct TSteamSubscriptionBillingInfo 24 | { 25 | ESteamSubscriptionBillingInfoType eBillingInfoType; 26 | union 27 | { 28 | TSteamPaymentCardInfo PaymentCardInfo; 29 | TSteamPrepurchaseInfo PrepurchaseInfo; 30 | TSteamExternalBillingInfo ExternalBillingInfo; 31 | char bUseAccountBillingInfo; 32 | }; 33 | 34 | } TSteamSubscriptionBillingInfo; 35 | 36 | #endif // TSTEAMSUBSCRIPTIONBILLINGINFO_H 37 | -------------------------------------------------------------------------------- /MK1Hook/steam/ESteamSubscriptionBillingInfoType.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ESTEAMSUBSCRIPTIONBILLINGINFOTYPE_H 18 | #define ESTEAMSUBSCRIPTIONBILLINGINFOTYPE_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | typedef enum ESteamSubscriptionBillingInfoType 24 | { 25 | ePaymentCardInfo = 1, 26 | ePrepurchasedInfo = 2, 27 | eAccountBillingInfo = 3, 28 | eExternalBillingInfo = 4, // indirect billing via ISP etc (not supported yet) 29 | ePaymentCardReceipt = 5, 30 | ePrepurchaseReceipt = 6, 31 | eEmptyReceipt = 7, 32 | } ESteamSubscriptionBillingInfoType; 33 | 34 | #endif // ESTEAMSUBSCRIPTIONBILLINGINFOTYPE_H 35 | -------------------------------------------------------------------------------- /MK1Hook/steam/TSteamAppStats.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef TSTEAMAPPSTATS_H 18 | #define TSTEAMAPPSTATS_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | typedef struct TSteamAppStats 24 | { 25 | unsigned int uNumApps; 26 | unsigned int uMaxNameChars; 27 | unsigned int uMaxInstallDirNameChars; 28 | unsigned int uMaxVersionLabelChars; 29 | unsigned int uMaxLaunchOptions; 30 | unsigned int uMaxLaunchOptionDescChars; 31 | unsigned int uMaxLaunchOptionCmdLineChars; 32 | unsigned int uMaxNumIcons; 33 | unsigned int uMaxIconSize; 34 | unsigned int uMaxDependencies; 35 | } TSteamAppStats; 36 | 37 | 38 | #endif // TSTEAMAPPSTATS_H 39 | -------------------------------------------------------------------------------- /MK1Hook/mk/Engine.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "..\utils.h" 3 | #include "GameInfo.h" 4 | #include "MKCharacter.h" 5 | #include "PlayerInfo.h" 6 | #include "MKCamera.h" 7 | #include "ContentDefinition.h" 8 | #include "CharacterDefinition.h" 9 | #include "MKModifier.h" 10 | 11 | class MKCharacter; 12 | class MKCharacterActor; 13 | class CharacterDefinitionV2; 14 | 15 | extern int64(*orgGamelogicJump)(int64, char*, unsigned int, int, int, int, int, int, int); 16 | 17 | MKCharacter* GetObj(PLAYER_NUM plr); 18 | MKCharacterActor* GetObjActor(PLAYER_NUM plr); 19 | PlayerInfo* GetInfo(PLAYER_NUM plr); 20 | 21 | 22 | void HideHUD(); 23 | void ShowHUD(); 24 | 25 | void SlowGameTimeForXTicks(float speed, int ticks); 26 | 27 | int64 GamelogicJump(int64 gameInfoPtr,char* mkoName, unsigned int functionHash, int a3, int a4, int a5, int a6, int a7, int a8); 28 | 29 | unsigned int _hash(const char* input); 30 | 31 | // wrappers 32 | 33 | void GetCharacterPosition(FVector* vec, PLAYER_NUM plr); 34 | char* GetCharacterName(PLAYER_NUM plr); 35 | char* GetCharacterSkinName(PLAYER_NUM plr); 36 | 37 | void SetTeamMode(TEAM_NUM plr, TEAM_INFO_MODE mode); 38 | bool IsPartnerTeam(TEAM_NUM plr); 39 | 40 | void SetCharacterMKX(PLAYER_NUM plr, char* name, bool tag = false); 41 | void SetCharacterSkin(PLAYER_NUM plr, char* name); 42 | void SetCharacterExtraMoveset(PLAYER_NUM plr, char* name); 43 | void SetCharacterAI(PLAYER_NUM plr, char* script, int level); 44 | void SetCharacterAI(PLAYER_NUM plr, int scriptID, int level); 45 | 46 | CharacterDefinitionV2* GetCharacterDefinition(PLAYER_NUM plr); 47 | bool IsCharacterPartner(PLAYER_NUM plr); 48 | -------------------------------------------------------------------------------- /MK1Hook/steam/TSteamGlobalUserID.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef TSTEAMGLOBALUSERID_H 18 | #define TSTEAMGLOBALUSERID_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | // Applications need to be able to authenticate Steam users from ANY instance. 24 | // So a SteamIDTicket contains SteamGlobalUserID, which is a unique combination of 25 | // instance and user id. 26 | typedef struct TSteamGlobalUserID 27 | { 28 | SteamInstanceID_t m_SteamInstanceID; 29 | 30 | union m_SteamLocalUserID 31 | { 32 | SteamLocalUserID_t As64bits; 33 | TSteamSplitLocalUserID Split; 34 | } m_SteamLocalUserID; 35 | 36 | } TSteamGlobalUserID; 37 | 38 | 39 | #endif // TSTEAMGLOBALUSERID_H 40 | -------------------------------------------------------------------------------- /MK1Hook.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.6.33723.286 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MK1Hook", "MK1Hook\MK1Hook.vcxproj", "{ECDEC0B1-76F2-413A-83FA-2C429559C24B}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SamplePlugin", "SamplePlugin\SamplePlugin.vcxproj", "{2D746591-91F6-41B3-9AD2-457744E346F0}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|x64 = Debug|x64 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {ECDEC0B1-76F2-413A-83FA-2C429559C24B}.Debug|x64.ActiveCfg = Debug|x64 17 | {ECDEC0B1-76F2-413A-83FA-2C429559C24B}.Debug|x64.Build.0 = Debug|x64 18 | {ECDEC0B1-76F2-413A-83FA-2C429559C24B}.Release|x64.ActiveCfg = Release|x64 19 | {ECDEC0B1-76F2-413A-83FA-2C429559C24B}.Release|x64.Build.0 = Release|x64 20 | {2D746591-91F6-41B3-9AD2-457744E346F0}.Debug|x64.ActiveCfg = Debug|x64 21 | {2D746591-91F6-41B3-9AD2-457744E346F0}.Debug|x64.Build.0 = Debug|x64 22 | {2D746591-91F6-41B3-9AD2-457744E346F0}.Release|x64.ActiveCfg = Release|x64 23 | {2D746591-91F6-41B3-9AD2-457744E346F0}.Release|x64.Build.0 = Release|x64 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {B4BAC163-2511-44D8-AE34-313EE8220D7D} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /MK1Hook/steam/IClientGameCoordinator.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ICLIENTGAMECOORDINATOR_H 18 | #define ICLIENTGAMECOORDINATOR_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #include "SteamTypes.h" 24 | #include "GameCoordinatorCommon.h" 25 | 26 | 27 | abstract_class IClientGameCoordinator 28 | { 29 | public: 30 | virtual EGCResults SendMessage( AppId_t unAppID, uint32 unMsgType, const void *pubData, uint32 cubData ) = 0; 31 | 32 | virtual bool IsMessageAvailable( AppId_t unAppID, uint32 *pcubMsgSize ) = 0; 33 | 34 | virtual EGCResults RetrieveMessage( AppId_t unAppID, uint32 *punMsgType, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize ) = 0; 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /MK1Hook/steam/TSteamPrepurchaseInfo.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef TSTEAMPREPURCHASEINFO_H 18 | #define TSTEAMPREPURCHASEINFO_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | typedef struct TSteamPrepurchaseInfo 24 | { 25 | char szTypeOfProofOfPurchase[ STEAM_TYPE_OF_PROOF_OF_PURCHASE_SIZE + 1 ]; 26 | 27 | // A ProofOfPurchase token is not necessarily a nul-terminated string; it may be binary data 28 | // (perhaps encrypted). Hence we need a length and an array of bytes. 29 | unsigned int uLengthOfBinaryProofOfPurchaseToken; 30 | char cBinaryProofOfPurchaseToken[ STEAM_PROOF_OF_PURCHASE_TOKEN_SIZE + 1 ]; 31 | } TSteamPrepurchaseInfo; 32 | 33 | #endif // TSTEAMPREPURCHASEINFO_H 34 | -------------------------------------------------------------------------------- /MK1Hook/steam/TSteamSubscriptionReceipt.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef TSTEAMSUBSCRIPTIONRECEIPT_H 18 | #define TSTEAMSUBSCRIPTIONRECEIPT_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | typedef struct TSteamSubscriptionReceipt 24 | { 25 | ESteamSubscriptionStatus eStatus; 26 | ESteamSubscriptionStatus ePreviousStatus; 27 | ESteamSubscriptionBillingInfoType eReceiptInfoType; 28 | 29 | char szConfirmationCode[ STEAM_CONFIRMATION_CODE_SIZE + 1 ]; 30 | 31 | union 32 | { 33 | TSteamPaymentCardReceiptInfo PaymentCardReceiptInfo; 34 | TSteamPrepurchaseReceiptInfo PrepurchaseReceiptInfo; 35 | }; 36 | 37 | } TSteamSubscriptionReceipt; 38 | 39 | 40 | #endif // TSTEAMSUBSCRIPTIONRECEIPT_H 41 | -------------------------------------------------------------------------------- /MK1Hook/steam/Win32Library.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #pragma once 18 | 19 | class DynamicLibrary 20 | { 21 | public: 22 | DynamicLibrary(const char* cszPath) 23 | { 24 | m_handle = LoadLibraryA(cszPath); 25 | } 26 | 27 | ~DynamicLibrary() 28 | { 29 | if(m_handle) 30 | FreeLibrary(m_handle); 31 | } 32 | 33 | void * GetSymbol(const char* cszSymbol) const 34 | { 35 | if(!m_handle) 36 | return NULL; 37 | 38 | return (void *)GetProcAddress(m_handle, cszSymbol); 39 | } 40 | 41 | bool IsLoaded() const 42 | { 43 | return m_handle != NULL; 44 | } 45 | 46 | private: 47 | HMODULE m_handle; 48 | 49 | DynamicLibrary(const DynamicLibrary&); 50 | void operator=(const DynamicLibrary&); 51 | }; 52 | -------------------------------------------------------------------------------- /MK1Hook/steam/POSIXLibrary.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #pragma once 18 | #include 19 | 20 | class DynamicLibrary 21 | { 22 | public: 23 | DynamicLibrary(const char* cszPath) 24 | { 25 | m_handle = dlopen(cszPath, RTLD_LAZY); 26 | } 27 | 28 | ~DynamicLibrary() 29 | { 30 | if(m_handle) 31 | dlclose(m_handle); 32 | } 33 | 34 | void * GetSymbol(const char* cszSymbol) const 35 | { 36 | if(!m_handle) 37 | return NULL; 38 | 39 | return dlsym(m_handle, cszSymbol); 40 | } 41 | 42 | bool IsLoaded() const 43 | { 44 | return m_handle != NULL; 45 | } 46 | 47 | private: 48 | void *m_handle; 49 | 50 | DynamicLibrary(const DynamicLibrary&); 51 | void operator=(const DynamicLibrary&); 52 | }; 53 | -------------------------------------------------------------------------------- /MK1Hook/steam/ISteamMusic001.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ISTEAMMUSIC001_H 18 | #define ISTEAMMUSIC001_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #include "SteamTypes.h" 24 | #include "MusicCommon.h" 25 | 26 | abstract_class ISteamMusic001 27 | { 28 | public: 29 | virtual bool BIsEnabled() = 0; 30 | virtual bool BIsPlaying() = 0; 31 | 32 | virtual AudioPlayback_Status GetPlaybackStatus() = 0; 33 | 34 | virtual void Play() = 0; 35 | virtual void Pause() = 0; 36 | virtual void PlayPrevious() = 0; 37 | virtual void PlayNext() = 0; 38 | 39 | // volume is between 0.0 and 1.0 40 | virtual void SetVolume(float flVolume) = 0; 41 | virtual float GetVolume() = 0; 42 | }; 43 | 44 | #endif // ISTEAMMUSIC001_H 45 | -------------------------------------------------------------------------------- /MK1Hook/mk/MKCamera.cpp: -------------------------------------------------------------------------------- 1 | #include "MKCamera.h" 2 | #include "../plugin/Menu.h" 3 | #include 4 | #include 5 | #include "MKCharacter.h" 6 | 7 | MKCamera* TheCamera; 8 | 9 | void MKCamera::FillCameraCache(FMinimalViewInfo* NewInfo) 10 | { 11 | TheCamera = this; 12 | static uintptr_t pat = _pattern(PATID_MKCamera_FillCameraCache); 13 | if (pat) 14 | ((void(__thiscall*)(MKCamera*, FMinimalViewInfo*))pat)(this, NewInfo); 15 | } 16 | 17 | void MKCamera::HookedFillCameraCache(FMinimalViewInfo* NewInfo) 18 | { 19 | FillCameraCache(NewInfo); 20 | 21 | if (TheMenu->m_bCustomCameras) 22 | TheMenu->ProcessCustomCameras(this); 23 | else 24 | { 25 | if (!TheMenu->m_bCustomCameraFOV && !TheMenu->m_bFreeCam) 26 | TheMenu->camFov = CameraCache.POV.FOV; 27 | else 28 | CameraCache.POV.FOV = TheMenu->camFov; 29 | 30 | if (!TheMenu->m_bCustomCameraPos && !TheMenu->m_bFreeCam) 31 | TheMenu->camPos = CameraCache.POV.Location; 32 | else 33 | CameraCache.POV.Location = TheMenu->camPos; 34 | 35 | if (!TheMenu->m_bCustomCameraRot && !TheMenu->m_bFreeCam) 36 | TheMenu->camRot = CameraCache.POV.Rotation; 37 | else 38 | CameraCache.POV.Rotation = TheMenu->camRot; 39 | } 40 | 41 | } 42 | 43 | FMatrix MKCamera::GetMatrix() 44 | { 45 | FRotator rot; 46 | float Pitch = CameraCache.POV.Rotation.X; 47 | float Yaw = CameraCache.POV.Rotation.Y; 48 | float Roll = CameraCache.POV.Rotation.Z; 49 | 50 | rot.Pitch = (int)(float)((float)(Pitch * 32767.0) / 180.0); 51 | rot.Yaw = (int)(float)((float)(Yaw * 32767.0) / 180.0); 52 | rot.Roll = (int)(float)((float)(Roll * 32767.0) / 180.0); 53 | 54 | FMatrix mat(&rot); 55 | return mat; 56 | } 57 | -------------------------------------------------------------------------------- /MK1Hook/steam/ISteamUnifiedMessages001.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ISTEAMUNIFIEDMESSAGES001_H 18 | #define ISTEAMUNIFIEDMESSAGES001_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #include "SteamTypes.h" 24 | #include "UnifiedMessagesCommon.h" 25 | 26 | abstract_class ISteamUnifiedMessages001 27 | { 28 | public: 29 | virtual uint64 SendMethod( const char *, const void *, uint32, uint64 ) = 0; 30 | virtual bool GetMethodResponseInfo( uint64, uint32 *, EResult * ) = 0; 31 | virtual bool GetMethodResponseData( uint64, void *, uint32, bool ) = 0; 32 | virtual bool ReleaseMethod( uint64 ) = 0; 33 | virtual bool SendNotification( const char *, const void *, uint32 ) = 0; 34 | }; 35 | 36 | 37 | #endif // ISTEAMUNIFIEDMESSAGES001_H 38 | -------------------------------------------------------------------------------- /MK1Hook/steam/IClientUnifiedMessages.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ICLIENTUNIFIEDMESSAGES_H 18 | #define ICLIENTUNIFIEDMESSAGES_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #include "SteamTypes.h" 24 | #include "UnifiedMessagesCommon.h" 25 | 26 | abstract_class UNSAFE_INTERFACE IClientUnifiedMessages 27 | { 28 | public: 29 | virtual uint64 SendMethod( const char *, const void *, uint32, uint64 ) = 0; 30 | virtual bool GetMethodResponseInfo( uint64, uint32 *, EResult * ) = 0; 31 | virtual bool GetMethodResponseData( uint64, void *, uint32, bool ) = 0; 32 | virtual bool ReleaseMethod( uint64 ) = 0; 33 | virtual bool SendNotification( const char *, const void *, uint32 ) = 0; 34 | }; 35 | 36 | #endif // ICLIENTUNIFIEDMESSAGES_H 37 | 38 | -------------------------------------------------------------------------------- /MK1Hook/steam/ISteamContentServer002.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ISTEAMCONTENTSERVER002_H 18 | #define ISTEAMCONTENTSERVER002_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #include "SteamTypes.h" 24 | #include "ContentServerCommon.h" 25 | 26 | abstract_class ISteamContentServer002 27 | { 28 | public: 29 | virtual bool LogOn( uint32 uContentServerID ) = 0; 30 | virtual bool LogOff() = 0; 31 | 32 | virtual bool BLoggedOn() = 0; 33 | 34 | virtual void SendClientContentAuthRequest( CSteamID steamID, uint32 uContentID, uint64 ulSessionToken, bool bTokenPresent ) = 0; 35 | 36 | virtual bool BCheckTicket( CSteamID steamID, uint32 uContentID, const void *pvTicketData, uint32 cubTicketLength ) = 0; 37 | }; 38 | 39 | 40 | #endif // ISTEAMCONTENTSERVER001_H 41 | -------------------------------------------------------------------------------- /SamplePlugin/SamplePlugin.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | Header Files 29 | 30 | 31 | 32 | 33 | Source Files 34 | 35 | 36 | Source Files 37 | 38 | 39 | Header Files 40 | 41 | 42 | -------------------------------------------------------------------------------- /MK1Hook/plugin/API.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "..\mk\Engine.h" 3 | 4 | extern "C" { 5 | __declspec(dllexport) bool MK12HOOK_GetMenuActive(); 6 | __declspec(dllexport) MKCharacter* MK12HOOK_GetCharacterObject(PLAYER_NUM id); 7 | __declspec(dllexport) PlayerInfo* MK12HOOK_GetPlayerInfo(PLAYER_NUM id); 8 | __declspec(dllexport) FGGameInfo* MK12HOOK_GetGameInfo(); 9 | __declspec(dllexport) void MK12HOOK_ImGui_Text(const char* text); 10 | __declspec(dllexport) bool MK12HOOK_ImGui_Checkbox(const char* text, bool* value); 11 | __declspec(dllexport) bool MK12HOOK_ImGui_Button(const char* text); 12 | __declspec(dllexport) bool MK12HOOK_ImGui_InputInt(const char* text, int* value); 13 | __declspec(dllexport) bool MK12HOOK_ImGui_InputFloat(const char* text, float* value); 14 | __declspec(dllexport) bool MK12HOOK_ImGui_InputText(const char* label, char* buff, size_t size); 15 | __declspec(dllexport) bool MK12HOOK_ImGui_BeginCombo(const char* label, const char* previewValue); 16 | __declspec(dllexport) void MK12HOOK_ImGui_EndCombo(); 17 | __declspec(dllexport) bool MK12HOOK_ImGui_Selectable(const char* label, bool selected); 18 | __declspec(dllexport) void MK12HOOK_ImGui_SetItemDefaultFocus(); 19 | __declspec(dllexport) void MK12HOOK_ImGui_Separator(); 20 | __declspec(dllexport) bool MK12HOOK_ImGui_CollapsingHeader(const char* label); 21 | __declspec(dllexport) uintptr_t MK12HOOK_GetPattern(const char* pattern, int offset); 22 | __declspec(dllexport) bool MK12HOOK_ImGui_ColorEdit4(const char* label, float* col); 23 | __declspec(dllexport) int MK12HOOK_CreateHook(LPVOID, LPVOID, LPVOID*); 24 | __declspec(dllexport) void MK12HOOK_PushNotif(int time, const char* text); 25 | __declspec(dllexport) const char* MK12HOOK_GetVersion(); 26 | } -------------------------------------------------------------------------------- /MK1Hook/steam/ESteamNotify.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ESTEAMNOTIFICATIONCALLBACKEVENT_H 18 | #define ESTEAMNOTIFICATIONCALLBACKEVENT_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | typedef enum ESteamNotify 24 | { 25 | eSteamNotifyTicketsWillExpire = 0, 26 | eSteamNotifyAccountInfoChanged = 1, 27 | eSteamNotifyContentDescriptionChanged = 2, 28 | eSteamNotifyPleaseShutdown = 3, 29 | eSteamNotifyNewContentServer = 4, 30 | eSteamNotifySubscriptionStatusChanged = 5, 31 | eSteamNotifyContentServerConnectionLost = 6, 32 | eSteamNotifyCacheLoadingCompleted = 7, 33 | eSteamNotifyCacheNeedsDecryption = 8, 34 | eSteamNotifyCacheNeedsRepair = 9, 35 | eSteamNotifyAppDownloading = 10, 36 | eSteamNotifyAppDownloadingPaused = 11, 37 | } ESteamNotify; 38 | 39 | 40 | 41 | #endif // ESTEAMNOTIFICATIONCALLBACKEVENT_H 42 | -------------------------------------------------------------------------------- /MK1Hook/steam/TSteamApp.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef TSTEAMAPP_H 18 | #define TSTEAMAPP_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | typedef struct TSteamApp 24 | { 25 | char *szName; 26 | unsigned int uMaxNameChars; 27 | char *szLatestVersionLabel; 28 | unsigned int uMaxLatestVersionLabelChars; 29 | char *szCurrentVersionLabel; 30 | unsigned int uMaxCurrentVersionLabelChars; 31 | char* szInstallDirName; 32 | unsigned int uMaxInstallDirNameChars; 33 | unsigned int uId; 34 | unsigned int uLatestVersionId; 35 | unsigned int uCurrentVersionId; 36 | unsigned int uMinCacheFileSizeMB; 37 | unsigned int uMaxCacheFileSizeMB; 38 | unsigned int uNumLaunchOptions; 39 | unsigned int uNumIcons; 40 | unsigned int uNumVersions; 41 | unsigned int uNumDependencies; 42 | } TSteamApp; 43 | 44 | #endif // TSTEAMAPP_H 45 | -------------------------------------------------------------------------------- /MK1Hook/gui/imgui/imgui_impl_dx11.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for DirectX11 2 | // This needs to be used along with a Platform Backend (e.g. Win32) 3 | 4 | // Implemented features: 5 | // [X] Renderer: User texture binding. Use 'ID3D11ShaderResourceView*' as ImTextureID. Read the FAQ about ImTextureID! 6 | // [X] Renderer: Large meshes support (64k+ vertices) with 16-bit indices. 7 | 8 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 9 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 10 | // Learn about Dear ImGui: 11 | // - FAQ https://dearimgui.com/faq 12 | // - Getting Started https://dearimgui.com/getting-started 13 | // - Documentation https://dearimgui.com/docs (same as your local docs/ folder). 14 | // - Introduction, links and more at the top of imgui.cpp 15 | 16 | #pragma once 17 | #include "imgui.h" // IMGUI_IMPL_API 18 | #ifndef IMGUI_DISABLE 19 | 20 | struct ID3D11Device; 21 | struct ID3D11DeviceContext; 22 | 23 | // Follow "Getting Started" link and check examples/ folder to learn about using backends! 24 | IMGUI_IMPL_API bool ImGui_ImplDX11_Init(ID3D11Device* device, ID3D11DeviceContext* device_context); 25 | IMGUI_IMPL_API void ImGui_ImplDX11_Shutdown(); 26 | IMGUI_IMPL_API void ImGui_ImplDX11_NewFrame(); 27 | IMGUI_IMPL_API void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data); 28 | 29 | // Use if you want to reset your rendering device without losing Dear ImGui state. 30 | IMGUI_IMPL_API void ImGui_ImplDX11_InvalidateDeviceObjects(); 31 | IMGUI_IMPL_API bool ImGui_ImplDX11_CreateDeviceObjects(); 32 | 33 | #endif // #ifndef IMGUI_DISABLE 34 | -------------------------------------------------------------------------------- /MK1Hook/steam/ISteamApps001.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ISTEAMAPPS001_H 18 | #define ISTEAMAPPS001_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #include "SteamTypes.h" 24 | #include "AppsCommon.h" 25 | 26 | //----------------------------------------------------------------------------- 27 | // Purpose: interface to app data 28 | //----------------------------------------------------------------------------- 29 | abstract_class ISteamApps001 30 | { 31 | public: 32 | // returns 0 if the key does not exist 33 | // this may be true on first call, since the app data may not be cached locally yet 34 | // If you expect it to exists wait for the AppDataChanged_t after the first failure and ask again 35 | virtual int GetAppData( AppId_t nAppID, const char *pchKey, char *pchValue, int cchValueMax ) = 0; 36 | }; 37 | 38 | 39 | #endif // ISTEAMAPPS001_H 40 | -------------------------------------------------------------------------------- /MK1Hook/steam/IClientProductBuilder.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ICLIENTPRODUCTBUILDER_H 18 | #define ICLIENTPRODUCTBUILDER_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #include "SteamTypes.h" 24 | 25 | 26 | // Not a typo, it seem that IClientProductBuilder's version string is really the same as IClientDepotBuilder's. 27 | // Valid as of Steamclient beta 22nd March 2014 (1395164792) 28 | #define CLIENTPRODUCTBUILDER_INTERFACE_VERSION "CLIENTDEPOTBUILDER_INTERFACE_VERSION001" 29 | 30 | 31 | abstract_class IClientProductBuilder 32 | { 33 | public: 34 | virtual uint64 SignInstallScript( uint32, const char *, const char * ) = 0; 35 | virtual uint64 DRMWrap( uint32, const char *, const char *, const char *, uint32 ) = 0; 36 | virtual uint64 CEGWrap( uint32, const char *, const char *, const char * ) = 0; 37 | }; 38 | 39 | #endif // ICLIENTPRODUCTBUILDER_H 40 | -------------------------------------------------------------------------------- /MK1Hook/gui/dx12hook.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../minhook/include/MinHook.h" 3 | #include 4 | #include 5 | #include "gui_impl.h" 6 | #include "log.h" 7 | #include "const.h" 8 | 9 | class DX12Hook { 10 | private: 11 | DX12Hook(); 12 | ~DX12Hook(); 13 | 14 | uintptr_t presentPtr; 15 | uintptr_t resizeBuffersPtr; 16 | uintptr_t executeCommandsPtr; 17 | 18 | uintptr_t presentOriginalPtr; 19 | uintptr_t resizeBuffersOriginalPtr; 20 | uintptr_t executeCommandsOriginalPtr; 21 | 22 | uintptr_t commandQueueOffset; 23 | 24 | ID3D12CommandQueue* commandQueue; 25 | public: 26 | bool Initialize(); 27 | bool Enable(); 28 | 29 | static DX12Hook* Get(); 30 | 31 | uintptr_t GetPresentAddress(); 32 | uintptr_t GetResizeBuffersAddress(); 33 | uintptr_t GetExecuteCommandsAddress(); 34 | uintptr_t GetCommandQueueOffsetForSwapChain(); 35 | ID3D12CommandQueue* GetCommandQueue(); 36 | 37 | HWND CreateDummyWindow(); 38 | 39 | void OnPresent(IDXGISwapChain* pSwapChain); 40 | void OnBeforeResize(IDXGISwapChain* pSwapChain, UINT BufferCount, UINT Width, UINT Height, DXGI_FORMAT NewFormat, UINT SwapChainFlags); 41 | void OnAfterResize(IDXGISwapChain* pSwapChain, UINT BufferCount, UINT Width, UINT Height, DXGI_FORMAT NewFormat, UINT SwapChainFlags); 42 | void OnExecuteCommandLists(ID3D12CommandQueue* pQueue, UINT NumCommandLists, ID3D12CommandList* ppCommandLists); 43 | 44 | static HRESULT WINAPI Present(IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Flags); 45 | static HRESULT WINAPI ResizeBuffers(IDXGISwapChain* pSwapChain, UINT BufferCount, UINT Width, UINT Height, DXGI_FORMAT NewFormat, UINT SwapChainFlags); 46 | static void WINAPI ExecuteCommandLists(ID3D12CommandQueue* pQueue, UINT NumCommandLists, ID3D12CommandList* ppCommandLists); 47 | }; 48 | 49 | DWORD WINAPI DX12Hook_Thread(); -------------------------------------------------------------------------------- /MK1Hook/unreal/FVector.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class FVector 5 | { 6 | public: 7 | float X,Y,Z; 8 | FVector(void) {} 9 | FVector(float a, float b, float c) 10 | { 11 | X = a; 12 | Y = b; 13 | Z = c; 14 | } 15 | 16 | const FVector &operator+=(FVector const &right) { 17 | X += right.X; 18 | Y += right.Y; 19 | Z += right.Z; 20 | return *this; 21 | } 22 | 23 | const FVector &operator+=(float const &right) { 24 | X += right; 25 | Y += right; 26 | Z += right; 27 | return *this; 28 | } 29 | 30 | const FVector &operator-=(FVector const &right) { 31 | X -= right.X; 32 | Y -= right.Y; 33 | Z -= right.Z; 34 | return *this; 35 | } 36 | 37 | const FVector &operator*=(float right) { 38 | X *= right; 39 | Y *= right; 40 | Z *= right; 41 | return *this; 42 | } 43 | 44 | const FVector &operator/=(float right) { 45 | X /= right; 46 | Y /= right; 47 | Z /= right; 48 | return *this; 49 | } 50 | 51 | FVector operator-() const { 52 | return FVector(-X, -Y, -Z); 53 | } 54 | }; 55 | 56 | inline FVector operator+(const FVector &left, const FVector &right) 57 | { 58 | return FVector(left.X + right.X, left.Y + right.Y, left.Z + right.Z); 59 | } 60 | 61 | inline FVector operator-(const FVector &left, const FVector &right) 62 | { 63 | return FVector(left.X - right.X, left.Y - right.Y, left.Z - right.Z); 64 | } 65 | 66 | inline FVector operator*(const FVector &left, float right) 67 | { 68 | return FVector(left.X * right, left.Y * right, left.Z * right); 69 | } 70 | 71 | inline FVector operator*(float left, const FVector &right) 72 | { 73 | return FVector(left * right.X, left * right.Y, left * right.Z); 74 | } 75 | 76 | inline FVector operator/(const FVector &left, float right) 77 | { 78 | return FVector(left.X / right, left.Y / right, left.Z / right); 79 | } 80 | -------------------------------------------------------------------------------- /MK1Hook/steam/ISteamAppList001.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ISTEAMAPPLIST001_H 18 | #define ISTEAMAPPLIST001_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #include "SteamTypes.h" 24 | #include "AppsCommon.h" 25 | 26 | //----------------------------------------------------------------------------- 27 | // Purpose: interface to app data 28 | //----------------------------------------------------------------------------- 29 | abstract_class ISteamAppList001 30 | { 31 | public: 32 | virtual unknown_ret GetNumInstalledApps() = 0; 33 | virtual unknown_ret GetInstalledApps( uint32 * puUnk, uint32 uUnk ) = 0; 34 | virtual unknown_ret GetAppName( uint32 uUnk, char * pUnk, int32 iUnk ) = 0; 35 | virtual unknown_ret GetAppInstallDir( uint32 uUnk, char * pUnk, int32 iUnk ) = 0; 36 | virtual unknown_ret GetAppBuildId( uint32 uUnk ) = 0; 37 | }; 38 | 39 | 40 | #endif // ISTEAMAPPS001_H 41 | -------------------------------------------------------------------------------- /MK1Hook/minhook/src/hde/pstdint.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MinHook - The Minimalistic API Hooking Library for x64/x86 3 | * Copyright (C) 2009-2017 Tsuda Kageyu. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #pragma once 28 | 29 | #include 30 | 31 | // Integer types for HDE. 32 | typedef INT8 int8_t; 33 | typedef INT16 int16_t; 34 | typedef INT32 int32_t; 35 | typedef INT64 int64_t; 36 | typedef UINT8 uint8_t; 37 | typedef UINT16 uint16_t; 38 | typedef UINT32 uint32_t; 39 | typedef UINT64 uint64_t; 40 | -------------------------------------------------------------------------------- /MK1Hook/steam/TSteamSplitLocalUserID.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef TSTEAMSPLITLOCALUSERID_H 18 | #define TSTEAMSPLITLOCALUSERID_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | 24 | // Applications need to be able to authenticate Steam users from ANY instance. 25 | // So a SteamIDTicket contains SteamGlobalUserID, which is a unique combination of 26 | // instance and user id. 27 | 28 | // SteamLocalUserID is an unsigned 64-bit integer. 29 | // For platforms without 64-bit int support, we provide access via a union that splits it into 30 | // high and low unsigned 32-bit ints. Such platforms will only need to compare LocalUserIDs 31 | // for equivalence anyway - not perform arithmetic with them. 32 | typedef struct TSteamSplitLocalUserID 33 | { 34 | unsigned int Low32bits; 35 | unsigned int High32bits; 36 | } TSteamSplitLocalUserID; 37 | 38 | 39 | #endif // TSTEAMSPLITLOCALUSERID_H 40 | -------------------------------------------------------------------------------- /MK1Hook/steam/ISteamRemoteStorage001.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ISTEAMREMOTESTORAGE001_H 18 | #define ISTEAMREMOTESTORAGE001_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #include "SteamTypes.h" 24 | #include "RemoteStorageCommon.h" 25 | 26 | abstract_class ISteamRemoteStorage001 27 | { 28 | public: 29 | virtual bool FileWrite( const char *filename, void const *data, int ) = 0; 30 | 31 | virtual uint32 GetFileSize( const char *filename ) = 0; 32 | 33 | virtual bool FileRead( const char *filename, void *buffer, int size ) = 0; 34 | 35 | virtual bool FileExists( const char *filename ) = 0; 36 | virtual OBSOLETE_FUNCTION bool FileDelete( const char *filename ) = 0; 37 | 38 | virtual uint32 GetFileCount() = 0; 39 | 40 | virtual const char *GetFileNameAndSize( int index, int *size ) = 0; 41 | 42 | virtual bool GetQuota( int *current, int *maximum ) = 0; 43 | }; 44 | 45 | #endif // ISTEAMREMOTESTORAGE001_H 46 | -------------------------------------------------------------------------------- /MK1Hook/steam/IClientStreamClient.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ICLIENTSTREAMCLIENT_H 18 | #define ICLIENTSTREAMCLIENT_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #include "SteamTypes.h" 24 | 25 | #define CLIENTSTREAMCLIENT_INTERFACE_VERSION "CLIENTSTREAMCLIENT_INTERFACE_VERSION001" 26 | 27 | abstract_class UNSAFE_INTERFACE IClientStreamClient 28 | { 29 | public: 30 | virtual void Launched( CGameID gameID ) = 0; 31 | virtual void FocusGained( CGameID gameID, bool ) = 0; 32 | virtual void FocusLost( CGameID gameID ) = 0; 33 | virtual void Finished( CGameID gameID, EResult eResult ) = 0; 34 | virtual const char * GetSystemInfo() = 0; 35 | virtual void StartStreamingSession( CGameID gameID ) = 0; 36 | virtual void ReportStreamingSessionEvent( CGameID gameID, const char * ) = 0; 37 | virtual void FinishStreamingSession( CGameID gameID, const char *, const char * ) = 0; 38 | }; 39 | 40 | #endif // ICLIENTSTREAMCLIENT_H 41 | -------------------------------------------------------------------------------- /MK1Hook/steam/ISteamUtils001.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ISTEAMUTILS001_H 18 | #define ISTEAMUTILS001_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #include "SteamTypes.h" 24 | #include "UtilsCommon.h" 25 | 26 | //----------------------------------------------------------------------------- 27 | // Purpose: interface to user independent utility functions 28 | //----------------------------------------------------------------------------- 29 | abstract_class ISteamUtils001 30 | { 31 | public: 32 | // return the number of seconds since the user 33 | virtual uint32 GetSecondsSinceAppActive() = 0; 34 | virtual uint32 GetSecondsSinceComputerActive() = 0; 35 | 36 | // the universe this client is connecting to 37 | virtual EUniverse GetConnectedUniverse() = 0; 38 | 39 | // server time - in PST, number of seconds since January 1, 1970 (i.e unix time) 40 | virtual uint32 GetServerRealTime() = 0; 41 | }; 42 | 43 | #endif // ISTEAMUTILS001_H 44 | 45 | -------------------------------------------------------------------------------- /MK1Hook/steam/ISteamApps002.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ISTEAMAPPS002_H 18 | #define ISTEAMAPPS002_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #include "SteamTypes.h" 24 | #include "AppsCommon.h" 25 | 26 | //----------------------------------------------------------------------------- 27 | // Purpose: interface to app data 28 | //----------------------------------------------------------------------------- 29 | abstract_class ISteamApps002 30 | { 31 | public: 32 | virtual bool BIsSubscribed() = 0; 33 | virtual bool BIsLowViolence() = 0; 34 | virtual bool BIsCybercafe() = 0; 35 | virtual bool BIsVACBanned() = 0; 36 | 37 | virtual const char *GetCurrentGameLanguage() = 0; 38 | virtual const char *GetAvailableGameLanguages() = 0; 39 | 40 | // only use this member if you need to check ownership of another game related to yours, a demo for example 41 | virtual bool BIsSubscribedApp( AppId_t nAppID ) = 0; 42 | }; 43 | 44 | 45 | #endif // ISTEAMAPPS002_H 46 | -------------------------------------------------------------------------------- /MK1Hook/gui/notifications.cpp: -------------------------------------------------------------------------------- 1 | #include "notifications.h" 2 | #include 3 | #include 4 | #include "imgui\imgui.h" 5 | #include "gui_impl.h" 6 | #include "..\plugin\Settings.h" 7 | 8 | eNotificationManager* Notifications = new eNotificationManager(); 9 | 10 | void eNotificationManager::Init() 11 | { 12 | m_bIsNotificationActive = false; 13 | m_fNotifAlpha = 1.0; 14 | } 15 | 16 | void eNotificationManager::Update() 17 | { 18 | UpdateAlpha(); 19 | } 20 | 21 | void eNotificationManager::UpdateAlpha() 22 | { 23 | float delta = 1.0f / 60.0f; 24 | 25 | if (GUIImplementation::ms_bInit) 26 | delta = 1.0f / ImGui::GetIO().Framerate; 27 | 28 | 29 | float alphaSpeed = 1.8f; 30 | 31 | m_fNotifAlpha = max(m_fNotifAlpha - delta * alphaSpeed, 0.0f); 32 | 33 | 34 | if (m_fNotifAlpha <= 0) 35 | m_bIsNotificationActive = false; 36 | 37 | } 38 | 39 | void eNotificationManager::Draw() 40 | { 41 | if (m_bIsNotificationActive) 42 | { 43 | ImGui::PushStyleVar(ImGuiStyleVar_Alpha, m_fNotifAlpha); 44 | ImGui::SetNextWindowPos(ImVec2(5, 10)); 45 | ImGui::SetNextWindowSize(ImVec2(ImGui::GetIO().DisplaySize.x - 15.0f, 0.0f)); 46 | ImGui::Begin("notif", nullptr, ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoInputs 47 | | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing); 48 | ImGui::TextUnformatted(szMessageBuffer); 49 | ImGui::End(); 50 | ImGui::PopStyleVar(1); 51 | } 52 | } 53 | 54 | void eNotificationManager::SetNotificationTime(int time) 55 | { 56 | m_fNotifAlpha = time / 1000.0f; 57 | } 58 | 59 | void eNotificationManager::PushNotification(const char* format, ...) 60 | { 61 | va_list args; 62 | va_start(args, format); 63 | vsprintf(szMessageBuffer, format, args); 64 | va_end(args); 65 | m_bIsNotificationActive = true; 66 | //if (SettingsMgr->bEnableConsoleWindow) 67 | //{ 68 | // printf("Notification | %s\n", szMessageBuffer); 69 | //} 70 | } 71 | -------------------------------------------------------------------------------- /MK1Hook/steam/ISteamAppTicket001.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ISTEAMAPPTICKET001_H 18 | #define ISTEAMAPPTICKET001_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #include "SteamTypes.h" 24 | #include "AppTicketCommon.h" 25 | 26 | //----------------------------------------------------------------------------- 27 | // Purpose: hand out a reasonable "future proof" view of an app ownership ticket 28 | // the raw (signed) buffer, and indices into that buffer where the appid and 29 | // steamid are located. the sizes of the appid and steamid are implicit in 30 | // (each version of) the interface - currently uin32 appid and uint64 steamid 31 | //----------------------------------------------------------------------------- 32 | abstract_class ISteamAppTicket001 33 | { 34 | public: 35 | virtual uint32 GetAppOwnershipTicketData( AppId_t nAppId, void *pvSignedTicket, uint32 cbSignedTicket, uint32 *piAppId, uint32 *piSteamId, uint32 *piSignature, uint32 *pcbSignature ) = 0; 36 | }; 37 | 38 | #endif // ISTEAMAPPTICKET001_H 39 | -------------------------------------------------------------------------------- /MK1Hook/unreal/SkeletalMesh.cpp: -------------------------------------------------------------------------------- 1 | #include "SkeletalMesh.h" 2 | 3 | void USkeletalMeshComponent::GetBoneMatrix(FMatrix* result, int id) 4 | { 5 | static uintptr_t pat = _pattern(PATID_USkeletalMeshComponent_GetBoneMatrix); 6 | if (pat) 7 | ((void(__fastcall*)(USkeletalMeshComponent*, FMatrix*, int))pat)(this, result, id); 8 | } 9 | 10 | void USkeletalMeshComponent::GetBoneMatrix(const wchar_t* name, FMatrix* result) 11 | { 12 | int boneID = GetBoneIndexFromString(name); 13 | if (boneID < 0) 14 | return; 15 | GetBoneMatrix(result, boneID); 16 | } 17 | 18 | void USkeletalMeshComponent::GetBoneLocation(const wchar_t* name, FVector* result) 19 | { 20 | int boneID = GetBoneIndexFromString(name); 21 | if (boneID < 0) 22 | *result = { 0.0f, 0.0f, 0.0f }; 23 | 24 | FMatrix mat = {}; 25 | GetBoneMatrix(&mat, boneID); 26 | *result = mat.GetPos(); 27 | } 28 | 29 | void USkeletalMeshComponent::GetBoneRotation(const wchar_t* name, FVector* result) 30 | { 31 | int boneID = GetBoneIndexFromString(name); 32 | if (boneID < 0) 33 | *result = { 0.0f, 0.0f, 0.0f }; 34 | 35 | FMatrix mat = {}; 36 | GetBoneMatrix(&mat, boneID); 37 | 38 | mat.Rotator(result); 39 | } 40 | 41 | void USkeletalMeshComponent::GetBoneName(FName* result, int id) 42 | { 43 | static uintptr_t pat = _pattern(PATID_USkeletalMeshComponent_GetBoneName); 44 | if (pat) 45 | ((void(__fastcall*)(USkeletalMeshComponent*, FName*, int))pat)(this, result, id); 46 | } 47 | 48 | int USkeletalMeshComponent::GetBoneIndexFromString(const wchar_t* BoneName) 49 | { 50 | for (int i = 0; i < SkeletalMesh->GetNumBones(); i++) 51 | { 52 | FName name; 53 | GetBoneName(&name, i); 54 | 55 | if (name.Index > 0) 56 | { 57 | FString boneName; 58 | name.ToString(&boneName); 59 | if (wcscmp(boneName.GetStr(), BoneName) == 0) 60 | { 61 | return i; 62 | } 63 | } 64 | } 65 | 66 | return -1; 67 | } 68 | 69 | int USkeletalMesh::GetNumBones() 70 | { 71 | return *(int*)(this + 0x238); 72 | } 73 | -------------------------------------------------------------------------------- /MK1Hook/steam/ESteamSubscriptionStatus.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ESTEAMSUBSCRIPTIONSTATUS_H 18 | #define ESTEAMSUBSCRIPTIONSTATUS_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | 24 | typedef enum ESteamSubscriptionStatus 25 | { 26 | eSteamSubscriptionOK = 0, 27 | eSteamSubscriptionPending = 1, 28 | eSteamSubscriptionPreorder = 2, 29 | eSteamSubscriptionPrepurchaseTransferred = 3, 30 | eSteamSubscriptionPrepurchaseInvalid = 4, 31 | eSteamSubscriptionPrepurchaseRejected = 5, 32 | eSteamSubscriptionPrepurchaseRevoked = 6, 33 | eSteamSubscriptionPaymentCardDeclined = 7, 34 | eSteamSubscriptionCancelledByUser = 8, 35 | eSteamSubscriptionCancelledByVendor = 9, 36 | eSteamSubscriptionPaymentCardUseLimit = 10, 37 | eSteamSubscriptionPaymentCardAlert = 11, 38 | eSteamSubscriptionFailed = 12, 39 | eSteamSubscriptionPaymentCardAVSFailure = 13, 40 | eSteamSubscriptionPaymentCardInsufficientFunds = 14, 41 | eSteamSubscriptionRestrictedCountry = 15, 42 | } ESteamSubscriptionStatus; 43 | 44 | 45 | #endif // ESTEAMSUBSCRIPTIONSTATUS_H 46 | -------------------------------------------------------------------------------- /MK1Hook/minhook/src/buffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MinHook - The Minimalistic API Hooking Library for x64/x86 3 | * Copyright (C) 2009-2017 Tsuda Kageyu. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 20 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #pragma once 30 | 31 | // Size of each memory slot. 32 | #if defined(_M_X64) || defined(__x86_64__) 33 | #define MEMORY_SLOT_SIZE 64 34 | #else 35 | #define MEMORY_SLOT_SIZE 32 36 | #endif 37 | 38 | VOID InitializeBuffer(VOID); 39 | VOID UninitializeBuffer(VOID); 40 | LPVOID AllocateBuffer(LPVOID pOrigin); 41 | VOID FreeBuffer(LPVOID pBuffer); 42 | BOOL IsExecutableAddress(LPVOID pAddress); 43 | -------------------------------------------------------------------------------- /MK1Hook/mk/MKScript.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "..\utils.h" 3 | #include "..\unreal\TArray.h" 4 | 5 | struct mko_function_info_mk12 { 6 | char pad[40]; 7 | TArray args; 8 | 9 | }; 10 | // from mkoasm 11 | #pragma pack(push, 1) 12 | struct mko_function_header_mk12 { 13 | int64 field0; 14 | char* functionName; // offset to string table in mko 15 | mko_function_info_mk12* functionInfo; 16 | int field24; 17 | int field28; 18 | int field32; 19 | int field36; 20 | int field40; 21 | int field44; 22 | int field48; 23 | int field52; 24 | }; 25 | #pragma pack(pop) 26 | 27 | struct MKScriptData { 28 | char pad[0xA0]; 29 | TArray script_string; 30 | }; 31 | 32 | 33 | class MKScript { 34 | public: 35 | char pad[0x18]; 36 | MKScriptData* scriptData; 37 | char _pad[152]; 38 | TArray functions; 39 | 40 | int GetFunctionID(unsigned int hash); 41 | int64 GetVariable(unsigned int hash); 42 | 43 | }; 44 | VALIDATE_OFFSET(MKScript, scriptData, 0x18); 45 | VALIDATE_OFFSET(MKScript, functions, 0xB8); 46 | VALIDATE_SIZE(mko_function_header_mk12, 56); 47 | 48 | MKScript* GetScript(const char* name); 49 | 50 | class MKScriptCharacterAction { 51 | public: 52 | }; 53 | class MKScriptCharacterAttackAction { 54 | public: 55 | }; 56 | 57 | MKScriptCharacterAction* Create_CharacterScriptAction(MKScript* script, unsigned int function); 58 | MKScriptCharacterAttackAction* Create_CharacterScriptAttackAction(int64 powerAttackDef, int64 characterParentObj, int unkNum); 59 | 60 | MKScriptCharacterAction* Alloc_ScriptCharacterAction(int size); 61 | 62 | void ProcessScriptDataFunction(int64 function, bool isSpecialMove); 63 | 64 | extern void(*orgRegisterSpecialMove)(int64 move, int a2); 65 | void RegisterSpecialMove_Hook(int64 move, int a2); 66 | 67 | extern void(*orgDataFunctionConstructor)(int64 a1, char* name, int64 a3, int64 a4, int a5); 68 | void DataFunctionConstructor_Hook(int64 a1, char* name, int64 a3, int64 a4, int a5); -------------------------------------------------------------------------------- /MK1Hook/steam/MatchMakingKeyValuePair.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef MATCHMAKINGKEYVALUEPAIR_H 18 | #define MATCHMAKINGKEYVALUEPAIR_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #ifdef _S4N_ 24 | #define strncpy(...) 25 | #else 26 | #include 27 | #include 28 | #endif 29 | 30 | struct MatchMakingKeyValuePair_t 31 | { 32 | MatchMakingKeyValuePair_t() { m_szKey[0] = m_szValue[0] = 0; } 33 | 34 | 35 | #ifdef _MSC_VER 36 | #pragma warning(push) 37 | #pragma warning(disable: 4996) 38 | #endif 39 | 40 | MatchMakingKeyValuePair_t( const char *pchKey, const char *pchValue ) 41 | { 42 | strncpy( m_szKey, pchKey, sizeof(m_szKey) ); // this is a public header, use basic c library string funcs only! 43 | m_szKey[ sizeof( m_szKey ) - 1 ] = '\0'; 44 | strncpy( m_szValue, pchValue, sizeof(m_szValue) ); 45 | m_szValue[ sizeof( m_szValue ) - 1 ] = '\0'; 46 | } 47 | 48 | #ifdef _MSC_VER 49 | #pragma warning(pop) 50 | #endif 51 | 52 | char m_szKey[ 256 ]; 53 | char m_szValue[ 256 ]; 54 | }; 55 | 56 | 57 | 58 | #endif // MATCHMAKINGKEYVALUEPAIR_H 59 | -------------------------------------------------------------------------------- /MK1Hook/steam/ContentServerCommon.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef CONTENTSERVERCOMMON_H 18 | #define CONTENTSERVERCOMMON_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | 24 | 25 | #define CLIENTCONTENTSERVER_INTERFACE_VERSION "CLIENTCONTENTSERVER_INTERFACE_VERSION001" 26 | 27 | #define STEAMCONTENTSERVER_INTERFACE_VERSION_001 "SteamContentServer001" 28 | #define STEAMCONTENTSERVER_INTERFACE_VERSION_002 "SteamContentServer002" 29 | 30 | 31 | 32 | typedef enum EConnectionPriority 33 | { 34 | k_EConnectionPriorityLow = 0, 35 | k_EConnectionPriorityMedium = 1, 36 | k_EConnectionPriorityHigh = 2, 37 | } EConnectionPriority; 38 | 39 | 40 | #pragma pack( push, 8 ) 41 | struct CSClientApprove_t 42 | { 43 | enum { k_iCallback = k_iSteamContentServerCallbacks + 1 }; 44 | 45 | CSteamID m_SteamID; 46 | uint32 m_uContentID; 47 | }; 48 | 49 | struct CSClientDeny_t 50 | { 51 | enum { k_iCallback = k_iSteamContentServerCallbacks + 2 }; 52 | 53 | CSteamID m_SteamID; 54 | uint32 m_uContentID; 55 | EDenyReason m_eDenyReason; 56 | }; 57 | #pragma pack( pop ) 58 | 59 | #endif // CONTENTSERVERCOMMON_H 60 | -------------------------------------------------------------------------------- /MK1Hook/steam/ISteamApps003.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ISTEAMAPPS003_H 18 | #define ISTEAMAPPS003_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #include "SteamTypes.h" 24 | #include "AppsCommon.h" 25 | 26 | //----------------------------------------------------------------------------- 27 | // Purpose: interface to app data 28 | //----------------------------------------------------------------------------- 29 | abstract_class ISteamApps003 30 | { 31 | public: 32 | virtual bool BIsSubscribed() = 0; 33 | virtual bool BIsLowViolence() = 0; 34 | virtual bool BIsCybercafe() = 0; 35 | virtual bool BIsVACBanned() = 0; 36 | virtual const char *GetCurrentGameLanguage() = 0; 37 | virtual const char *GetAvailableGameLanguages() = 0; 38 | 39 | // only use this member if you need to check ownership of another game related to yours, a demo for example 40 | virtual bool BIsSubscribedApp( AppId_t nAppID ) = 0; 41 | 42 | // Takes AppID of DLC and checks if the user owns the DLC & if the DLC is installed 43 | virtual bool BIsDlcInstalled( AppId_t nAppID ) = 0; 44 | }; 45 | 46 | 47 | #endif // ISTEAMAPPS003_H 48 | -------------------------------------------------------------------------------- /MK1Hook/steam/TSteamPaymentCardReceiptInfo.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef TSTEAMPAYMENTCARDRECEIPTINFO_H 18 | #define TSTEAMPAYMENTCARDRECEIPTINFO_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | typedef struct TSteamPaymentCardReceiptInfo 24 | { 25 | ESteamPaymentCardType eCardType; 26 | char szCardLastFourDigits[ STEAM_CARD_LASTFOURDIGITS_SIZE + 1 ]; 27 | char szCardHolderName[ STEAM_CARD_HOLDERNAME_SIZE + 1 ]; 28 | char szBillingAddress1[ STEAM_BILLING_ADDRESS1_SIZE + 1 ]; 29 | char szBillingAddress2[ STEAM_BILLING_ADDRESS2_SIZE + 1 ]; 30 | char szBillingCity[ STEAM_BILLING_CITY_SIZE + 1 ]; 31 | char szBillingZip[ STEAM_BILLING_ZIP_SIZE + 1 ]; 32 | char szBillingState[ STEAM_BILLING_STATE_SIZE + 1 ]; 33 | char szBillingCountry[ STEAM_BILLING_COUNTRY_SIZE + 1 ]; 34 | char szCardApprovalCode[ STEAM_CARD_APPROVAL_CODE_SIZE + 1 ]; 35 | char szTransDate[ STEAM_DATE_SIZE + 1 ]; 36 | char szTransTime[ STEAM_TIME_SIZE + 1 ]; 37 | unsigned int uPriceWithoutTax; 38 | unsigned int uTaxAmount; 39 | unsigned int uShippingCost; 40 | } TSteamPaymentCardReceiptInfo; 41 | 42 | 43 | #endif // TSTEAMPAYMENTCARDRECEIPTINFO_H 44 | -------------------------------------------------------------------------------- /MK1Hook/helper/eGamepadManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "..\gui\gui_impl.h" 5 | 6 | struct eGamepadAnalogInput { 7 | float x, y; 8 | }; 9 | 10 | enum eGamepad_ButtonID { 11 | BUTTON_A, 12 | BUTTON_B, 13 | BUTTON_X, 14 | BUTTON_Y, 15 | BUTTON_LEFT_SHOULDER, 16 | BUTTON_RIGHT_SHOULDER, 17 | BUTTON_BACK, 18 | BUTTON_START, 19 | BUTTON_LEFT_THUMB, 20 | BUTTON_RIGHT_THUMB, 21 | BUTTON_DPAD_UP, 22 | BUTTON_DPAD_DOWN, 23 | BUTTON_DPAD_LEFT, 24 | BUTTON_DPAD_RIGHT, 25 | BUTTON_DIGITAL_MAX, // store only digital buttons for booleans, more ids for last pressed key 26 | BUTTON_LEFT_STICK_UP, 27 | BUTTON_LEFT_STICK_DOWN, 28 | BUTTON_LEFT_STICK_RIGHT, 29 | BUTTON_LEFT_STICK_LEFT, 30 | BUTTON_RIGHT_STICK_UP, 31 | BUTTON_RIGHT_STICK_DOWN, 32 | BUTTON_RIGHT_STICK_RIGHT, 33 | BUTTON_RIGHT_STICK_LEFT, 34 | BUTTON_LEFT_TRIGGER, 35 | BUTTON_RIGHT_TRIGGER, 36 | BUTTON_MAX, 37 | 38 | }; 39 | 40 | 41 | struct eGamepadState { 42 | bool buttonState[BUTTON_MAX]; 43 | bool buttonStatePrev[BUTTON_MAX]; 44 | 45 | float leftTrigger; 46 | float rightTrigger; 47 | eGamepadAnalogInput leftStick; 48 | eGamepadAnalogInput rightStick; 49 | 50 | XINPUT_STATE rawState; 51 | 52 | int lastButton; 53 | }; 54 | 55 | class eGamepadManager { 56 | public: 57 | static eGamepadState ms_gamepadState; 58 | 59 | static uintptr_t pXInputGetStateFunc; 60 | static HMODULE hXInputDLL; 61 | 62 | static void Initialize(); 63 | static void Update(); 64 | static void UpdateImGui(); 65 | static void Reset(); 66 | 67 | static void ToggleMenuWithGamepad(); 68 | 69 | static void ProcessPad(int padNum = 0); 70 | static int GetState(eGamepad_ButtonID buttonID); 71 | static bool ButtonPressed(unsigned int button); 72 | static void SetState(eGamepad_ButtonID buttonID, bool state); 73 | static int GetNumPressedButtons(); 74 | static eGamepad_ButtonID GetLastButton(); 75 | 76 | static const char* ButtonToString(int buttonID); 77 | 78 | static void Shutdown(); 79 | }; 80 | 81 | DWORD WINAPI XInputGetState_Hook(DWORD dwUserIndex, XINPUT_STATE* pState); 82 | -------------------------------------------------------------------------------- /MK1Hook/helper/eKeyboardMan.cpp: -------------------------------------------------------------------------------- 1 | #include "eKeyboardMan.h" 2 | #include 3 | #include 4 | bool eKeyboardMan::ms_keyboardBuffer[VK_KEY_MAX]; 5 | bool eKeyboardMan::ms_keyboardBufferJustPressed[VK_KEY_MAX]; 6 | int eKeyboardMan::ms_lastKey = 0; 7 | 8 | eVKKeyCode eKeyboardMan::GetLastKey() 9 | { 10 | return (eVKKeyCode)ms_lastKey; 11 | } 12 | 13 | const char* eKeyboardMan::KeyToString(int code) 14 | { 15 | static char buff[128] = {}; 16 | UINT key = MapVirtualKey(code, MAPVK_VK_TO_VSC); 17 | 18 | int result = GetKeyNameTextA((key << 16), buff, sizeof(buff)); 19 | 20 | if (code == VK_UP) 21 | return "Up"; 22 | else if (code == VK_DOWN) 23 | return "Down"; 24 | else if (code == VK_LEFT) 25 | return "Left"; 26 | else if (code == VK_RIGHT) 27 | return "Right"; 28 | else if (result) 29 | return buff; 30 | else 31 | return "Unknown"; 32 | } 33 | 34 | void eKeyboardMan::SetKeyStatus(int vkKey, bool isDown) 35 | { 36 | if (!(vkKey >= 0 && vkKey < VK_KEY_MAX)) 37 | return; 38 | 39 | 40 | ms_keyboardBuffer[vkKey] = isDown; 41 | ms_keyboardBufferJustPressed[vkKey] = isDown; 42 | } 43 | 44 | void eKeyboardMan::SetLastPressedKey(int vkKey) 45 | { 46 | ms_lastKey = vkKey; 47 | } 48 | 49 | void eKeyboardMan::ResetKeys() 50 | { 51 | ZeroMemory(ms_keyboardBuffer, sizeof(ms_keyboardBuffer)); 52 | ZeroMemory(ms_keyboardBufferJustPressed, sizeof(ms_keyboardBufferJustPressed)); 53 | } 54 | 55 | int eKeyboardMan::GetKeyState(int vkKey) 56 | { 57 | if (!(vkKey >= 0 && vkKey < VK_KEY_MAX)) 58 | return 0; 59 | 60 | int state = 0x0; 61 | 62 | if (ms_keyboardBufferJustPressed[vkKey]) 63 | { 64 | state |= 0x1; 65 | ms_keyboardBufferJustPressed[vkKey] = false; 66 | } 67 | 68 | if (ms_keyboardBuffer[vkKey]) 69 | state |= 0x8000; 70 | 71 | 72 | return state; 73 | } 74 | 75 | int eKeyboardMan::GetNumPressedKeys() 76 | { 77 | int keys = 0; 78 | 79 | for (int i = 0; i < VK_KEY_MAX; i++) 80 | { 81 | if (GetKeyState(i)) 82 | keys++; 83 | } 84 | 85 | return keys; 86 | } 87 | 88 | void eKeyboardMan::OnFocusLost() 89 | { 90 | ResetKeys(); 91 | SetLastPressedKey(0); 92 | } 93 | -------------------------------------------------------------------------------- /MK1Hook/steam/IClientContentServer.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ICLIENTCONTENTSERVER_H 18 | #define ICLIENTCONTENTSERVER_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #include "SteamTypes.h" 24 | #include "ContentServerCommon.h" 25 | #include "UserCommon.h" 26 | 27 | 28 | abstract_class UNSAFE_INTERFACE IClientContentServer 29 | { 30 | virtual HSteamUser GetHSteamUser() = 0; 31 | 32 | STEAMWORKS_STRUCT_RETURN_0(CSteamID, GetSteamID) /*virtual CSteamID GetSteamID() = 0;*/ 33 | 34 | virtual void LogOn( uint32 uContentServerID ) = 0; 35 | virtual void LogOff() = 0; 36 | 37 | virtual bool BLoggedOn() = 0; 38 | virtual ELogonState GetLogonState() = 0; 39 | virtual bool BConnected() = 0; 40 | 41 | virtual int RaiseConnectionPriority( EConnectionPriority eConnectionPriority ) = 0; 42 | virtual void ResetConnectionPriority( int hRaiseConnectionPriorityPrev ) = 0; 43 | 44 | virtual void SetCellID( CellID_t cellID ) = 0; 45 | 46 | virtual bool SendClientContentAuthRequest( CSteamID steamID, uint32 unContentID, bool bUseToken, uint64 ulSessionToken, bool bTokenPresent ) = 0; 47 | virtual bool BCheckTicket( CSteamID steamID, uint32 uContentID, const void *pvTicketData, uint32 cubTicketLength ) = 0; 48 | }; 49 | 50 | #endif // ICLIENTCONTENTSERVER_H 51 | -------------------------------------------------------------------------------- /MK1Hook/steam/TSteamSubscription.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef TSTEAMSUBSCRIPTION_H 18 | #define TSTEAMSUBSCRIPTION_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | 24 | typedef enum EBillingType 25 | { 26 | eNoCost = 0, 27 | eBillOnceOnly = 1, 28 | eBillMonthly = 2, 29 | eProofOfPrepurchaseOnly = 3, 30 | eGuestPass = 4, 31 | eHardwarePromo = 5, 32 | eGift = 6, 33 | eAutoGrant = 7, 34 | OEMTicket = 8, 35 | eRecurringOption = 9, 36 | eNumBillingTypes = 10, 37 | } EBillingType; 38 | 39 | 40 | typedef struct TSteamSubscription 41 | { 42 | char* szName; 43 | unsigned int uMaxNameChars; 44 | unsigned int* puAppIds; 45 | unsigned int uMaxAppIds; 46 | unsigned int uId; 47 | unsigned int uNumApps; 48 | EBillingType eBillingType; 49 | unsigned int uCostInCents; 50 | unsigned int uNumDiscounts; 51 | int bIsPreorder; 52 | int bRequiresShippingAddress; 53 | unsigned int uDomesticShippingCostInCents; 54 | unsigned int uInternationalShippingCostInCents; 55 | bool bIsCyberCafeSubscription; 56 | unsigned int uGameCode; 57 | char szGameCodeDesc[STEAM_MAX_PATH]; 58 | bool bIsDisabled; 59 | bool bRequiresCD; 60 | unsigned int uTerritoryCode; 61 | bool bIsSteam3Subscription; 62 | } TSteamSubscription; 63 | 64 | 65 | #endif // TSTEAMSUBSCRIPTION_H 66 | -------------------------------------------------------------------------------- /MK1Hook/steam/ECurrencyCode.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ECURRENCYCODE_H 18 | #define ECURRENCYCODE_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | 24 | typedef enum ECurrencyCode 25 | { 26 | k_ECurrencyCodeInvalid = 0, 27 | k_ECurrencyCodeUSD = 1, 28 | k_ECurrencyCodeGBP = 2, 29 | k_ECurrencyCodeEUR = 3, 30 | k_ECurrencyCodeCHF = 4, 31 | k_ECurrencyCodeRUB = 5, 32 | k_ECurrencyCodePLN = 6, 33 | k_ECurrencyCodeBRL = 7, 34 | k_ECurrencyCodeJPY = 8, 35 | k_ECurrencyCodeNOK = 9, 36 | k_ECurrencyCodeIDR = 10, 37 | k_ECurrencyCodeMYR = 11, 38 | k_ECurrencyCodePHP = 12, 39 | k_ECurrencyCodeSGD = 13, 40 | k_ECurrencyCodeTHB = 14, 41 | k_ECurrencyCodeVND = 15, 42 | k_ECurrencyCodeKRW = 16, 43 | k_ECurrencyCodeTRY = 17, 44 | k_ECurrencyCodeUAH = 18, 45 | k_ECurrencyCodeMXN = 19, 46 | k_ECurrencyCodeCAD = 20, 47 | k_ECurrencyCodeAUD = 21, 48 | k_ECurrencyCodeNZD = 22, 49 | k_ECurrencyCodeCNY = 23, 50 | k_ECurrencyCodeINR = 24, 51 | k_ECurrencyCodeCLP = 25, 52 | k_ECurrencyCodePEN = 26, 53 | k_ECurrencyCodeCOP = 27, 54 | k_ECurrencyCodeZAR = 28, 55 | k_ECurrencyCodeHKD = 29, 56 | k_ECurrencyCodeTWD = 30, 57 | k_ECurrencyCodeSAR = 31, 58 | k_ECurrencyCodeAED = 32, 59 | //k_ECurrencyCodeMax = 33, 60 | } ECurrencyCode; 61 | 62 | #endif // ECURRENCYCODE_H 63 | -------------------------------------------------------------------------------- /MK1Hook/helper/eKeyboardMan.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum eVKKeyCode { 4 | VK_KEY_NULL = 0, 5 | VK_KEY_NONE = 254, 6 | VK_KEY_0 = 48, 7 | VK_KEY_1, 8 | VK_KEY_2, 9 | VK_KEY_3, 10 | VK_KEY_4, 11 | VK_KEY_5, 12 | VK_KEY_6, 13 | VK_KEY_7, 14 | VK_KEY_8, 15 | VK_KEY_9, 16 | VK_KEY_A = 65, 17 | VK_KEY_B, 18 | VK_KEY_C, 19 | VK_KEY_D, 20 | VK_KEY_E, 21 | VK_KEY_F, 22 | VK_KEY_G, 23 | VK_KEY_H, 24 | VK_KEY_I, 25 | VK_KEY_J, 26 | VK_KEY_K, 27 | VK_KEY_L, 28 | VK_KEY_M, 29 | VK_KEY_N, 30 | VK_KEY_O, 31 | VK_KEY_P, 32 | VK_KEY_Q, 33 | VK_KEY_R, 34 | VK_KEY_S, 35 | VK_KEY_T, 36 | VK_KEY_U, 37 | VK_KEY_V, 38 | VK_KEY_W, 39 | VK_KEY_X, 40 | VK_KEY_Y, 41 | VK_KEY_Z, 42 | 43 | VK_NUMPAD_0 = 96, 44 | VK_NUMPAD_1, 45 | VK_NUMPAD_2, 46 | VK_NUMPAD_3, 47 | VK_NUMPAD_4, 48 | VK_NUMPAD_5, 49 | VK_NUMPAD_6, 50 | VK_NUMPAD_7, 51 | VK_NUMPAD_8, 52 | VK_NUMPAD_9, 53 | 54 | VK_BACKSPACE = 8, 55 | VK_ENTER = 13, 56 | VK_CTRL = 17, 57 | VK_ALT = 18, 58 | VK_CAPS_LOCK = 20, 59 | VK_PAGE_UP = 33, 60 | VK_PAGE_DOWN = 34, 61 | VK_LEFT_ARROW = 37, 62 | VK_UP_ARROW = 38, 63 | VK_RIGHT_ARROW = 39, 64 | VK_DOWN_ARROW = 40, 65 | VK_LEFT_META = 91, 66 | VK_RIGHT_META = 92, 67 | VK_NUM_LOCK = 144, 68 | VK_SCROLL_LOCK = 145, 69 | VK_SEMICOLON = 186, 70 | VK_EQUALS = 187, 71 | VK_COMMA = 188, 72 | VK_DASH = 189, 73 | VK_PERIOD = 190, 74 | VK_FORWARD_SLASH = 191, 75 | VK_GRAVE_ACCENT = 192, 76 | VK_OPEN_BRACKET = 219, 77 | VK_BACK_SLASH = 220, 78 | VK_CLOSE_BRACKET = 221, 79 | VK_SINGLE_QUOTE = 222, 80 | 81 | VK_KEY_MAX = 256 82 | }; 83 | 84 | 85 | class eKeyboardMan { 86 | public: 87 | 88 | static bool ms_keyboardBuffer[VK_KEY_MAX]; 89 | static bool ms_keyboardBufferJustPressed[VK_KEY_MAX]; 90 | 91 | static int ms_lastKey; 92 | 93 | static eVKKeyCode GetLastKey(); 94 | static const char* KeyToString(int vkKey); 95 | 96 | static void SetKeyStatus(int vkKey, bool isDown); 97 | static void SetLastPressedKey(int vkKey); 98 | static void ResetKeys(); 99 | 100 | static int GetKeyState(int vkKey); 101 | static int GetNumPressedKeys(); 102 | 103 | static void OnFocusLost(); 104 | }; -------------------------------------------------------------------------------- /MK1Hook/steam/IClientDeviceAuth.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ICLIENTDEVICEAUTH_H 18 | #define ICLIENTDEVICEAUTH_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #include "SteamTypes.h" 24 | 25 | #define CLIENTDEVICEAUTH_INTERFACE_VERSION "CLIENTDEVICEAUTH_INTERFACE_VERSION001" 26 | 27 | abstract_class UNSAFE_INTERFACE IClientDeviceAuth 28 | { 29 | public: 30 | virtual uint64 AuthorizeLocalDevice( const char * pubUnk, uint32 cubUnk ) = 0; 31 | virtual uint64 DeauthorizeLocalDevice( uint32 uUnk) = 0; 32 | 33 | virtual uint64 DeauthorizeRemoteDevice( uint64 uUnk ) = 0; 34 | virtual uint64 RequestAuthorizationInfos() = 0; 35 | virtual uint32 GetDeviceAuthorizations( uint64 *, uint32, bool) = 0; 36 | virtual bool GetDeviceAuthorizationInfo( uint64, uint32 *, uint32 *, bool *, char *, int32, char *, int32, char *, int32, uint32 *) = 0; 37 | 38 | virtual uint32 GetAuthorizedBorrowsers( uint32 *, uint32 ) = 0; 39 | virtual uint32 GetLocalUsers( uint32 *, uint32 ) = 0; 40 | virtual bool GetBorrowserInfo( uint32, char *, int32, bool * ) = 0; 41 | virtual uint64 UpateAuthorizedBorrowers( const uint32 *, uint32, bool ) = 0; 42 | 43 | virtual uint32 GetSharedLibraryLockedBy( uint32 uUnk ) = 0; 44 | virtual uint32 GetSharedLibraryOwners( uint32 *, uint32 ) = 0; 45 | }; 46 | 47 | #endif // ICLIENTDEVICEAUTH_H 48 | -------------------------------------------------------------------------------- /MK1Hook/steam/ISteamController001.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ISTEAMCONTROLLER001_H 18 | #define ISTEAMCONTROLLER001_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #include "SteamTypes.h" 24 | #include "ControllerCommon.h" 25 | 26 | abstract_class ISteamController001 27 | { 28 | public: 29 | // 30 | // Native controller support API 31 | // 32 | 33 | // Must call init and shutdown when starting/ending use of the interface 34 | virtual bool Init(const char *pchAbsolutePathToControllerConfigVDF) = 0; 35 | virtual bool Shutdown() = 0; 36 | 37 | // Pump callback/callresult events, SteamAPI_RunCallbacks will do this for you, 38 | // normally never need to call directly. 39 | virtual void RunFrame() = 0; 40 | 41 | // Get the state of the specified controller, returns false if that controller is not connected 42 | virtual bool GetControllerState(uint32 unControllerIndex, SteamControllerState_t *pState) = 0; 43 | 44 | // Trigger a haptic pulse on the controller 45 | virtual void TriggerHapticPulse(uint32 unControllerIndex, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec) = 0; 46 | 47 | // Set the override mode which is used to choose to use different base/legacy bindings from your config file 48 | virtual void SetOverrideMode(const char *pchMode) = 0; 49 | 50 | }; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /MK1Hook/steam/ISteamGameCoordinator001.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ISTEAMGAMECOORDINATOR001_H 18 | #define ISTEAMGAMECOORDINATOR001_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #include "SteamTypes.h" 24 | #include "GameCoordinatorCommon.h" 25 | 26 | //----------------------------------------------------------------------------- 27 | // Purpose: Functions for sending and receiving messages from the Game Coordinator 28 | // for this application 29 | //----------------------------------------------------------------------------- 30 | abstract_class ISteamGameCoordinator001 31 | { 32 | public: 33 | 34 | // sends a message to the Game Coordinator 35 | virtual EGCResults SendMessage( uint32 unMsgType, const void *pubData, uint32 cubData ) = 0; 36 | 37 | // returns true if there is a message waiting from the game coordinator 38 | virtual bool IsMessageAvailable( uint32 *pcubMsgSize ) = 0; 39 | 40 | // fills the provided buffer with the first message in the queue and returns k_EGCResultOK or 41 | // returns k_EGCResultNoMessage if there is no message waiting. pcubMsgSize is filled with the message size. 42 | // If the provided buffer is not large enough to fit the entire message, k_EGCResultBufferTooSmall is returned 43 | // and the message remains at the head of the queue. 44 | virtual EGCResults RetrieveMessage( uint32 *punMsgType, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize ) = 0; 45 | 46 | }; 47 | 48 | #endif // ISTEAMGAMECOORDINATOR001_H 49 | -------------------------------------------------------------------------------- /MK1Hook/steam/IClientApps.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ICLIENTAPPS_H 18 | #define ICLIENTAPPS_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #include "SteamTypes.h" 24 | #include "AppsCommon.h" 25 | 26 | 27 | abstract_class UNSAFE_INTERFACE IClientApps 28 | { 29 | public: 30 | // returns 0 if the key does not exist 31 | // this may be true on first call, since the app data may not be cached locally yet 32 | // If you expect it to exists wait for the AppDataChanged_t after the first failure and ask again 33 | virtual int32 GetAppData( AppId_t unAppID, const char *pchKey, char *pchValue, int32 cchValueMax ) = 0; 34 | 35 | virtual bool SetLocalAppConfig( AppId_t unAppID, uint8 *pchBuffer, int32 cbBuffer ) = 0; 36 | 37 | virtual AppId_t GetInternalAppIDFromGameID( CGameID nGameID ) = 0; 38 | 39 | virtual int32 GetAllOwnedMultiplayerApps( uint32 *punAppIDs, int32 cAppIDsMax ) = 0; 40 | 41 | virtual int32 GetAppDataSection( AppId_t unAppID, EAppInfoSection eSection, uint8 *pchBuffer, int32 cbBufferMax, bool bSharedKVSymbols ) = 0; 42 | virtual bool RequestAppInfoUpdate( const AppId_t *pAppIDs, int32 nNumAppIDs ) = 0; 43 | 44 | virtual void NotifyAppEventTriggered( AppId_t unAppID, EAppEvent eAppEvent ) = 0; 45 | 46 | virtual int32 GetDLCCount( AppId_t unAppID ) = 0; 47 | virtual bool BGetDLCDataByIndex( AppId_t unAppID, int32 iDLC, AppId_t* pDlcAppID, bool *pbAvailable, char *pchName, int32 cchNameBufferSize ) = 0; 48 | }; 49 | 50 | #endif // ICLIENTAPPS_H 51 | -------------------------------------------------------------------------------- /MK1Hook/mk/MKModifier.cpp: -------------------------------------------------------------------------------- 1 | #include "MKModifier.h" 2 | #include "../unreal/FName.h" 3 | #include "Engine.h" 4 | 5 | void(*pGlobalModifier_Constructor)(GlobalModifier*, wchar_t*, float) = nullptr; 6 | void(*pTeamModifier_Constructor)(TeamModifier*, wchar_t*, float) = nullptr; 7 | 8 | GlobalModifier::GlobalModifier() 9 | { 10 | } 11 | 12 | GlobalModifier::GlobalModifier(FString name, float level) 13 | { 14 | if (pGlobalModifier_Constructor) 15 | pGlobalModifier_Constructor(this, name.GetStr(), level); 16 | } 17 | 18 | void MKModifier::ActivateModifier(int64 fightObject, const char* name) 19 | { 20 | TArray& list = *(TArray*)(fightObject + 0x158); 21 | 22 | int currentNum = list.Count; 23 | currentNum++; 24 | 25 | static uintptr_t pat = _pattern(PATID_TArray_Resize); 26 | if (pat) 27 | ((void(__fastcall*)(int64, int, int))pat)((int64)&list.Data, currentNum, sizeof(GlobalModifier)); 28 | 29 | FName modifierPath(name, FNAME_Add, 1); 30 | FString str; 31 | modifierPath.ToString(&str); 32 | 33 | GlobalModifier modifier(str, 1.0f); 34 | list.Add(modifier); 35 | } 36 | 37 | void MKModifier::ActivateModifier(const char* name, PLAYER_NUM player) 38 | { 39 | TEAM_NUM teamNum = TEAM1; 40 | if (player == PLAYER2) 41 | teamNum = TEAM2; 42 | 43 | FightingTeamDefinition* team = GetGameInfo()->GetTeam(teamNum); 44 | 45 | if (!team) 46 | return; 47 | 48 | static int teamModifierListOffset = 0; 49 | 50 | if (teamModifierListOffset == 0) 51 | { 52 | int64 pat = _pattern(PATID_TeamModifiersOffset); 53 | if (pat) 54 | teamModifierListOffset = *(int*)(pat) + sizeof(int64); 55 | } 56 | 57 | if (!teamModifierListOffset) 58 | return; 59 | 60 | TArray& list = *(TArray*)((int64)team + teamModifierListOffset); 61 | 62 | int currentNum = list.Count; 63 | currentNum++; 64 | 65 | static uintptr_t pat = _pattern(PATID_TArray_Resize); 66 | if (pat) 67 | ((void(__fastcall*)(int64, int, int))pat)((int64)&list.Data, currentNum, sizeof(GlobalModifier)); 68 | 69 | FName modifierPath(name, FNAME_Add, 1); 70 | FString str; 71 | modifierPath.ToString(&str); 72 | 73 | TeamModifier modifier(str, 1.0f); 74 | list.Add(modifier); 75 | } 76 | 77 | TeamModifier::TeamModifier() 78 | { 79 | } 80 | 81 | TeamModifier::TeamModifier(FString name, float level) 82 | { 83 | if (pTeamModifier_Constructor) 84 | pTeamModifier_Constructor(this, name.GetStr(), level); 85 | } 86 | -------------------------------------------------------------------------------- /MK1Hook/steam/ISteamRemoteStorage002.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ISTEAMREMOTESTORAGE002_H 18 | #define ISTEAMREMOTESTORAGE002_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #include "SteamTypes.h" 24 | #include "RemoteStorageCommon.h" 25 | 26 | //----------------------------------------------------------------------------- 27 | // Purpose: Functions for accessing, reading and writing files stored remotely 28 | // and cached locally 29 | //----------------------------------------------------------------------------- 30 | abstract_class ISteamRemoteStorage002 31 | { 32 | public: 33 | // NOTE 34 | // 35 | // Filenames are case-insensitive, and will be converted to lowercase automatically. 36 | // So "foo.bar" and "Foo.bar" are the same file, and if you write "Foo.bar" then 37 | // iterate the files, the filename returned will be "foo.bar". 38 | // 39 | 40 | // file operations 41 | virtual bool FileWrite( const char *pchFile, const void *pvData, int32 cubData ) = 0; 42 | virtual int32 GetFileSize( const char *pchFile ) = 0; 43 | virtual int32 FileRead( const char *pchFile, void *pvData, int32 cubDataToRead ) = 0; 44 | virtual bool FileExists( const char *pchFile ) = 0; 45 | 46 | // iteration 47 | virtual int32 GetFileCount() = 0; 48 | virtual const char *GetFileNameAndSize( int iFile, int32 *pnFileSizeInBytes ) = 0; 49 | 50 | // quota management 51 | virtual bool GetQuota( int32 *pnTotalBytes, int32 *puAvailableBytes ) = 0; 52 | }; 53 | 54 | #endif // ISTEAMREMOTESTORAGE_H 55 | -------------------------------------------------------------------------------- /MK1Hook/steam/ClientCommon.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef CLIENTCOMMON_H 18 | #define CLIENTCOMMON_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | // interface predec 24 | class ISteamClient; 25 | class ISteamUser; 26 | class ISteamGameServer; 27 | class ISteamFriends; 28 | class ISteamUtils; 29 | class ISteamMatchmaking; 30 | class ISteamContentServer; 31 | class ISteamMasterServerUpdater; 32 | class ISteamMatchmakingServers; 33 | class ISteam2Bridge; 34 | class ISteamUserStats; 35 | class ISteamApps; 36 | class ISteamBilling; 37 | class IVAC; 38 | class ISteamNetworking; 39 | class ISteamRemoteStorage; 40 | class ISteamGameServerItems; 41 | class ISteamGameServerStats; 42 | class ISteamHTTP; 43 | class ISteamScreenshots; 44 | class ISteamUnifiedMessages; 45 | class ISteamController; 46 | class ISteamUGC; 47 | class ISteamAppList; 48 | class ISteamMusic; 49 | class ISteamMusicRemote; 50 | class ISteamHTMLSurface; 51 | class ISteamInventory; 52 | class ISteamVideo; 53 | 54 | 55 | #define CLIENTENGINE_INTERFACE_VERSION "CLIENTENGINE_INTERFACE_VERSION004" 56 | 57 | 58 | #define STEAMCLIENT_INTERFACE_VERSION_006 "SteamClient006" 59 | #define STEAMCLIENT_INTERFACE_VERSION_007 "SteamClient007" 60 | #define STEAMCLIENT_INTERFACE_VERSION_008 "SteamClient008" 61 | #define STEAMCLIENT_INTERFACE_VERSION_009 "SteamClient009" 62 | #define STEAMCLIENT_INTERFACE_VERSION_010 "SteamClient010" 63 | #define STEAMCLIENT_INTERFACE_VERSION_011 "SteamClient011" 64 | #define STEAMCLIENT_INTERFACE_VERSION_012 "SteamClient012" 65 | #define STEAMCLIENT_INTERFACE_VERSION_017 "SteamClient017" 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /MK1Hook/steam/ISteam2Bridge001.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ISTEAM2BRIDGE001_H 18 | #define ISTEAM2BRIDGE001_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #include "SteamTypes.h" 24 | #include "BridgeCommon.h" 25 | 26 | abstract_class ISteam2Bridge001 27 | { 28 | public: 29 | virtual void SetSteam2Ticket( uint8 *pubTicket, int cubTicket ) = 0; 30 | 31 | virtual bool SetAccountName( const char *pchAccountName ) = 0; 32 | virtual bool SetPassword( const char *pchPassword ) = 0; 33 | virtual bool SetAccountCreationTime( RTime32 rt ) = 0; 34 | 35 | virtual bool CreateProcess( void *lpVACBlob, uint32 cbBlobSize, char const *lpApplicationName, char *lpCommandLine, uint32 dwCreationFlags, void *lpEnvironment, char *lpCurrentDirectory, uint32 nGameID ) = 0; 36 | 37 | virtual EUniverse GetConnectedUniverse() = 0; 38 | virtual const char *GetIPCountry() = 0; 39 | 40 | virtual uint32 GetNumLicenses() = 0; 41 | 42 | virtual int32 GetLicensePackageID( uint32 nLicenseIndex ) = 0; 43 | virtual RTime32 GetLicenseTimeCreated( uint32 nLicenseIndex ) = 0; 44 | virtual RTime32 GetLicenseTimeNextProcess( uint32 nLicenseIndex ) = 0; 45 | virtual int32 GetLicenseMinuteLimit( uint32 nLicenseIndex ) = 0; 46 | virtual int32 GetLicenseMinutesUsed( uint32 nLicenseIndex ) = 0; 47 | virtual EPaymentMethod GetLicensePaymentMethod( uint32 nLicenseIndex ) = 0; 48 | virtual ELicenseFlags GetLicenseFlags( uint32 nLicenseIndex ) = 0; 49 | virtual const char *GetLicensePurchaseCountryCode( uint32 nLicenseIndex ) = 0; 50 | 51 | virtual bool SetOfflineMode( bool bOffline ) = 0; 52 | }; 53 | 54 | #endif // ISTEAM2BRIDGE001_H 55 | -------------------------------------------------------------------------------- /MK1Hook/steam/TSteamElemInfo.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef TSTEAMELEMINFO_H 18 | #define TSTEAMELEMINFO_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | typedef struct TSteamElemInfo 24 | { 25 | int bIsDir; /* If non-zero, element is a directory; if zero, element is a file */ 26 | unsigned int uSizeOrCount; /* If element is a file, this contains size of file in bytes */ 27 | int bIsLocal; /* If non-zero, reported item is a standalone element on local filesystem */ 28 | char cszName[STEAM_MAX_PATH]; /* Base element name (no path) */ 29 | long lLastAccessTime; /* Seconds since 1/1/1970 (like time_t) when element was last accessed */ 30 | long lLastModificationTime; /* Seconds since 1/1/1970 (like time_t) when element was last modified */ 31 | long lCreationTime; /* Seconds since 1/1/1970 (like time_t) when element was created */ 32 | } TSteamElemInfo; 33 | 34 | typedef struct TSteamElemInfo64 35 | { 36 | int bIsDir; /* If non-zero, element is a directory; if zero, element is a file */ 37 | unsigned long long ullSizeOrCount; /* If element is a file, this contains size of file in bytes */ 38 | int bIsLocal; /* If non-zero, reported item is a standalone element on local filesystem */ 39 | char cszName[STEAM_MAX_PATH]; /* Base element name (no path) */ 40 | long long llLastAccessTime; /* Seconds since 1/1/1970 (like time_t) when element was last accessed */ 41 | long long llLastModificationTime; /* Seconds since 1/1/1970 (like time_t) when element was last modified */ 42 | long long llCreationTime; /* Seconds since 1/1/1970 (like time_t) when element was created */ 43 | } TSteamElemInfo64; 44 | 45 | #endif // TSTEAMELEMINFO_H 46 | -------------------------------------------------------------------------------- /MK1Hook/unreal/FMatrix.cpp: -------------------------------------------------------------------------------- 1 | #include "FMatrix.h" 2 | #include "FMath.h" 3 | 4 | FMatrix::FMatrix() 5 | { 6 | } 7 | 8 | FMatrix::FMatrix(FRotator* Rot) 9 | { 10 | float v2; 11 | float v3; 12 | float v4; 13 | float v5; 14 | float v6; 15 | float v7; 16 | float v8; 17 | float v9; 18 | float CR; 19 | float v12; 20 | float SY; 21 | float CY; 22 | float CP; 23 | float SR; 24 | 25 | SR = GMath.TrigFLOAT[(Rot->Roll >> 2) & 0x3FFF]; 26 | v12 = GMath.TrigFLOAT[(Rot->Pitch >> 2) & 0x3FFF]; 27 | SY = GMath.TrigFLOAT[(Rot->Yaw >> 2) & 0x3FFF]; 28 | CR = GMath.TrigFLOAT[((Rot->Roll + 0x4000) >> 2) & 0x3FFF]; 29 | CP = GMath.TrigFLOAT[((Rot->Pitch + 0x4000) >> 2) & 0x3FFF]; 30 | CY = GMath.TrigFLOAT[((Rot->Yaw + 0x4000) >> 2) & 0x3FFF]; 31 | v2 = CP * CY; 32 | this->M[0][0] = v2; 33 | v3 = CP * SY; 34 | this->M[0][1] = v3; 35 | this->M[0][2] = v12; 36 | this->M[0][3] = 0.0f; 37 | v4 = SR * v12 * CY - CR * SY; 38 | this->M[1][0] = v4; 39 | v5 = SR * v12 * SY + CR * CY; 40 | this->M[1][1] = v5; 41 | v6 = (-0.0f - SR) * CP; 42 | this->M[1][2] = v6; 43 | this->M[1][3] = 0.0f; 44 | v7 = -0.0f - (CR * v12 * CY + SR * SY); 45 | this->M[2][0] = v7; 46 | v8 = CY * SR - CR * v12 * SY; 47 | this->M[2][1] = v8; 48 | v9 = CR * CP; 49 | this->M[2][2] = v9; 50 | this->M[2][3] = 0.0f; 51 | this->M[3][0] = 0.0f; 52 | this->M[3][1] = 0.0f; 53 | this->M[3][2] = 0.0f; 54 | this->M[3][3] = 1.0f; 55 | } 56 | 57 | void FMatrix::MakeFromX(FVector* XAxis) 58 | { 59 | static uintptr_t pat = _pattern(PATID_FMatrix_MakeFromX); 60 | if (pat) 61 | ((void(__fastcall*)(FMatrix*, FVector*))pat)(this, XAxis); 62 | } 63 | 64 | void FMatrix::Rotator(FVector* result) 65 | { 66 | static uintptr_t pat = _pattern(PATID_FMatrix_Rotator); 67 | if (pat) 68 | ((void(__fastcall*)(FMatrix*, FVector*))pat)(this, result); 69 | } 70 | 71 | FVector FMatrix::GetRight() 72 | { 73 | return { M[1][0], M[1][1],M[1][2] }; 74 | } 75 | 76 | FVector FMatrix::GetForward() 77 | { 78 | return { M[0][0], M[0][1],M[0][2] }; 79 | } 80 | 81 | FVector FMatrix::GetUp() 82 | { 83 | return { M[2][0], M[2][1],M[2][2] }; 84 | } 85 | 86 | FVector FMatrix::GetPos() 87 | { 88 | return { M[3][0], M[3][1],M[3][2] }; 89 | } 90 | 91 | FVector FindLookAtRotation(FVector* start, FVector* target) 92 | { 93 | FVector out; 94 | out.X = target->X - start->X; 95 | out.Y = target->Y - start->Y; 96 | out.Z = target->Z - start->Z; 97 | FMatrix mat; 98 | mat.MakeFromX(&out); 99 | FVector result; 100 | mat.Rotator(&result); 101 | return result; 102 | } 103 | -------------------------------------------------------------------------------- /MK1Hook/steam/TSteamPaymentCardInfo.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef TSTEAMPAYMENTCARDINFO_H 18 | #define TSTEAMPAYMENTCARDINFO_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | typedef struct TSteamPaymentCardInfo 24 | { 25 | ESteamPaymentCardType eCardType; 26 | char szCardNumber[ STEAM_CARD_NUMBER_SIZE +1 ]; 27 | char szCardHolderName[ STEAM_CARD_HOLDERNAME_SIZE + 1]; 28 | char szCardExpYear[ STEAM_CARD_EXPYEAR_SIZE + 1 ]; 29 | char szCardExpMonth[ STEAM_CARD_EXPMONTH_SIZE+ 1 ]; 30 | char szCardCVV2[ STEAM_CARD_CVV2_SIZE + 1 ]; 31 | char szBillingAddress1[ STEAM_BILLING_ADDRESS1_SIZE + 1 ]; 32 | char szBillingAddress2[ STEAM_BILLING_ADDRESS2_SIZE + 1 ]; 33 | char szBillingCity[ STEAM_BILLING_CITY_SIZE + 1 ]; 34 | char szBillingZip[ STEAM_BILLING_ZIP_SIZE + 1 ]; 35 | char szBillingState[ STEAM_BILLING_STATE_SIZE + 1 ]; 36 | char szBillingCountry[ STEAM_BILLING_COUNTRY_SIZE + 1 ]; 37 | char szBillingPhone[ STEAM_BILLING_PHONE_SIZE + 1 ]; 38 | char szBillingEmailAddress[ STEAM_BILLING_EMAIL_SIZE + 1 ]; 39 | unsigned int uExpectedCostInCents; 40 | unsigned int uExpectedTaxInCents; 41 | char szShippingName[ STEAM_CARD_HOLDERNAME_SIZE + 1 ]; 42 | char szShippingAddress1[ STEAM_BILLING_ADDRESS1_SIZE + 1 ]; 43 | char szShippingAddress2[ STEAM_BILLING_ADDRESS2_SIZE + 1 ]; 44 | char szShippingCity[ STEAM_BILLING_CITY_SIZE + 1 ]; 45 | char szShippingZip[ STEAM_BILLING_ZIP_SIZE + 1 ]; 46 | char szShippingState[ STEAM_BILLING_STATE_SIZE + 1 ]; 47 | char szShippingCountry[ STEAM_BILLING_COUNTRY_SIZE + 1 ]; 48 | char szShippingPhone[ STEAM_BILLING_PHONE_SIZE + 1]; 49 | unsigned int uExpectedShippingCostInCents; 50 | } TSteamPaymentCardInfo; 51 | 52 | 53 | #endif // TSTEAMPAYMENTCARDINFO_H 54 | -------------------------------------------------------------------------------- /MK1Hook/gui/gui_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "const.h" 8 | #include "..\plugin\PluginInterface.h" 9 | #include "..\plugin\SteamAPI.h" 10 | 11 | enum GUIImplementationMode { 12 | GIM_DX11 = 1, 13 | GIM_DX12 14 | }; 15 | 16 | class GUIImplementation { 17 | public: 18 | static bool ms_bInit; 19 | static bool ms_bFailed; 20 | static bool ms_bShouldReloadFonts; 21 | static bool ms_bShouldRefreshRenderTarget; 22 | static HWND ms_hWindow; 23 | static WNDPROC ms_pWndProc; 24 | static ID3D11RenderTargetView* ms_pRenderTarget; 25 | static GUIImplementationMode ms_mode; 26 | // dx11 27 | static ID3D11DeviceContext* ms_cachedContext; 28 | // dx12 29 | static ID3D12DescriptorHeap* g_pd3dRtvDescHeap; 30 | static ID3D12DescriptorHeap* g_pd3dSrvDescHeap; 31 | static ID3D12CommandQueue* g_pd3dCommandQueue; 32 | static ID3D12GraphicsCommandList* g_pd3dCommandList; 33 | 34 | struct GFrameContext { 35 | ID3D12Resource* g_mainRenderTargetResource; 36 | D3D12_CPU_DESCRIPTOR_HANDLE g_mainRenderTargetDescriptor; 37 | ID3D12CommandAllocator* g_commandAllocator; 38 | }; 39 | 40 | static std::vector frameContextData; 41 | static int numBuffers; 42 | 43 | static void Init(GUIImplementationMode mode); 44 | static void Shutdown(); 45 | static bool ImGui_InitDX12(IDXGISwapChain* pSwapChain, HWND hWindow); 46 | static void ImGui_SetupRenderTargetsDX12(IDXGISwapChain* pSwapChain); 47 | static void ImGui_DeleteRenderTargetsDX12(IDXGISwapChain* pSwapChain); 48 | static void ImGui_Reload(IDXGISwapChain* pSwapChain); 49 | 50 | static void ImGui_SetStyle(); 51 | static void ImGui_ReloadFont(); 52 | 53 | static void OnPresent(IDXGISwapChain3* pSwapChain); 54 | static void OnPresent_GUIStart(IDXGISwapChain* pSwapChain); 55 | 56 | static void ImGui_Process(ID3D11DeviceContext* pContext); 57 | static void ImGui_ProcessDX12(IDXGISwapChain3* pSwapChain); 58 | 59 | static void Gamepad_Process(); 60 | static void Gamepad_Reset(); 61 | static void GUI_Process(); 62 | 63 | static void OnBeforeResize(IDXGISwapChain* pSwapChain, UINT BufferCount, UINT Width, UINT Height, DXGI_FORMAT NewFormat, UINT SwapChainFlags); 64 | static void OnAfterResize(IDXGISwapChain* pSwapChain, UINT BufferCount, UINT Width, UINT Height, DXGI_FORMAT NewFormat, UINT SwapChainFlags); 65 | 66 | 67 | static float GetDeltaTime(); 68 | static void RequestFontReload(); 69 | 70 | static LRESULT WINAPI WndProc(const HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 71 | }; 72 | 73 | extern LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /MK1Hook/steam/GameStatsCommon.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef GAMESTATSCOMMON_H 18 | #define GAMESTATSCOMMON_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | 24 | 25 | #define STEAMGAMESTATS_INTERFACE_VERSION_001 "SteamGameStats001" 26 | 27 | #define CLIENTGAMESTATS_INTERFACE_VERSION "CLIENTGAMESTATS_INTERFACE_VERSION001" 28 | 29 | 30 | 31 | //----------------------------------------------------------------------------- 32 | // Purpose: nAccountType for GetNewSession 33 | //----------------------------------------------------------------------------- 34 | enum EGameStatsAccountType 35 | { 36 | k_EGameStatsAccountType_Steam = 1, // ullAccountID is a 64-bit SteamID for a player 37 | k_EGameStatsAccountType_Xbox = 2, // ullAccountID is a 64-bit XUID 38 | k_EGameStatsAccountType_SteamGameServer = 3, // ullAccountID is a 64-bit SteamID for a game server 39 | }; 40 | 41 | 42 | 43 | #pragma pack( push, 8 ) 44 | //----------------------------------------------------------------------------- 45 | // Purpose: callback for GetNewSession() method 46 | //----------------------------------------------------------------------------- 47 | struct GameStatsSessionIssued_t 48 | { 49 | enum { k_iCallback = k_iSteamGameStatsCallbacks + 1 }; 50 | 51 | uint64 m_ulSessionID; 52 | EResult m_eResult; 53 | bool m_bCollectingAny; 54 | bool m_bCollectingDetails; 55 | }; 56 | 57 | 58 | //----------------------------------------------------------------------------- 59 | // Purpose: callback for EndSession() method 60 | //----------------------------------------------------------------------------- 61 | struct GameStatsSessionClosed_t 62 | { 63 | enum { k_iCallback = k_iSteamGameStatsCallbacks + 2 }; 64 | 65 | uint64 m_ulSessionID; 66 | EResult m_eResult; 67 | }; 68 | #pragma pack( pop ) 69 | 70 | 71 | 72 | #endif // GAMESTATSCOMMON_H 73 | -------------------------------------------------------------------------------- /MK1Hook/gui/imgui/imgui_impl_dx12.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for DirectX12 2 | // This needs to be used along with a Platform Backend (e.g. Win32) 3 | 4 | // Implemented features: 5 | // [X] Renderer: User texture binding. Use 'D3D12_GPU_DESCRIPTOR_HANDLE' as ImTextureID. Read the FAQ about ImTextureID! 6 | // [X] Renderer: Large meshes support (64k+ vertices) with 16-bit indices. 7 | 8 | // Important: to compile on 32-bit systems, this backend requires code to be compiled with '#define ImTextureID ImU64'. 9 | // See imgui_impl_dx12.cpp file for details. 10 | 11 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 12 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 13 | // Learn about Dear ImGui: 14 | // - FAQ https://dearimgui.com/faq 15 | // - Getting Started https://dearimgui.com/getting-started 16 | // - Documentation https://dearimgui.com/docs (same as your local docs/ folder). 17 | // - Introduction, links and more at the top of imgui.cpp 18 | 19 | #pragma once 20 | #include "imgui.h" // IMGUI_IMPL_API 21 | #ifndef IMGUI_DISABLE 22 | #include // DXGI_FORMAT 23 | 24 | struct ID3D12Device; 25 | struct ID3D12DescriptorHeap; 26 | struct ID3D12GraphicsCommandList; 27 | struct D3D12_CPU_DESCRIPTOR_HANDLE; 28 | struct D3D12_GPU_DESCRIPTOR_HANDLE; 29 | 30 | // Follow "Getting Started" link and check examples/ folder to learn about using backends! 31 | 32 | // cmd_list is the command list that the implementation will use to render imgui draw lists. 33 | // Before calling the render function, caller must prepare cmd_list by resetting it and setting the appropriate 34 | // render target and descriptor heap that contains font_srv_cpu_desc_handle/font_srv_gpu_desc_handle. 35 | // font_srv_cpu_desc_handle and font_srv_gpu_desc_handle are handles to a single SRV descriptor to use for the internal font texture. 36 | IMGUI_IMPL_API bool ImGui_ImplDX12_Init(ID3D12Device* device, int num_frames_in_flight, DXGI_FORMAT rtv_format, ID3D12DescriptorHeap* cbv_srv_heap, 37 | D3D12_CPU_DESCRIPTOR_HANDLE font_srv_cpu_desc_handle, D3D12_GPU_DESCRIPTOR_HANDLE font_srv_gpu_desc_handle); 38 | IMGUI_IMPL_API void ImGui_ImplDX12_Shutdown(); 39 | IMGUI_IMPL_API void ImGui_ImplDX12_NewFrame(); 40 | IMGUI_IMPL_API void ImGui_ImplDX12_RenderDrawData(ImDrawData* draw_data, ID3D12GraphicsCommandList* graphics_command_list); 41 | 42 | // Use if you want to reset your rendering device without losing Dear ImGui state. 43 | IMGUI_IMPL_API void ImGui_ImplDX12_InvalidateDeviceObjects(); 44 | IMGUI_IMPL_API bool ImGui_ImplDX12_CreateDeviceObjects(); 45 | 46 | #endif // #ifndef IMGUI_DISABLE 47 | -------------------------------------------------------------------------------- /MK1Hook/steam/ISteamGameStats001.h: -------------------------------------------------------------------------------- 1 | //========================== Open Steamworks ================================ 2 | // 3 | // This file is part of the Open Steamworks project. All individuals associated 4 | // with this project do not claim ownership of the contents 5 | // 6 | // The code, comments, and all related files, projects, resources, 7 | // redistributables included with this project are Copyright Valve Corporation. 8 | // Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the 9 | // Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, 10 | // Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the 11 | // Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition 12 | // Zero are trademarks and or registered trademarks of Valve Corporation. 13 | // All other trademarks are property of their respective owners. 14 | // 15 | //============================================================================= 16 | 17 | #ifndef ISTEAMGAMESTATS001_H 18 | #define ISTEAMGAMESTATS001_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #include "SteamTypes.h" 24 | #include "GameStatsCommon.h" 25 | 26 | 27 | //----------------------------------------------------------------------------- 28 | // Purpose: Functions for recording game play sessions and details thereof 29 | //----------------------------------------------------------------------------- 30 | abstract_class ISteamGameStats001 31 | { 32 | public: 33 | virtual SteamAPICall_t GetNewSession( int8 nAccountType, uint64 ulAccountID, int32 nAppID, RTime32 rtTimeStarted ) = 0; 34 | virtual SteamAPICall_t EndSession( uint64 ulSessionID, RTime32 rtTimeEnded, int nReasonCode ) = 0; 35 | virtual EResult AddSessionAttributeInt( uint64 ulSessionID, const char* pstrName, int32 nData ) = 0; 36 | virtual EResult AddSessionAttributeString( uint64 ulSessionID, const char* pstrName, const char *pstrData ) = 0; 37 | virtual EResult AddSessionAttributeFloat( uint64 ulSessionID, const char* pstrName, float fData ) = 0; 38 | 39 | virtual EResult AddNewRow( uint64 *pulRowID, uint64 ulSessionID, const char *pstrTableName ) = 0; 40 | virtual EResult CommitRow( uint64 ulRowID ) = 0; 41 | virtual EResult CommitOutstandingRows( uint64 ulSessionID ) = 0; 42 | virtual EResult AddRowAttributeInt( uint64 ulRowID, const char *pstrName, int32 nData ) = 0; 43 | virtual EResult AddRowAtributeString( uint64 ulRowID, const char *pstrName, const char *pstrData ) = 0; 44 | virtual EResult AddRowAttributeFloat( uint64 ulRowID, const char *pstrName, float fData ) = 0; 45 | 46 | virtual EResult AddSessionAttributeInt64( uint64 ulSessionID, const char *pstrName, int64 llData ) = 0; 47 | virtual EResult AddRowAttributeInt64( uint64 ulRowID, const char *pstrName, int64 llData ) = 0; 48 | }; 49 | 50 | #endif // ISTEAMGAMESERVERSTATS001_H 51 | --------------------------------------------------------------------------------