Skip to content

Commit

Permalink
[BOX32] Adapted signatures of 2 32bits libc wrapped functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitSeb committed Dec 27, 2024
1 parent a54f516 commit 80b357d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/wrapped32/generated/functions_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
#() hEv -> hEv
#() hFv -> hFv
#() aEa -> aEa
#() tEv -> tEv
#() tEi -> tEi
#() tEu -> tEu
#() tEp -> tEp
Expand Down
2 changes: 2 additions & 0 deletions src/wrapped32/generated/wrapper32.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ typedef void* (*pFn_t)(void*);
typedef uintptr_t (*hEv_t)(void);
typedef uintptr_t (*hFv_t)(void);
typedef void* (*aEa_t)(void*);
typedef char* (*tEv_t)(void);
typedef char* (*tEi_t)(int32_t);
typedef char* (*tEu_t)(uint32_t);
typedef char* (*tEp_t)(void*);
Expand Down Expand Up @@ -2017,6 +2018,7 @@ void pFn_32(x64emu_t *emu, uintptr_t fcn) { pFn_t fn = (pFn_t)fcn; void *aligned
void hEv_32(x64emu_t *emu, uintptr_t fcn) { hEv_t fn = (hEv_t)fcn; errno = emu->libc_err; R_EAX = to_hash(fn()); emu->libc_err = errno; }
void hFv_32(x64emu_t *emu, uintptr_t fcn) { hFv_t fn = (hFv_t)fcn; R_EAX = to_hash(fn()); }
void aEa_32(x64emu_t *emu, uintptr_t fcn) { aEa_t fn = (aEa_t)fcn; errno = emu->libc_err; R_EAX = to_locale(fn(from_locale(from_ptri(ptr_t, R_ESP + 4)))); emu->libc_err = errno; }
void tEv_32(x64emu_t *emu, uintptr_t fcn) { tEv_t fn = (tEv_t)fcn; errno = emu->libc_err; R_EAX = to_cstring(fn()); emu->libc_err = errno; }
void tEi_32(x64emu_t *emu, uintptr_t fcn) { tEi_t fn = (tEi_t)fcn; errno = emu->libc_err; R_EAX = to_cstring(fn(from_ptri(int32_t, R_ESP + 4))); emu->libc_err = errno; }
void tEu_32(x64emu_t *emu, uintptr_t fcn) { tEu_t fn = (tEu_t)fcn; errno = emu->libc_err; R_EAX = to_cstring(fn(from_ptri(uint32_t, R_ESP + 4))); emu->libc_err = errno; }
void tEp_32(x64emu_t *emu, uintptr_t fcn) { tEp_t fn = (tEp_t)fcn; errno = emu->libc_err; R_EAX = to_cstring(fn(from_ptriv(R_ESP + 4))); emu->libc_err = errno; }
Expand Down
1 change: 1 addition & 0 deletions src/wrapped32/generated/wrapper32.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ void pFn_32(x64emu_t *emu, uintptr_t fnc);
void hEv_32(x64emu_t *emu, uintptr_t fnc);
void hFv_32(x64emu_t *emu, uintptr_t fnc);
void aEa_32(x64emu_t *emu, uintptr_t fnc);
void tEv_32(x64emu_t *emu, uintptr_t fnc);
void tEi_32(x64emu_t *emu, uintptr_t fnc);
void tEu_32(x64emu_t *emu, uintptr_t fnc);
void tEp_32(x64emu_t *emu, uintptr_t fnc);
Expand Down
4 changes: 2 additions & 2 deletions src/wrapped32/wrappedlibc_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -639,8 +639,8 @@ GOWM(gmtime_r, pEEpp)
GO(gnu_dev_major, uEU)
GO(gnu_dev_makedev, UEuu)
GO(gnu_dev_minor, uEU)
GOW(gnu_get_libc_release, pEv)
GOW(gnu_get_libc_version, pEv)
GOW(gnu_get_libc_release, tEv)
GOW(gnu_get_libc_version, tEv)
// __gnu_mcount_nc
// __gnu_Unwind_Find_exidx
GO(grantpt, iEi)
Expand Down

0 comments on commit 80b357d

Please sign in to comment.