summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'dev/kernel')
-rw-r--r--dev/kernel/CFKit/Utils.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/dev/kernel/CFKit/Utils.h b/dev/kernel/CFKit/Utils.h
index a5df8097..97b0ee53 100644
--- a/dev/kernel/CFKit/Utils.h
+++ b/dev/kernel/CFKit/Utils.h
@@ -16,7 +16,11 @@ inline auto ldr_find_exec_header(DosHeaderPtr ptrDos) -> LDR_EXEC_HEADER_PTR {
if (ptrDos->eMagic[1] != kMagMz1) return nullptr;
+#ifdef __NE_AMD64__
return (LDR_EXEC_HEADER_PTR) (VoidPtr) (&ptrDos->eLfanew + 1);
+#else
+ return (LDR_EXEC_HEADER_PTR) (VoidPtr) (&ptrDos->eLfanew);
+#endif
}
/// @brief Finds the PE optional header inside the blob.