Skip to content

Commit

Permalink
support for latest steam version (v1.11)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronkirkham committed Oct 15, 2019
1 parent 5603afe commit 45f3679
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 22 deletions.
16 changes: 16 additions & 0 deletions signatures.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
QuickStart 44 38 3D ? ? ? ? 0F 85 ? ? ? ? 48 8B 0D ? ? ? ? 48 85 C9
IsIntroSequenceComplete E8 ? ? ? ? 84 C0 74 0A B9 ? ? ? ?
IsIntroMovieComplete E8 ? ? ? ? 84 C0 75 17 48 8B 15 ? ? ? ?
WndProc String: ./jc4.ico (E8 ? ? ? ? 48 8B 54 24 ? 89 C3 -> Win32Main)
GameState 83 3D ? ? ? ? ? 74 0A E8 ? ? ? ?
SuspendGame 31 C9 C6 05 ? ? ? ? ? FF 15 ? ? ? ?
FlipThread 48 8B 8B ? ? ? ? E8 ? ? ? ? 90 48 8B 05 ? ? ? ? (48 8D 0D ? ? ? ? E8 ? ? ? ? 48 89 43 30)
CManagerBase instance (& 2 funcs) 0F 84 ? ? ? ? E8 ? ? ? ? E9 ? ? ? ? 31 D2
Event call E8 ? ? ? ? C6 87 ? ? ? ? ? 48 8B 57 58
hnpkWorld instance 0F 84 ? ? ? ? 48 8B 3D ? ? ? ? 48 89 BC 24 ? ? ? ?
SetTimeOfDay (and CWorldTime instance) E9 ? ? ? ? 0F 2F DA
CClock instance E8 ? ? ? ? 84 C0 74 05 0F 28 F7
CPlayerManager instance 48 8B 0D ? ? ? ? 48 85 C9 74 06 48 8B 49 30 EB 03 49 8B CC
CRenderEngine instance 89 42 08 48 8B 0D ? ? ? ?
CSpawnSystem instance (& func) String: weapon,rpg (CPlayer Event Handler: 40 55 56 57 48 8D AC 24 ? ? ? ? 48 81 EC ? ? ? ? 48 C7 85 ? ? ? ? ? ? ? ?)
CUIManager instance 74 64 48 8B 05 ? ? ? ? 48 8D 8B ? ? ? ?
2 changes: 1 addition & 1 deletion src/commands/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class EventCommand : public ICommand
return false;
}

hk::func_call<void>(0x1446EB790, arguments.c_str(), nullptr);
hk::func_call<void>(0x147BFEB20, arguments.c_str(), nullptr);
return true;
}

Expand Down
6 changes: 3 additions & 3 deletions src/commands/world.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ class WorldCommand : public ICommand

virtual bool Handler(const std::string& arguments) override
{
static auto hnpkWorld = *(void**)0x142CD6F70;
static auto WorldTime = *(void**)0x142CA2DA0;
static auto hnpkWorld = *(void**)0x142CE3F30;
static auto WorldTime = *(void**)0x142CAFDB0;

// time
if (arguments.find("time ") != std::string::npos) {
float time = 0.0f;
if (sscanf_s(arguments.c_str(), "time %f", &time) == 1) {
time = std::clamp(time, -24.0f, 24.0f);
hk::func_call<void>(0x14031F7D0, WorldTime, time, 2);
hk::func_call<void>(0x140322720, WorldTime, time, 2);
return true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/game/clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class CClock
public:
static CClock& instance()
{
return **(CClock**)0x142C776A8;
return **(CClock**)0x142C846B0;
}

public:
Expand Down
6 changes: 3 additions & 3 deletions src/game/input_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ class CManagerBase
public:
static CManagerBase& instance()
{
return **(CManagerBase**)0x142CD4B30;
return **(CManagerBase**)0x142CE1AF0;
}

void LoseFocus()
{
hk::func_call<void>(0x147C63280, this);
hk::func_call<void>(0x140FC8560, this);
}

void GainFocus()
{
hk::func_call<void>(0x147C630D0, this);
hk::func_call<void>(0x140FC84B0, this);
}
};
}; // namespace jc::NInput
Expand Down
2 changes: 1 addition & 1 deletion src/game/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class CPlayer
public:
char _pad[0x68];
CCharacter* m_character;
char _pad2[0x148];
char _pad2[0x150];
CPlayerAimControl* m_aimControl;
};
}; // namespace jc
Expand Down
2 changes: 1 addition & 1 deletion src/game/player_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class CPlayerManager
public:
static CPlayerManager& instance()
{
return **(CPlayerManager**)0x142CA5378;
return **(CPlayerManager**)0x142CB2388;
}

