/* ------------------------------------------- Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved. File: PECodeMgr.h Purpose: PE32+ Code Mgr and Dylib mgr. Revision History: 12/02/24: Added file (amlel) ------------------------------------------- */ #pragma once //////////////////////////////////////////////////// // LAST REV: Mon Feb 12 13:52:01 CET 2024 //////////////////////////////////////////////////// #include #include #include #include #include #ifndef INC_PROCESS_SCHEDULER_H #include #endif #define kPeApplicationMime "application/vnd-portable-executable" namespace Kernel { /// /// \name PE32Loader /// \brief PE32+ loader class. /// class PE32Loader : public LoaderInterface { private: explicit PE32Loader() = delete; public: explicit PE32Loader(const VoidPtr blob); explicit PE32Loader(const Char* path); ~PE32Loader() override; public: NE_COPY_DEFAULT(PE32Loader) public: const Char* Path() override; const Char* AsString() override; const Char* MIME() override; public: ErrorOr FindStart() override; ErrorOr FindSymbol(const Char* name, Int32 kind) override; ErrorOr GetBlob() override; public: bool IsLoaded() noexcept; private: #ifdef __FSKIT_INCLUDES_NEFS__ OwnPtr> fFile; #elif defined(__FSKIT_INCLUDES_HEFS__) OwnPtr> fFile; #else OwnPtr> fFile; #endif // __FSKIT_INCLUDES_NEFS__ Ref fPath; VoidPtr fCachedBlob; bool fBad; }; } // namespace Kernel