diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2021-03-02 11:49:09 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2021-03-02 11:49:09 +0100 |
| commit | 9ae5d6121295599bff75012b44adebabd0908ead (patch) | |
| tree | 7331fb2b623813e6ef29726382520ff7cd5921c3 /src | |
| parent | 997b5c6b50b9263b06fb0a21dd6c2e727ce3e4a1 (diff) | |
| download | box64-9ae5d6121295599bff75012b44adebabd0908ead.tar.gz box64-9ae5d6121295599bff75012b44adebabd0908ead.zip | |
Initializing x64emu structure
Diffstat (limited to 'src')
| -rwxr-xr-x | src/include/box64context.h | 5 | ||||
| -rwxr-xr-x | src/include/x64emu.h | 10 | ||||
| -rwxr-xr-x | src/main.c | 2 |
3 files changed, 10 insertions, 7 deletions
diff --git a/src/include/box64context.h b/src/include/box64context.h index 8f5738f5..fe99e899 100755 --- a/src/include/box64context.h +++ b/src/include/box64context.h @@ -6,6 +6,7 @@ typedef struct elfheader_s elfheader_t; typedef struct cleanup_s cleanup_t; +typedef struct x64emu_s x64emu_t; typedef void* (*procaddess_t)(const char* name); typedef void* (*vkprocaddess_t)(void* instance, const char* name); @@ -52,6 +53,8 @@ typedef struct box64context_s { int deferedInit; + uintptr_t ep; // entry point + pthread_key_t tlskey; // then tls key to have actual tlsdata void* tlsdata; // the initial global tlsdata int32_t tlssize; // wanted size of tlsdata @@ -70,7 +73,7 @@ typedef struct box64context_s { uintptr_t restorer[MAX_SIGNAL]; int onstack[MAX_SIGNAL]; int is_sigaction[MAX_SIGNAL]; - + x64emu_t *emu_sig; // the emu with stack used for signal handling (must be separated from main ones) int no_sigsegv; int no_sigill; diff --git a/src/include/x64emu.h b/src/include/x64emu.h index 408fd3db..ff19339b 100755 --- a/src/include/x64emu.h +++ b/src/include/x64emu.h @@ -4,11 +4,11 @@ typedef struct x64emu_s x64emu_t; typedef struct box64context_s box64context_t; -x64emu_t *NewX86Emu(box64context_t *context, uintptr_t start, uintptr_t stack, int stacksize, int ownstack); -x64emu_t *NewX86EmuFromStack(x64emu_t* emu, box64context_t *context, uintptr_t start, uintptr_t stack, int stacksize, int ownstack); -void SetupX86Emu(x64emu_t *emu); -void FreeX86Emu(x64emu_t **x64emu); -void FreeX86EmuFromStack(x64emu_t **emu); +x64emu_t *NewX64Emu(box64context_t *context, uintptr_t start, uintptr_t stack, int stacksize, int ownstack); +x64emu_t *NewX64EmuFromStack(x64emu_t* emu, box64context_t *context, uintptr_t start, uintptr_t stack, int stacksize, int ownstack); +void SetupX64Emu(x64emu_t *emu); +void FreeX64Emu(x64emu_t **x64emu); +void FreeX64EmuFromStack(x64emu_t **emu); void CloneEmu(x64emu_t *newemu, const x64emu_t* emu); void SetTraceEmu(uintptr_t trace_start, uintptr_t trace_end); diff --git a/src/main.c b/src/main.c index f64996cf..32e84a21 100755 --- a/src/main.c +++ b/src/main.c @@ -818,7 +818,7 @@ int main(int argc, const char **argv, const char **env) { return -1; } // init x86_64 emu - //x64emu_t *emu = NewX64Emu(my_context, my_context->ep, (uintptr_t)my_context->stack, my_context->stacksz, 0); + x64emu_t *emu = NewX64Emu(my_context, my_context->ep, (uintptr_t)my_context->stack, my_context->stacksz, 0); return 0; |