Added build and install instructions for afl-plot-ui
I am implicitly assuming that the user already has GK and pkg-config
installed, as requested in the build instructions in the main README
MODIFY
GNUmakefile
GNUmakefile
@@ -570,6 +570,7 @@ clean:
$(MAKE) -C utils/afl_network_proxy clean
$(MAKE) -C utils/socket_fuzzing clean
$(MAKE) -C utils/argv_fuzzing clean
+ $(MAKE) -C utils/plot_ui clean
$(MAKE) -C qemu_mode/unsigaction clean
$(MAKE) -C qemu_mode/libcompcov clean
$(MAKE) -C qemu_mode/libqasan clean
@@ -601,6 +602,7 @@ distrib: all
$(MAKE) -C utils/afl_network_proxy
$(MAKE) -C utils/socket_fuzzing
$(MAKE) -C utils/argv_fuzzing
+ $(MAKE) -C utils/plot_ui
-$(MAKE) -C frida_mode
-cd qemu_mode && sh ./build_qemu_support.sh
-cd unicorn_mode && unset CFLAGS && sh ./build_unicorn_support.sh
@@ -612,6 +614,7 @@ binary-only: test_shm test_python ready $(PROGS)
$(MAKE) -C utils/afl_network_proxy
$(MAKE) -C utils/socket_fuzzing
$(MAKE) -C utils/argv_fuzzing
+ $(MAKE) -C utils/plot_ui
-$(MAKE) -C frida_mode
-cd qemu_mode && sh ./build_qemu_support.sh
-cd unicorn_mode && unset CFLAGS && sh ./build_unicorn_support.sh
@@ -622,6 +625,7 @@ source-only: all
-$(MAKE) -f GNUmakefile.gcc_plugin
$(MAKE) -C utils/libdislocator
$(MAKE) -C utils/libtokencap
+ $(MAKE) -C utils/plot_ui
%.8: %
@echo .TH $* 8 $(BUILD_DATE) "afl++" > $@
@@ -650,6 +654,7 @@ install: all $(MANPAGES)
@rm -f $${DESTDIR}$(HELPER_PATH)/afl-llvm-rt.o $${DESTDIR}$(HELPER_PATH)/afl-llvm-rt-32.o $${DESTDIR}$(HELPER_PATH)/afl-llvm-rt-64.o $${DESTDIR}$(HELPER_PATH)/afl-gcc-rt.o
install -m 755 $(PROGS) $(SH_PROGS) $${DESTDIR}$(BIN_PATH)
@if [ -f afl-qemu-trace ]; then install -m 755 afl-qemu-trace $${DESTDIR}$(BIN_PATH); fi
+ @if [ -f utils/plot_ui/afl-plot-ui ]; then install -m 755 utils/plot_ui/afl-plot-ui $${DESTDIR}$(BIN_PATH); fi
@if [ -f libdislocator.so ]; then set -e; install -m 755 libdislocator.so $${DESTDIR}$(HELPER_PATH); fi
@if [ -f libtokencap.so ]; then set -e; install -m 755 libtokencap.so $${DESTDIR}$(HELPER_PATH); fi
@if [ -f libcompcov.so ]; then set -e; install -m 755 libcompcov.so $${DESTDIR}$(HELPER_PATH); fi

