MCPcopy Create free account
hub / github.com/commial/ttd-bindings / callCallback_diff

Function callCallback_diff

example_diff/main.cpp:18–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16std::vector<TTD::GuestAddress> g_ret_stack2;
17
18void callCallback_diff(unsigned __int64 callback_value, TTD::GuestAddress addr_func, TTD::GuestAddress addr_ret, struct TTD::TTD_Replay_IThreadView* arg4) {
19 TTD::GuestAddress last_ret;
20 if (addr_ret == 0) {
21 // End of a call (RET's next instruction)
22 // `addr_func` is the instruction address
23 if (callback_value == 1) {
24 if (!g_func_stack.empty() && !g_ret_stack.empty()) {
25 g_func_stack.pop_back();
26 last_ret = g_ret_stack.back();
27 g_ret_stack.pop_back();
28 assert(addr_func == last_ret);
29 }
30 }
31 else if (callback_value == 2) {
32 if (!g_func_stack2.empty() && !g_ret_stack2.empty()) {
33 g_func_stack2.pop_back();
34 last_ret = g_ret_stack2.back();
35 g_ret_stack2.pop_back();
36 assert(addr_func == last_ret);
37 }
38 }
39 return;
40 }
41
42 if (callback_value == 1) {
43 g_func_stack.push_back(addr_func);
44 g_ret_stack.push_back(addr_ret);
45 }
46 else if (callback_value == 2) {
47 g_func_stack2.push_back(addr_func);
48 g_ret_stack2.push_back(addr_ret);
49 }
50}
51
52
53struct Snapshot {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected