summaryrefslogtreecommitdiff
path: root/view/pe/peview.cpp
diff options
context:
space:
mode:
authorXusheng <xusheng@vector35.com>2024-06-10 17:07:09 +0800
committerXusheng <xusheng@vector35.com>2024-06-10 17:07:09 +0800
commitd4d9e3fe150955598cbaa40608fcbff3487a2533 (patch)
tree872cfc4833f661036e79d3300d8d99b59d5b6dbb /view/pe/peview.cpp
parent7a521850cfce3f0b879210a34907380642c3b220 (diff)
Correctly parse the value of guardCFCheckFunctionPointer and guardCFDispatchFunctionPointer in case of rebasing. Fix https://github.com/Vector35/binaryninja-api/issues/5535
Diffstat (limited to 'view/pe/peview.cpp')
-rw-r--r--view/pe/peview.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/view/pe/peview.cpp b/view/pe/peview.cpp
index bdf8175d..8e172e92 100644
--- a/view/pe/peview.cpp
+++ b/view/pe/peview.cpp
@@ -2303,6 +2303,7 @@ bool PEView::Init()
{
reader.Seek(RVAToFileOffset(guardCFCheckFunctionPointer - m_imageBase));
guardCFCheckFunction = m_is64 ? reader.Read64() : reader.Read32();
+ guardCFCheckFunction += (m_imageBase - m_peImageBase);
}
uint64_t guardCFDispatchFunction = 0;
@@ -2310,6 +2311,7 @@ bool PEView::Init()
{
reader.Seek(RVAToFileOffset(guardCFDispatchFunctionPointer - m_imageBase));
guardCFDispatchFunction = m_is64 ? reader.Read64() : reader.Read32();
+ guardCFDispatchFunction += (m_imageBase - m_peImageBase);
}
auto functionPointer = Type::PointerType(platform->GetArchitecture(), Type::FunctionType(Type::VoidType(), platform->GetDefaultCallingConvention(), {}));