static CCharacter* GetLocalPlayerCharacter()
Expand Down
2 changes: 1 addition & 1 deletion src/game/render_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class CRenderEngine
public:
static CRenderEngine& instance()
{
return **(CRenderEngine**)0x142C77BD8;
return **(CRenderEngine**)0x142C84BE8;
}

public:
Expand Down
4 changes: 2 additions & 2 deletions src/game/spawn_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class CSpawnSystem
public:
static CSpawnSystem& instance()
{
return **(CSpawnSystem**)0x142CA4D10;
return **(CSpawnSystem**)0x142CB1D20;
}

void Spawn(const std::string& model_name, const CMatrix4f& transform,
Expand All @@ -30,7 +30,7 @@ class CSpawnSystem

auto request = new SpawnReq{callback, userdata};
hk::func_call<void>(
0x140BA62E0, this, model_name.c_str(), transform, 0x597Cu,
0x140BADC60, this, model_name.c_str(), transform, 0x597Cu,
(success_t)[](const spawned_objects& objects, void* userdata) {
auto spawn_req = (SpawnReq*)userdata;
spawn_req->callback(objects, spawn_req->userdata);
Expand Down
2 changes: 1 addition & 1 deletion src/game/ui_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CUIManager
public:
static CUIManager& instance()
{
return **(CUIManager**)0x142CAADA8;
return **(CUIManager**)0x142CB7DC8;
}

CUIBase* GetUI(uint32_t name_hash)
Expand Down
16 changes: 8 additions & 8 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
}

// if we are running on the wrong version, don't continue
if (*(uint32_t *)0x141E732B8 != 0x6c617641) {
if (*(uint32_t *)0x141E7EE40 != 0x6c617641) {
#ifdef DEBUG
MessageBox(nullptr, "Wrong version.", nullptr, MB_ICONERROR | MB_OK);
#endif
Expand All @@ -64,19 +64,19 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
// enable quick start
if (quick_start) {
// quick start
hk::put<bool>(0x142CABF28, true);
hk::put<bool>(0x142CB8F40, true);

// IsIntroSequenceComplete always returns true
hk::put<uint32_t>(0x140E8B1D0, 0x90C301B0);
hk::put<uint32_t>(0x140E935B0, 0x90C301B0);

// IsIntroMovieComplete always returns true
hk::put<uint32_t>(0x140E8B150, 0x90C301B0);
hk::put<uint32_t>(0x140E93530, 0x90C301B0);
}

static hk::inject_jump<LRESULT, HWND, UINT, WPARAM, LPARAM> wndproc(0x140C77880);
static hk::inject_jump<LRESULT, HWND, UINT, WPARAM, LPARAM> wndproc(0x140C7FB50);
wndproc.inject([](HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) -> LRESULT {
auto game_state = *(uint32_t *)0x142CABF0C;
auto suspend_game = *(bool *)0x142CB0B48;
auto game_state = *(uint32_t *)0x142CB8F24;
auto suspend_game = *(bool *)0x142CBDAF0;
auto clock = &jc::Base::CClock::instance();

if (game_state == 3 && clock) {
Expand All @@ -95,7 +95,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
return wndproc.call(hwnd, uMsg, wParam, lParam);
});

static hk::inject_jump<void, jc::HDevice_t *> flip(0x140F97DC0);
static hk::inject_jump<void, jc::HDevice_t *> flip(0x140FA2C70);
flip.inject([](jc::HDevice_t *device) -> void {
Graphics::Get()->BeginDraw(device);

Expand Down

0 comments on commit 45f3679

Please sign in to comment.