From 7f22b33f5ad208d3852bc05c43bb806fcf34b63e Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sun, 4 Dec 2022 16:22:30 +0100 Subject: [TRACE] Fixed BOX64_TRACE_INIT --- src/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main.c b/src/main.c index 83348dac..78f46daa 100755 --- a/src/main.c +++ b/src/main.c @@ -975,7 +975,10 @@ void setupTraceInit() if(s_trace_start || s_trace_end) SetTraceEmu(s_trace_start, s_trace_end); } else { - if (GetGlobalSymbolStartEnd(my_context->maplib, p, &trace_start, &trace_end, NULL, -1, NULL)) { + if (GetGlobalSymbolStartEnd(my_context->maplib, p, &s_trace_start, &s_trace_end, NULL, -1, NULL)) { + SetTraceEmu(s_trace_start, s_trace_end); + printf_log(LOG_INFO, "TRACE on %s only (%p-%p)\n", p, (void*)s_trace_start, (void*)s_trace_end); + } else if(GetLocalSymbolStartEnd(my_context->maplib, p, &s_trace_start, &s_trace_end, NULL, -1, NULL)) { SetTraceEmu(s_trace_start, s_trace_end); printf_log(LOG_INFO, "TRACE on %s only (%p-%p)\n", p, (void*)s_trace_start, (void*)s_trace_end); } else { @@ -1555,7 +1558,6 @@ int main(int argc, const char **argv, char **env) { thread_set_emu(emu); - setupTraceInit(); // export symbols AddSymbols(my_context->maplib, GetMapSymbols(elf_header), GetWeakSymbols(elf_header), GetLocalSymbols(elf_header), elf_header); box64_isglibc234 = GetVersionIndice(elf_header, "GLIBC_2.34")?1:0; @@ -1599,6 +1601,7 @@ int main(int argc, const char **argv, char **env) { // and handle PLT RelocateElfPlt(my_context->maplib, NULL, 0, elf_header); // defered init + setupTraceInit(); RunDeferedElfInit(emu); // update TLS of main elf RefreshElfTLS(elf_header); -- cgit 1.4.1