Fix saving files (#382)
This commit is contained in:
parent
c1bb407b34
commit
28e51309cc
@ -244,7 +244,7 @@ namespace hex::plugin::builtin::prv {
|
||||
|
||||
this->m_fileSize = this->m_fileStats.st_size;
|
||||
|
||||
this->m_mappedFile = ::mmap(nullptr, this->m_fileSize, PROT_READ | PROT_WRITE, MAP_PRIVATE, this->m_file, 0);
|
||||
this->m_mappedFile = ::mmap(nullptr, this->m_fileSize, PROT_READ | PROT_WRITE, MAP_SHARED, this->m_file, 0);
|
||||
if (this->m_mappedFile == nullptr) {
|
||||
::close(this->m_file);
|
||||
this->m_file = -1;
|
||||
@ -270,4 +270,4 @@ namespace hex::plugin::builtin::prv {
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -58,8 +58,9 @@ namespace hex::prv {
|
||||
}
|
||||
|
||||
void Provider::applyPatches() {
|
||||
for (auto &[patchAddress, patch] : getPatches())
|
||||
this->writeRaw( - this->getBaseAddress(), &patch, 1);
|
||||
for (auto &[patchAddress, patch] : getPatches()) {
|
||||
this->writeRaw(patchAddress - this->getBaseAddress(), &patch, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -163,4 +164,4 @@ namespace hex::prv {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user