Fix issues with cmplog caused by coverage writing to STDIN
MODIFY
frida_mode/src/instrument/instrument_coverage.c
frida_mode/src/instrument/instrument_coverage.c
char *instrument_coverage_filename = NULL;
static int coverage_fd = -1;
-static int coverage_pipes[2] = {0};
+static int coverage_pipes[2] = {-1, -1};
static uint64_t coverage_last_start = 0;
static GHashTable *coverage_hash = NULL;
static GArray * coverage_modules = NULL;
@@ -353,12 +353,16 @@ void instrument_coverage_init(void) {
void instrument_coverage_start(uint64_t address) {
+ if (instrument_coverage_filename == NULL) { return; }
+
coverage_last_start = address;
}
void instrument_coverage_end(uint64_t address) {
+ if (instrument_coverage_filename == NULL) { return; }
+
coverage_data_t data = {
.start = coverage_last_start, .end = address, .module = NULL};

Fix issues with cmplog caused by coverage writing to STDIN