diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-08-18 21:39:29 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-08-18 21:39:29 +0200 |
| commit | da70596895d8135e08f8caac6978117697b4c021 (patch) | |
| tree | 2516785b5434df8453687f05dc8dd877438901ab /dev/Kernel/CFKit/LoaderUtils.hxx | |
| parent | 005de79004c9d30e64bdee6e14e06f9d47d1f2ab (diff) | |
[REFACTOR]
Improved project structure.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/Kernel/CFKit/LoaderUtils.hxx')
| -rw-r--r-- | dev/Kernel/CFKit/LoaderUtils.hxx | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/dev/Kernel/CFKit/LoaderUtils.hxx b/dev/Kernel/CFKit/LoaderUtils.hxx deleted file mode 100644 index 3edacc67..00000000 --- a/dev/Kernel/CFKit/LoaderUtils.hxx +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef __CFKIT_LOADER_UTILS_HXX__ -#define __CFKIT_LOADER_UTILS_HXX__ - -#include <KernelKit/PE.hxx> -#include <KernelKit/MSDOS.hxx> - -namespace Kernel -{ - /// @brief Find the PE header inside the blob. - inline auto ldr_find_exec_header(DosHeaderPtr ptrDos) -> ExecHeaderPtr - { - if (!ptrDos) - return nullptr; - - if (ptrDos->eMagic[0] != kMagMz0) - return nullptr; - - if (ptrDos->eMagic[1] != kMagMz1) - return nullptr; - - return (ExecHeaderPtr)(VoidPtr)(&ptrDos->eLfanew + 1); - } - - /// @brief Find the PE optional header inside the blob. - inline auto ldr_find_opt_exec_header(DosHeaderPtr ptrDos) -> ExecOptionalHeaderPtr - { - if (!ptrDos) - return nullptr; - - auto exec = ldr_find_exec_header(ptrDos); - - if (!exec) - return nullptr; - - return (ExecOptionalHeaderPtr)(VoidPtr)(&exec->mCharacteristics + 1); - } - - /// @brief Find the PE header inside the blob. - /// @note overloaded function. - inline auto ldr_find_exec_header(const Char* ptrDos) -> ExecHeaderPtr - { - return ldr_find_exec_header((DosHeaderPtr)ptrDos); - } - - - /// @brief Find the PE header inside the blob. - /// @note overloaded function. - inline auto ldr_find_opt_exec_header(const Char* ptrDos) -> ExecOptionalHeaderPtr - { - return ldr_find_opt_exec_header((DosHeaderPtr)ptrDos); - } -} // namespace Kernel - -#endif // ifndef __CFKIT_LOADER_UTILS_HXX__ |
