From 9e853e487deb89e38a0eb105814f6f6846ec9f2b Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Thu, 3 Oct 2024 19:36:42 +0200 Subject: [BOX32] Added more 32bits wrapped function and reworked 32bits memory allocator --- src/libtools/auxval.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/libtools') diff --git a/src/libtools/auxval.c b/src/libtools/auxval.c index 789902df..1e4b6045 100644 --- a/src/libtools/auxval.c +++ b/src/libtools/auxval.c @@ -49,8 +49,25 @@ unsigned long real_getauxval(unsigned long type) return 0; } +#ifdef BOX32 +EXPORT unsigned long my32_getauxval(x64emu_t* emu, unsigned long type) +{ + ptr_t* p = (ptr_t*)emu->context->auxval_start; + while(*p) { + if(*p == type) + return p[1]; + p+=2; + } + return 0; +} +#endif + EXPORT unsigned long my_getauxval(x64emu_t* emu, unsigned long type) { + #ifdef BOX32 + if(box64_is32bits) + return my32_getauxval(emu, type); + #endif uintptr_t* p = emu->context->auxval_start; while(*p) { if(*p == type) -- cgit 1.4.1