Fixes to formatting

This commit is contained in:
Your Name 2022-08-01 08:10:45 +01:00
parent 7b6743f14c
commit e9cb939956
3 changed files with 17 additions and 13 deletions

View File

@ -38,15 +38,16 @@ extern mach_port_t mach_task_self();
extern GumAddress gum_darwin_find_entrypoint(mach_port_t task);
#elif defined(__ANDROID__)
typedef struct {
void (**preinit_array)(void);
void (**init_array)(void);
void (**fini_array)(void);
void (**preinit_array)(void);
void (**init_array)(void);
void (**fini_array)(void);
} structors_array_t;
extern void __libc_init(void* raw_args,
void (*onexit)(void) __unused,
int (*slingshot)(int, char **, char **),
structors_array_t const * const structors);
extern void __libc_init(void *raw_args, void (*onexit)(void) __unused,
int (*slingshot)(int, char **, char **),
structors_array_t const *const structors);
#else
extern int __libc_start_main(int (*main)(int, char **, char **), int argc,
char **ubp_av, void (*init)(void),
@ -291,17 +292,19 @@ static void intercept_main(void) {
intercept_hook(main, on_main, NULL);
}
#elif defined(__ANDROID__)
static void on_libc_init(void* raw_args,
void (*onexit)(void) __unused,
int (*slingshot)(int, char**, char**),
structors_array_t const * const structors){
static void on_libc_init(void *raw_args, void (*onexit)(void) __unused,
int (*slingshot)(int, char **, char **),
structors_array_t const *const structors) {
main_fn = slingshot;
intercept_unhook_self();
intercept_hook(slingshot, on_main, NULL);
return __libc_init(raw_args, onexit, slingshot, structors);
}
static void intercept_main(void) {
intercept_hook(__libc_init, on_libc_init, NULL);

View File

@ -301,12 +301,13 @@ void prefetch_init(void) {
* This doesn't work on Android, so we skip it. Would could end up leaking
* shared memory regions though.
*/
#ifndef __ANDROID__
#ifndef __ANDROID__
if (shmctl(prefetch_shm_id, IPC_RMID, NULL) < 0) {
FFATAL("shmctl (IPC_RMID) < 0 - errno: %d\n", errno);
}
#endif
/* Clear it, not sure it's necessary, just seems like good practice */

View File

@ -13,7 +13,7 @@ void seccomp_on_fork(void) {
FFATAL("Seccomp not supported on OSX");
#elif defined(__ANDROID__)
FFATAL("Seccomp not supported on Android");
#else
#else
seccomp_callback_parent();
#endif