SHARE
TWEET

Untitled

a guest Apr 21st, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <modloader/statichook.h>
  2. #include <modloader/log.h>
  3. #include <csignal>
  4. #include <execinfo.h>
  5. #include <sys/stat.h>
  6. #include <fstream>
  7.  
  8. using namespace modloader;
  9.  
  10. TClasslessInstanceHook(bool, _ZN15google_breakpad16ExceptionHandler12HandleSignalEiP9siginfo_tPv, int signal, siginfo_t *info, void *aptr) {
  11.     if (signal == SIGSEGV || signal == SIGABRT) {
  12.         Log::error(TAG, "\033[1;31m%s (signal %d) received! Saving files...\033[0m", strsignal(signal), signal);
  13.  
  14.         void *array[25];
  15.         int count = backtrace(array, 25);
  16.         auto symbols = backtrace_symbols(array, count);
  17.         for (int i = 0; i < count; i++) {
  18.             printf("#%i %s\n", i, symbols[i]);
  19.             output << "#" << i << " " << symbols[i] << std::endl;
  20.         }
  21.     }
  22.     return original(this, signal, info, aptr);
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top