about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-03-26 14:04:49 +0100
committerptitSeb <sebastien.chev@gmail.com>2021-03-26 14:04:49 +0100
commit86c5dfd664ad6f53c03b60b71d76886701b54f9c (patch)
treea24926649a439a784b8a25b6e5ddc8c4f9c00bb1 /src
parentc31aa8a78d3797417c8cf8e099dad66e59ca2910 (diff)
downloadbox64-86c5dfd664ad6f53c03b60b71d76886701b54f9c.tar.gz
box64-86c5dfd664ad6f53c03b60b71d76886701b54f9c.zip
Added (faked) crashhandler wrapped lib
Diffstat (limited to 'src')
-rwxr-xr-xsrc/library_list.h2
-rwxr-xr-xsrc/wrapped/wrappedcrashhandler.c32
-rwxr-xr-xsrc/wrapped/wrappedcrashhandler_private.h49
3 files changed, 82 insertions, 1 deletions
diff --git a/src/library_list.h b/src/library_list.h
index 50dc57ad..0f74ea86 100755
--- a/src/library_list.h
+++ b/src/library_list.h
@@ -143,4 +143,4 @@ GO("libgnutls.so.30", gnutls)
 
 GO("ld-linux-x86-64.so.2", ldlinux)
 
-//GO("crashhandler.so", crashhandler)
+GO("crashhandler.so", crashhandler)
diff --git a/src/wrapped/wrappedcrashhandler.c b/src/wrapped/wrappedcrashhandler.c
new file mode 100755
index 00000000..115e3150
--- /dev/null
+++ b/src/wrapped/wrappedcrashhandler.c
@@ -0,0 +1,32 @@
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <dlfcn.h>
+
+#include "wrappedlibs.h"
+
+#include "debug.h"
+#include "wrapper.h"
+#include "bridge.h"
+#include "librarian/library_private.h"
+#include "x64emu.h"
+#include "emu/x64emu_private.h"
+#include "callback.h"
+#include "librarian.h"
+#include "box64context.h"
+#include "emu/x64emu_private.h"
+
+const char* crashhandlerName = "crashhandler.so";
+#define LIBNAME crashhandler
+
+#define PRE_INIT                                                \
+    if(!box64_steam)                                            \
+        return -1;                                              \
+    if(1)                                                       \
+        lib->priv.w.lib = dlopen(NULL, RTLD_LAZY | RTLD_GLOBAL);\
+    else
+
+
+#include "wrappedlib_init.h"
+
diff --git a/src/wrapped/wrappedcrashhandler_private.h b/src/wrapped/wrappedcrashhandler_private.h
new file mode 100755
index 00000000..52ed57d6
--- /dev/null
+++ b/src/wrapped/wrappedcrashhandler_private.h
@@ -0,0 +1,49 @@
+#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
+#error Meh....
+#endif
+
+//GO(Breakpad_SetSteamID, 
+//DATAB(__bss_start, 
+//GO(CreateInterface, 
+//DATAB(_edata, 
+//DATAB(_end, 
+//GO(_fini, 
+//GO(_init, 
+//GO(SteamRealPath, 
+//GO(__wrap_access, 
+//GO(__wrap_chmod, 
+//GO(__wrap_chown, 
+//GO(__wrap_dlmopen, 
+//GO(__wrap_dlopen, 
+//GO(__wrap_fopen, 
+//GO(__wrap_fopen64, 
+//GO(__wrap_freopen, 
+//GO(__wrap_lchown, 
+//GO(__wrap_link, 
+//GO(__wrap_lstat, 
+//GO(__wrap_lstat64, 
+//GO(__wrap___lxstat, 
+//GO(__wrap___lxstat64, 
+//GO(__wrap_mkdir, 
+//GO(__wrap_mkfifo, 
+//GO(__wrap_mknod, 
+//GO(__wrap_mount, 
+//GO(__wrap_open, 
+//GO(__wrap_open64, 
+//GO(__wrap_opendir, 
+//GO(__wrap_rename, 
+//GO(__wrap_rmdir, 
+//GO(__wrap_scandir, 
+//GO(__wrap_scandir64, 
+//GO(__wrap_stat, 
+//GO(__wrap_stat64, 
+//GO(__wrap_statfs, 
+//GO(__wrap_statfs64, 
+//GO(__wrap_statvfs, 
+//GO(__wrap_statvfs64, 
+//GO(__wrap_symlink, 
+//GO(__wrap_unlink, 
+//GO(__wrap_utime, 
+//GO(__wrap_utimes, 
+//GO(__wrap___xstat, 
+//GO(__wrap___xstat64,