From 4a70577e6f30da25decabb11e5f22ca2c22c50bd Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Wed, 14 May 2025 17:55:02 +0200 Subject: [WRAPPER] added arm64 special case to of_unconvert helper function --- src/wrapped/wrappedlibc.c | 8 ++++++-- src/wrapped32/wrappedlibc.c | 7 ++++++- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c index 0ee05f00..a0e8361f 100644 --- a/src/wrapped/wrappedlibc.c +++ b/src/wrapped/wrappedlibc.c @@ -652,9 +652,13 @@ int of_unconvert(int a) SUPER(); #undef GO int missing = 0; - if(!O_NOFOLLOW) missing |= X86_O_NOFOLLOW; + #ifdef ARM64 + if(!O_LARGEFILE) { + if((a&(0400000))==(0400000)) {a&=~(0400000); b|=(X86_O_LARGEFILE);} + } + #else if(!O_LARGEFILE) missing |= X86_O_LARGEFILE; - // flags 0x20000 unknown?! + #endif if(a && (a&~missing)) { printf_log(LOG_NONE, "Warning, of_unconvert(...) left over 0x%x, converted 0x%x\n", a, b); } diff --git a/src/wrapped32/wrappedlibc.c b/src/wrapped32/wrappedlibc.c index fb67dcda..2215028a 100755 --- a/src/wrapped32/wrappedlibc.c +++ b/src/wrapped32/wrappedlibc.c @@ -696,8 +696,13 @@ int of_unconvert32(int a) SUPER(); #undef GO int missing = 0; - if(!O_NOFOLLOW) missing |= X86_O_NOFOLLOW; + #ifdef ARM64 + if(!O_LARGEFILE) { + if((a&(0400000))==(0400000)) {a&=~(0400000); b|=(X86_O_LARGEFILE);} + } + #else if(!O_LARGEFILE) missing |= X86_O_LARGEFILE; + #endif if(a && (a&~missing)) { printf_log(LOG_NONE, "Warning, of_unconvert32(...) left over 0x%x, converted 0x%x\n", a, b); } -- cgit 1.4.1