sys: Remove patched bytes when their value is the same as the original
This commit is contained in:
parent
66a13266e6
commit
4bc074fa84
@ -154,8 +154,16 @@ namespace hex::prv {
|
|||||||
if (createUndo)
|
if (createUndo)
|
||||||
createUndoPoint();
|
createUndoPoint();
|
||||||
|
|
||||||
for (u64 i = 0; i < size; i++)
|
for (u64 i = 0; i < size; i++) {
|
||||||
getPatches()[offset + i] = reinterpret_cast<const u8 *>(buffer)[i];
|
u8 patch = reinterpret_cast<const u8 *>(buffer)[i];
|
||||||
|
u8 originalValue = 0x00;
|
||||||
|
this->readRaw(offset + i, &originalValue, sizeof(u8));
|
||||||
|
|
||||||
|
if (patch == originalValue)
|
||||||
|
getPatches().erase(offset + i);
|
||||||
|
else
|
||||||
|
getPatches()[offset + i] = patch;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Provider::createUndoPoint() {
|
void Provider::createUndoPoint() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user