mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-10 17:21:33 +00:00
frida mode display command line on mac
This commit is contained in:
parent
06b23c7dcb
commit
f68b9f5110
@ -6,6 +6,7 @@
|
|||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#include <mach/mach.h>
|
#include <mach/mach.h>
|
||||||
#include <mach-o/dyld_images.h>
|
#include <mach-o/dyld_images.h>
|
||||||
|
#include <crt_externs.h>
|
||||||
#else
|
#else
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <sys/personality.h>
|
#include <sys/personality.h>
|
||||||
@ -90,6 +91,7 @@ static void embedded_init(void) {
|
|||||||
|
|
||||||
static void afl_print_cmdline(void) {
|
static void afl_print_cmdline(void) {
|
||||||
|
|
||||||
|
#if defined(__linux__)
|
||||||
char * buffer = g_malloc0(PROC_MAX);
|
char * buffer = g_malloc0(PROC_MAX);
|
||||||
gchar *fname = g_strdup_printf("/proc/%d/cmdline", getppid());
|
gchar *fname = g_strdup_printf("/proc/%d/cmdline", getppid());
|
||||||
int fd = open(fname, O_RDONLY);
|
int fd = open(fname, O_RDONLY);
|
||||||
@ -123,6 +125,17 @@ static void afl_print_cmdline(void) {
|
|||||||
close(fd);
|
close(fd);
|
||||||
g_free(fname);
|
g_free(fname);
|
||||||
g_free(buffer);
|
g_free(buffer);
|
||||||
|
#elif defined(__APPLE__)
|
||||||
|
int idx;
|
||||||
|
char **argv = *_NSGetArgv();
|
||||||
|
int nargv = *_NSGetArgc();
|
||||||
|
|
||||||
|
for (idx = 0; idx < nargv; idx ++) {
|
||||||
|
|
||||||
|
OKF("AFL - COMMANDLINE: argv[%d] = %s", idx, argv[idx]);
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user