mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-12 18:18:07 +00:00
Fix endianness of coverage data on big endian systems
This commit is contained in:
@ -151,6 +151,7 @@ instances run CMPLOG mode and instrumentation of the binary is less frequent
|
|||||||
* `AFL_FRIDA_INST_DEBUG_FILE` - File to write raw assembly of original blocks
|
* `AFL_FRIDA_INST_DEBUG_FILE` - File to write raw assembly of original blocks
|
||||||
and their instrumented counterparts during block compilation.
|
and their instrumented counterparts during block compilation.
|
||||||
|
|
||||||
|
```
|
||||||
Creating block for 0x7ffff7953313:
|
Creating block for 0x7ffff7953313:
|
||||||
0x7ffff7953313 mov qword ptr [rax], 0
|
0x7ffff7953313 mov qword ptr [rax], 0
|
||||||
0x7ffff795331a add rsp, 8
|
0x7ffff795331a add rsp, 8
|
||||||
|
@ -317,6 +317,12 @@ static void coverage_write_events(void *key, void *value, void *user_data) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
|
||||||
|
evt.offset = __builtin_bswap32(evt.offset);
|
||||||
|
evt.length = __builtin_bswap16(evt.length);
|
||||||
|
evt.module = __builtin_bswap16(evt.module);
|
||||||
|
#endif
|
||||||
|
|
||||||
coverage_write(fd, &evt, sizeof(coverage_event_t));
|
coverage_write(fd, &evt, sizeof(coverage_event_t));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user