DELETE
src/afl-plot-ui.c
-#include <gtk/gtk.h>
-#include <gtk/gtkx.h>
-#include <stdio.h>
-
-#define WIDTH 400
-#define HEIGHT 640
-
-static void plot_toggled(GtkWidget *caller, gpointer data);
-
-int main(int argc, char **argv) {
-
- GtkWidget *window;
- GtkWidget *main_vbox;
-
- GtkWidget *cbuttons_frame;
- GtkWidget *cbuttons_hbox;
-
- GtkWidget *separator_maj, *separator_min1, *separator_min2, *separator_min3;
-
- GtkWidget *plots_vbox;
- GtkWidget *plot_edges_frame, *plot_exec_speed_frame, *plot_high_freq_frame,
- *plot_low_freq_frame;
- GtkWidget *plot_edges, *plot_exec_speed, *plot_high_freq, *plot_low_freq;
-
- gtk_init(&argc, &argv);
-
- window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- gtk_window_set_default_size(GTK_WINDOW(window), WIDTH, HEIGHT);
- gtk_window_set_title(GTK_WINDOW(window), "Graph drawing");
- gtk_container_set_border_width(GTK_CONTAINER(window), 10);
-
- main_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
-
- cbuttons_frame = gtk_frame_new("Select the plots");
- gtk_container_set_border_width(GTK_CONTAINER(cbuttons_frame), 5);
-
- cbuttons_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 1);
-
- GtkWidget *cbutton_edges, *cbutton_exec_speed, *cbutton_high_freq,
- *cbutton_low_freq;
-
- cbutton_edges = gtk_check_button_new_with_label("Edges");
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(cbutton_edges), TRUE);
- g_signal_connect(cbutton_edges, "toggled", G_CALLBACK(plot_toggled),
- &plot_edges_frame);
-
- cbutton_exec_speed = gtk_check_button_new_with_label("Execution Speed");
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(cbutton_exec_speed), TRUE);
- g_signal_connect(cbutton_exec_speed, "toggled", G_CALLBACK(plot_toggled),
- &plot_exec_speed_frame);
-
- cbutton_high_freq = gtk_check_button_new_with_label("High Frequency");
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(cbutton_high_freq), TRUE);
- g_signal_connect(cbutton_high_freq, "toggled", G_CALLBACK(plot_toggled),
- &plot_high_freq_frame);
-
- cbutton_low_freq = gtk_check_button_new_with_label("Low Frequency");
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(cbutton_low_freq), TRUE);
- g_signal_connect(cbutton_low_freq, "toggled", G_CALLBACK(plot_toggled),
- &plot_low_freq_frame);
-
- gtk_box_pack_start(GTK_BOX(cbuttons_hbox), cbutton_edges, TRUE, TRUE, 1);
- gtk_box_pack_start(GTK_BOX(cbuttons_hbox), cbutton_exec_speed, TRUE, TRUE, 1);
- gtk_box_pack_start(GTK_BOX(cbuttons_hbox), cbutton_high_freq, TRUE, TRUE, 1);
- gtk_box_pack_start(GTK_BOX(cbuttons_hbox), cbutton_low_freq, TRUE, TRUE, 1);
-
- gtk_container_add(GTK_CONTAINER(cbuttons_frame), cbuttons_hbox);
- gtk_box_pack_start(GTK_BOX(main_vbox), cbuttons_frame, FALSE, TRUE, 1);
-
- separator_maj = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
- gtk_box_pack_start(GTK_BOX(main_vbox), separator_maj, FALSE, TRUE, 1);
-
- plots_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
-
- plot_edges_frame = gtk_frame_new("Edges");
- gtk_container_set_border_width(GTK_CONTAINER(plot_edges_frame), 5);
- plot_edges = gtk_socket_new();
- gtk_container_add(GTK_CONTAINER(plot_edges_frame), plot_edges);
-
- plot_exec_speed_frame = gtk_frame_new("Exec Speed");
- gtk_container_set_border_width(GTK_CONTAINER(plot_exec_speed_frame), 5);
- plot_exec_speed = gtk_socket_new();
- gtk_container_add(GTK_CONTAINER(plot_exec_speed_frame), plot_exec_speed);
-
- plot_high_freq_frame = gtk_frame_new("High Frequency");
- gtk_container_set_border_width(GTK_CONTAINER(plot_high_freq_frame), 5);
- plot_high_freq = gtk_socket_new();
- gtk_container_add(GTK_CONTAINER(plot_high_freq_frame), plot_high_freq);
-
- plot_low_freq_frame = gtk_frame_new("Low Frequency");
- gtk_container_set_border_width(GTK_CONTAINER(plot_low_freq_frame), 5);
- plot_low_freq = gtk_socket_new();
- gtk_container_add(GTK_CONTAINER(plot_low_freq_frame), plot_low_freq);
-
- separator_min1 = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
- separator_min2 = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
- separator_min3 = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
-
- gtk_box_pack_start(GTK_BOX(plots_vbox), plot_edges_frame, TRUE, TRUE, 1);
- gtk_box_pack_start(GTK_BOX(plots_vbox), separator_min1, FALSE, TRUE, 1);
-
- gtk_box_pack_start(GTK_BOX(plots_vbox), plot_exec_speed_frame, TRUE, TRUE, 1);
- gtk_box_pack_start(GTK_BOX(plots_vbox), separator_min2, FALSE, TRUE, 1);
-
- gtk_box_pack_start(GTK_BOX(plots_vbox), plot_high_freq_frame, TRUE, TRUE, 1);
- gtk_box_pack_start(GTK_BOX(plots_vbox), separator_min3, FALSE, TRUE, 1);
-
- gtk_box_pack_start(GTK_BOX(plots_vbox), plot_low_freq_frame, TRUE, TRUE, 1);
-
- gtk_box_pack_start(GTK_BOX(main_vbox), plots_vbox, TRUE, TRUE, 1);
-
- gtk_container_add(GTK_CONTAINER(window), main_vbox);
-
- guint id_edges = gtk_socket_get_id(GTK_SOCKET(plot_edges));
- guint id_exec_speed = gtk_socket_get_id(GTK_SOCKET(plot_exec_speed));
- guint id_high_freq = gtk_socket_get_id(GTK_SOCKET(plot_high_freq));
- guint id_low_freq = gtk_socket_get_id(GTK_SOCKET(plot_low_freq));
-
- printf("%x\n%x\n%x\n%x\n", id_edges, id_exec_speed, id_high_freq,
- id_low_freq);
-
- fclose(stdout);
-
- g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(gtk_main_quit),
- NULL);
- gtk_widget_show_all(window);
- gtk_main();
-
- return EXIT_SUCCESS;
-
-}
-
-static void plot_toggled(GtkWidget *caller, gpointer data) {
-
- gboolean state = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(caller));
-
- GtkWidget *widget = *(GtkWidget **)data;
-
- if (state) {
-
- gtk_widget_show(widget);
-
- } else {
-
- gtk_widget_hide(widget);
-
- }
-
-}

Added build and install instructions for afl-plot-ui

I am implicitly assuming that the user already has GK and pkg-config
installed, as requested in the build instructions in the main README