Skip to content

Commit

Permalink
fix crash caused by incorrect function id
Browse files Browse the repository at this point in the history
  • Loading branch information
shad0wshayd3 committed May 9, 2024
1 parent 6d6b2a2 commit 4ea8dad
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.21)
# info
project(
BakaMaxPapyrusOps
VERSION 2.0.0
VERSION 2.0.1
LANGUAGES CXX
)

Expand Down
14 changes: 9 additions & 5 deletions Plugin/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,16 @@ class Fixes
public:
static void Install()
{
static REL::Relocation<std::uintptr_t> target{ REL::ID(2251339), 0x797 };
auto& trampoline = F4SE::GetTrampoline();
trampoline.write_call<5>(target.address(), BSSpinLock_Lock);
{
static REL::Relocation<std::uintptr_t> target{ REL::ID(2251339), 0x797 };
auto& trampoline = F4SE::GetTrampoline();
trampoline.write_call<5>(target.address(), BSSpinLock_Lock);
}

static REL::Relocation<std::uintptr_t> tgtNOP{ REL::ID(2251339), 0x79C };
REL::safe_fill(tgtNOP.address(), REL::NOP, 0x08);
{
static REL::Relocation<std::uintptr_t> target{ REL::ID(2251339), 0x79C };
REL::safe_fill(target.address(), REL::NOP, 0x08);
}
}

private:
Expand Down
2 changes: 1 addition & 1 deletion extern/CommonLibF4

0 comments on commit 4ea8dad

Please sign in to comment.