about summary refs log tree commit diff stats
path: root/src/include
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-03-02 17:55:55 +0100
committerptitSeb <sebastien.chev@gmail.com>2021-03-02 17:55:55 +0100
commitb4851d8dd52dba587e55818b2e20b15f8624e955 (patch)
tree799db5bcbe4d71e8ee91d1e6f2445b7ccae78fe4 /src/include
parent8b56536bb1e38cfa83346544ec62e2e2003dd071 (diff)
downloadbox64-b4851d8dd52dba587e55818b2e20b15f8624e955.tar.gz
box64-b4851d8dd52dba587e55818b2e20b15f8624e955.zip
Added bridge handling
Diffstat (limited to 'src/include')
-rwxr-xr-xsrc/include/box64context.h7
-rwxr-xr-xsrc/include/bridge.h25
2 files changed, 32 insertions, 0 deletions
diff --git a/src/include/box64context.h b/src/include/box64context.h
index 0ffd0651..9eca567e 100755
--- a/src/include/box64context.h
+++ b/src/include/box64context.h
@@ -9,6 +9,8 @@ typedef struct cleanup_s cleanup_t;
 typedef struct x64emu_s x64emu_t;
 typedef struct zydis_s zydis_t;
 typedef struct zydis_dec_s zydis_dec_t;
+typedef struct lib_s lib_t;
+typedef struct bridge_s bridge_t;
 typedef struct kh_threadstack_s kh_threadstack_t;
 
 typedef void* (*procaddess_t)(const char* name);
@@ -58,7 +60,12 @@ typedef struct box64context_s {
 
     uintptr_t           ep;             // entry point
 
+    lib_t               *maplib;        // lib and symbols handling
+    lib_t               *local_maplib;  // libs and symbols openned has local (only collection of libs, no symbols)
+
     kh_threadstack_t    *stacksizes;    // stack sizes attributes for thread (temporary)
+    bridge_t            *system;        // other bridges
+    uintptr_t           vsyscall;       // vsyscall bridge value
 
     pthread_mutex_t     mutex_thread;
 
diff --git a/src/include/bridge.h b/src/include/bridge.h
new file mode 100755
index 00000000..dfe402f9
--- /dev/null
+++ b/src/include/bridge.h
@@ -0,0 +1,25 @@
+#ifndef __BRIDGE_H_
+#define __BRIDGE_H_
+#include <stdint.h>
+
+typedef struct x64emu_s x64emu_t;
+typedef struct bridge_s bridge_t;
+typedef struct box64context_s box64context_t;
+typedef void (*wrapper_t)(x64emu_t* emu, uintptr_t fnc);
+
+bridge_t *NewBridge();
+void FreeBridge(bridge_t** bridge);
+
+uintptr_t AddBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N);
+uintptr_t CheckBridged(bridge_t* bridge, void* fnc);
+uintptr_t AddCheckBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N);
+uintptr_t AddAutomaticBridge(x64emu_t* emu, bridge_t* bridge, wrapper_t w, void* fnc, int N);
+void* GetNativeFnc(uintptr_t fnc);
+void* GetNativeFncOrFnc(uintptr_t fnc);
+
+int hasAlternate(void* addr);
+void* getAlternate(void* addr);
+void addAlternate(void* addr, void* alt);
+void cleanAlternate();
+
+#endif //__BRIDGE_H_
\ No newline at end of file