about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-03-01 16:02:48 +0100
committerptitSeb <sebastien.chev@gmail.com>2021-03-01 16:02:48 +0100
commita8637ca5d63da07c4049e475fdf729841a599b1d (patch)
tree841421ddd68679063bbf0403ed574a4d8d756e11 /src
parent311842a43aa34276dc41da6e2f3a63ac80d4849c (diff)
downloadbox64-a8637ca5d63da07c4049e475fdf729841a599b1d.tar.gz
box64-a8637ca5d63da07c4049e475fdf729841a599b1d.zip
Added main elf to context
Diffstat (limited to 'src')
-rwxr-xr-xsrc/box64context.c5
-rwxr-xr-xsrc/include/box64context.h7
-rwxr-xr-xsrc/main.c2
3 files changed, 11 insertions, 3 deletions
diff --git a/src/box64context.c b/src/box64context.c
index 21768fb2..84362565 100755
--- a/src/box64context.c
+++ b/src/box64context.c
@@ -8,6 +8,7 @@
 
 #include "box64context.h"
 #include "debug.h"
+#include "elfloader.h"
 
 
 EXPORTDYN
@@ -146,7 +147,7 @@ void FreeBox64Context(box64context_t** context)
 
     free(ctx);
 }
-/*
+
 int AddElfHeader(box64context_t* ctx, elfheader_t* head) {
     int idx = ctx->elfsize;
     if(idx==ctx->elfcap) {
@@ -159,7 +160,7 @@ int AddElfHeader(box64context_t* ctx, elfheader_t* head) {
     printf_log(LOG_DEBUG, "Adding \"%s\" as #%d in elf collection\n", ElfName(head), idx);
     return idx;
 }
-*/
+
 int AddTLSPartition(box64context_t* context, int tlssize) {
     int oldsize = context->tlssize;
     context->tlssize += tlssize;
diff --git a/src/include/box64context.h b/src/include/box64context.h
index 0697e16a..3ee5f927 100755
--- a/src/include/box64context.h
+++ b/src/include/box64context.h
@@ -74,7 +74,14 @@ extern box64context_t *my_context; // global context
 box64context_t *NewBox64Context(int argc);
 void FreeBox64Context(box64context_t** context);
 
+// return the index of the added header
+int AddElfHeader(box64context_t* ctx, elfheader_t* head);
+
 // return the tlsbase (negative) for the new TLS partition created (no partition index is stored in the context)
 int AddTLSPartition(box64context_t* context, int tlssize);
 
+// defined in fact in threads.c
+//void thread_set_emu(x64emu_t* emu);
+//x64emu_t* thread_get_emu();
+
 #endif //__BOX64CONTEXT_H_
\ No newline at end of file
diff --git a/src/main.c b/src/main.c
index 3d4e4741..f5bbf9d6 100755
--- a/src/main.c
+++ b/src/main.c
@@ -731,6 +731,6 @@ int main(int argc, const char **argv, const char **env) {
         FreeCollection(&ld_preload);
         return execvp(argv[1], (char * const*)(argv+1));
     }
-    /*AddElfHeader(my_context, elf_header);*/
+    AddElfHeader(my_context, elf_header);
     return 0;
 }