mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-14 02:58:08 +00:00
code format
This commit is contained in:
2
Makefile
2
Makefile
@ -280,6 +280,8 @@ code-format:
|
|||||||
./.custom-format.py -i qemu_mode/libcompcov/*.c
|
./.custom-format.py -i qemu_mode/libcompcov/*.c
|
||||||
./.custom-format.py -i qemu_mode/libcompcov/*.cc
|
./.custom-format.py -i qemu_mode/libcompcov/*.cc
|
||||||
./.custom-format.py -i qemu_mode/libcompcov/*.h
|
./.custom-format.py -i qemu_mode/libcompcov/*.h
|
||||||
|
./.custom-format.py -i qbdi_mode/*.c
|
||||||
|
./.custom-format.py -i qbdi_mode/*.cpp
|
||||||
./.custom-format.py -i *.h
|
./.custom-format.py -i *.h
|
||||||
./.custom-format.py -i *.c
|
./.custom-format.py -i *.c
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ void afl_maybe_log(unsigned long cur_loc) {
|
|||||||
|
|
||||||
if (afl_area_ptr == NULL) { return; }
|
if (afl_area_ptr == NULL) { return; }
|
||||||
unsigned long afl_idx = cur_loc ^ afl_prev_loc;
|
unsigned long afl_idx = cur_loc ^ afl_prev_loc;
|
||||||
afl_idx &= MAP_SIZE -1;
|
afl_idx &= MAP_SIZE - 1;
|
||||||
INC_AFL_AREA(afl_idx);
|
INC_AFL_AREA(afl_idx);
|
||||||
afl_prev_loc = cur_loc >> 1;
|
afl_prev_loc = cur_loc >> 1;
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ void afl_maybe_log(unsigned long cur_loc) {
|
|||||||
char *read_file(char *path, unsigned long *length) {
|
char *read_file(char *path, unsigned long *length) {
|
||||||
|
|
||||||
unsigned long len;
|
unsigned long len;
|
||||||
char * buf;
|
char * buf;
|
||||||
|
|
||||||
FILE *fp = fopen(path, "rb");
|
FILE *fp = fopen(path, "rb");
|
||||||
fseek(fp, 0, SEEK_END);
|
fseek(fp, 0, SEEK_END);
|
||||||
|
@ -716,11 +716,15 @@ static void set_up_environment(void) {
|
|||||||
u8* qemu_preload = getenv("QEMU_SET_ENV");
|
u8* qemu_preload = getenv("QEMU_SET_ENV");
|
||||||
u8* afl_preload = getenv("AFL_PRELOAD");
|
u8* afl_preload = getenv("AFL_PRELOAD");
|
||||||
u8* buf;
|
u8* buf;
|
||||||
|
|
||||||
s32 i, afl_preload_size = strlen(afl_preload);
|
s32 i, afl_preload_size = strlen(afl_preload);
|
||||||
for (i = 0; i < afl_preload_size; ++i) {
|
for (i = 0; i < afl_preload_size; ++i) {
|
||||||
|
|
||||||
if (afl_preload[i] == ',')
|
if (afl_preload[i] == ',')
|
||||||
PFATAL("Comma (',') is not allowed in AFL_PRELOAD when -Q is specified!");
|
PFATAL(
|
||||||
|
"Comma (',') is not allowed in AFL_PRELOAD when -Q is "
|
||||||
|
"specified!");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qemu_preload)
|
if (qemu_preload)
|
||||||
@ -729,7 +733,7 @@ static void set_up_environment(void) {
|
|||||||
buf = alloc_printf("LD_PRELOAD=%s", afl_preload);
|
buf = alloc_printf("LD_PRELOAD=%s", afl_preload);
|
||||||
|
|
||||||
setenv("QEMU_SET_ENV", buf, 1);
|
setenv("QEMU_SET_ENV", buf, 1);
|
||||||
|
|
||||||
ck_free(buf);
|
ck_free(buf);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -861,9 +865,8 @@ static void find_binary(u8* fname) {
|
|||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
|
|
||||||
s32 opt;
|
s32 opt;
|
||||||
u8 mem_limit_given = 0, timeout_given = 0, unicorn_mode = 0,
|
u8 mem_limit_given = 0, timeout_given = 0, unicorn_mode = 0, use_wine = 0;
|
||||||
use_wine = 0;
|
|
||||||
char** use_argv;
|
char** use_argv;
|
||||||
|
|
||||||
doc_path = access(DOC_PATH, F_OK) ? "docs" : DOC_PATH;
|
doc_path = access(DOC_PATH, F_OK) ? "docs" : DOC_PATH;
|
||||||
|
@ -717,11 +717,15 @@ int main(int argc, char** argv) {
|
|||||||
u8* qemu_preload = getenv("QEMU_SET_ENV");
|
u8* qemu_preload = getenv("QEMU_SET_ENV");
|
||||||
u8* afl_preload = getenv("AFL_PRELOAD");
|
u8* afl_preload = getenv("AFL_PRELOAD");
|
||||||
u8* buf;
|
u8* buf;
|
||||||
|
|
||||||
s32 i, afl_preload_size = strlen(afl_preload);
|
s32 i, afl_preload_size = strlen(afl_preload);
|
||||||
for (i = 0; i < afl_preload_size; ++i) {
|
for (i = 0; i < afl_preload_size; ++i) {
|
||||||
|
|
||||||
if (afl_preload[i] == ',')
|
if (afl_preload[i] == ',')
|
||||||
PFATAL("Comma (',') is not allowed in AFL_PRELOAD when -Q is specified!");
|
PFATAL(
|
||||||
|
"Comma (',') is not allowed in AFL_PRELOAD when -Q is "
|
||||||
|
"specified!");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qemu_preload)
|
if (qemu_preload)
|
||||||
@ -730,7 +734,7 @@ int main(int argc, char** argv) {
|
|||||||
buf = alloc_printf("LD_PRELOAD=%s", afl_preload);
|
buf = alloc_printf("LD_PRELOAD=%s", afl_preload);
|
||||||
|
|
||||||
setenv("QEMU_SET_ENV", buf, 1);
|
setenv("QEMU_SET_ENV", buf, 1);
|
||||||
|
|
||||||
ck_free(buf);
|
ck_free(buf);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -365,11 +365,15 @@ static void set_up_environment(void) {
|
|||||||
u8* qemu_preload = getenv("QEMU_SET_ENV");
|
u8* qemu_preload = getenv("QEMU_SET_ENV");
|
||||||
u8* afl_preload = getenv("AFL_PRELOAD");
|
u8* afl_preload = getenv("AFL_PRELOAD");
|
||||||
u8* buf;
|
u8* buf;
|
||||||
|
|
||||||
s32 i, afl_preload_size = strlen(afl_preload);
|
s32 i, afl_preload_size = strlen(afl_preload);
|
||||||
for (i = 0; i < afl_preload_size; ++i) {
|
for (i = 0; i < afl_preload_size; ++i) {
|
||||||
|
|
||||||
if (afl_preload[i] == ',')
|
if (afl_preload[i] == ',')
|
||||||
PFATAL("Comma (',') is not allowed in AFL_PRELOAD when -Q is specified!");
|
PFATAL(
|
||||||
|
"Comma (',') is not allowed in AFL_PRELOAD when -Q is "
|
||||||
|
"specified!");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qemu_preload)
|
if (qemu_preload)
|
||||||
@ -378,7 +382,7 @@ static void set_up_environment(void) {
|
|||||||
buf = alloc_printf("LD_PRELOAD=%s", afl_preload);
|
buf = alloc_printf("LD_PRELOAD=%s", afl_preload);
|
||||||
|
|
||||||
setenv("QEMU_SET_ENV", buf, 1);
|
setenv("QEMU_SET_ENV", buf, 1);
|
||||||
|
|
||||||
ck_free(buf);
|
ck_free(buf);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -524,9 +528,8 @@ static void find_binary(u8* fname) {
|
|||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
|
|
||||||
s32 opt;
|
s32 opt;
|
||||||
u8 mem_limit_given = 0, timeout_given = 0, unicorn_mode = 0,
|
u8 mem_limit_given = 0, timeout_given = 0, unicorn_mode = 0, use_wine = 0;
|
||||||
use_wine = 0;
|
|
||||||
u32 tcnt = 0;
|
u32 tcnt = 0;
|
||||||
char** use_argv;
|
char** use_argv;
|
||||||
|
|
||||||
|
@ -889,11 +889,15 @@ static void set_up_environment(void) {
|
|||||||
u8* qemu_preload = getenv("QEMU_SET_ENV");
|
u8* qemu_preload = getenv("QEMU_SET_ENV");
|
||||||
u8* afl_preload = getenv("AFL_PRELOAD");
|
u8* afl_preload = getenv("AFL_PRELOAD");
|
||||||
u8* buf;
|
u8* buf;
|
||||||
|
|
||||||
s32 i, afl_preload_size = strlen(afl_preload);
|
s32 i, afl_preload_size = strlen(afl_preload);
|
||||||
for (i = 0; i < afl_preload_size; ++i) {
|
for (i = 0; i < afl_preload_size; ++i) {
|
||||||
|
|
||||||
if (afl_preload[i] == ',')
|
if (afl_preload[i] == ',')
|
||||||
PFATAL("Comma (',') is not allowed in AFL_PRELOAD when -Q is specified!");
|
PFATAL(
|
||||||
|
"Comma (',') is not allowed in AFL_PRELOAD when -Q is "
|
||||||
|
"specified!");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qemu_preload)
|
if (qemu_preload)
|
||||||
@ -902,7 +906,7 @@ static void set_up_environment(void) {
|
|||||||
buf = alloc_printf("LD_PRELOAD=%s", afl_preload);
|
buf = alloc_printf("LD_PRELOAD=%s", afl_preload);
|
||||||
|
|
||||||
setenv("QEMU_SET_ENV", buf, 1);
|
setenv("QEMU_SET_ENV", buf, 1);
|
||||||
|
|
||||||
ck_free(buf);
|
ck_free(buf);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -1052,9 +1056,8 @@ static void read_bitmap(u8* fname) {
|
|||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
|
|
||||||
s32 opt;
|
s32 opt;
|
||||||
u8 mem_limit_given = 0, timeout_given = 0, unicorn_mode = 0,
|
u8 mem_limit_given = 0, timeout_given = 0, unicorn_mode = 0, use_wine = 0;
|
||||||
use_wine = 0;
|
|
||||||
char** use_argv;
|
char** use_argv;
|
||||||
|
|
||||||
doc_path = access(DOC_PATH, F_OK) ? "docs" : DOC_PATH;
|
doc_path = access(DOC_PATH, F_OK) ? "docs" : DOC_PATH;
|
||||||
|
Reference in New Issue
Block a user