File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -134,13 +134,13 @@ FetchContent_Declare(
134134)
135135FetchContent_MakeAvailable(bddisasm)
136136
137- message(STATUS "Fetching kananlib (ccf2e5a32cf4c85a90641ae7a35c2b1d636c7636 )...")
137+ message(STATUS "Fetching kananlib (cca66766b139994f478ea48befd67a179b7310ab )...")
138138FetchContent_Declare(
139139 kananlib
140140 GIT_REPOSITORY
141141 https://github.com/cursey/kananlib
142142 GIT_TAG
143- ccf2e5a32cf4c85a90641ae7a35c2b1d636c7636
143+ cca66766b139994f478ea48befd67a179b7310ab
144144)
145145FetchContent_MakeAvailable(kananlib)
146146
Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ tag = "v1.34.10"
175175
176176[fetch-content .kananlib ]
177177git = " https://github.com/cursey/kananlib"
178- tag = " ccf2e5a32cf4c85a90641ae7a35c2b1d636c7636 "
178+ tag = " cca66766b139994f478ea48befd67a179b7310ab "
179179
180180[target .utility ]
181181type = " static"
Original file line number Diff line number Diff line change 1+ #include < ranges>
2+
13#include < hde64.h>
24#include < spdlog/spdlog.h>
35
@@ -127,7 +129,9 @@ void HookManager::HookedFn::on_post_hook() {
127129 auto & ret_val = storage->ret_val ;
128130 // auto& ret_addr = storage->ret_addr_post;
129131
130- for (const auto & cb : cbs) {
132+ // Iterate in reverse because it helps with the hook storage we use in Lua
133+ // It should help with any other system that wants to use a stack-based storage system.
134+ for (const auto & cb : cbs | std::views::reverse) {
131135 if (cb.post_fn ) {
132136 // Valid return address in recursion scenario is no longer supported with this API.
133137 // We just pass ret_addr_pre for now, even though it's not accurate.
Original file line number Diff line number Diff line change @@ -178,7 +178,7 @@ class ScriptState {
178178 auto it = m_hook_storage.find (thread_hash);
179179 if (it != m_hook_storage.end ()) {
180180 if (!it->second .empty ()) {
181- it->second .pop_front ();
181+ it->second .pop_back ();
182182 }
183183 }
184184
@@ -196,7 +196,7 @@ class ScriptState {
196196 auto it = m_hook_storage.find (thread_hash);
197197 if (it != m_hook_storage.end ()) {
198198 if (!it->second .empty ()) {
199- return it->second .front ();
199+ return it->second .back ();
200200 }
201201 }
202202
You can’t perform that action at this time.
0 commit comments