Skip to content

Commit

Permalink
[BUGFIX] In isRealMapping: disable FS redirection when loading mapped…
Browse files Browse the repository at this point in the history
… files to compare
  • Loading branch information
hasherezade committed Nov 6, 2022
1 parent c2788e9 commit 3d08e5a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scanners/mempage_data.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "mempage_data.h"
#include "module_data.h"
#include "../utils/process_util.h"

using namespace pesieve;

Expand Down Expand Up @@ -64,7 +65,10 @@ bool pesieve::MemPageData::isRealMapping()
#endif
return false;
}
PVOID old_val = nullptr;
util::wow64_disable_fs_redirection(&old_val);
HANDLE file = CreateFileA(this->mapped_name.c_str(), GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
util::wow64_revert_fs_redirection(old_val);
if(file == INVALID_HANDLE_VALUE) {
#ifdef _DEBUG
std::cerr << "Could not open file!" << std::endl;
Expand Down

0 comments on commit 3d08e5a

Please sign in to comment.