about summary refs log tree commit diff stats
path: root/src/main.c
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-03-01 18:02:26 +0100
committerptitSeb <sebastien.chev@gmail.com>2021-03-01 18:02:26 +0100
commita2a78a4edc2e82756d83daf8bbbe2ca26102af47 (patch)
tree5010536c8adda635f138ecb55da6c5e1b813b8e0 /src/main.c
parent4079491d5e003c424f1bfa2a3f682185cd0c54a7 (diff)
downloadbox64-a2a78a4edc2e82756d83daf8bbbe2ca26102af47.tar.gz
box64-a2a78a4edc2e82756d83daf8bbbe2ca26102af47.zip
Load elf in memory
Diffstat (limited to 'src/main.c')
-rwxr-xr-xsrc/main.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index c049a27d..1e513351 100755
--- a/src/main.c
+++ b/src/main.c
@@ -750,6 +750,17 @@ int main(int argc, const char **argv, const char **env) {
         FreeCollection(&ld_preload);
         return -1;
     }
+    // Load elf into memory
+    if(LoadElfMemory(f, my_context, elf_header)) {
+        printf_log(LOG_NONE, "Error: loading in memory elf %s\n", my_context->argv[0]);
+        fclose(f);
+        free_contextargv();
+        FreeBox64Context(&my_context);
+        FreeCollection(&ld_preload);
+        return -1;
+    }
+    // can close the file now
+    fclose(f);
 
 
     return 0;