We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 99cc220 + 2056f59 commit 35f1e3bCopy full SHA for 35f1e3b
include/SKSE/Trampoline.h
@@ -138,9 +138,10 @@ namespace SKSE
138
template <std::size_t N>
139
[[nodiscard]] std::uintptr_t write_branch(std::uintptr_t a_src, std::uintptr_t a_dst, std::uint8_t a_data)
140
{
141
+ const auto isNop = *reinterpret_cast<std::int8_t*>(a_src) == 0x90;
142
const auto disp = reinterpret_cast<std::int32_t*>(a_src + N - 4);
143
const auto nextOp = a_src + N;
- const auto func = nextOp + *disp;
144
+ const auto func = isNop ? 0 : nextOp + *disp;
145
146
if constexpr (N == 5) {
147
write_5branch(a_src, a_dst, a_data);
0 commit comments