mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-12 18:18:07 +00:00
Don't corrupt instruction if map offset is too large
This commit is contained in:
@ -402,6 +402,18 @@ bool instrument_write_inline(GumArm64Writer *cw, GumAddress code_addr,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The mov instruction supports up to a 16-bit offset. If our offset is out of
|
||||||
|
* range, then it can end up clobbering the op-code portion of the instruction
|
||||||
|
* rather than just the operands. So return false and fall back to the
|
||||||
|
* alternative instrumentation.
|
||||||
|
*/
|
||||||
|
if (area_offset > UINT16_MAX) {
|
||||||
|
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
code.code.mov_x0_curr_loc |= area_offset << 5;
|
code.code.mov_x0_curr_loc |= area_offset << 5;
|
||||||
|
|
||||||
if (!instrument_patch_ardp(
|
if (!instrument_patch_ardp(
|
||||||
|
Reference in New Issue
Block a user