* @brief Manager class for linker Elf. * * This class inherits from ElfScanner and provides methods for linker Elf. */
| 701 | * This class inherits from ElfScanner and provides methods for linker Elf. |
| 702 | */ |
| 703 | class LinkerScannerMgr : public ElfScanner |
| 704 | { |
| 705 | private: |
| 706 | kitty_linker_syms_t _linker_syms; |
| 707 | kitty_soinfo_offsets_t _soinfo_offsets; |
| 708 | bool _init; |
| 709 | |
| 710 | public: |
| 711 | LinkerScannerMgr() : ElfScanner(), _init(false) |
| 712 | { |
| 713 | memset(&_linker_syms, 0, sizeof(_linker_syms)); |
| 714 | memset(&_soinfo_offsets, 0, sizeof(_soinfo_offsets)); |
| 715 | } |
| 716 | |
| 717 | /** |
| 718 | * @brief Constructor for LinkerScannerMgr with a linker base address. |
| 719 | * @param pMem Pointer to the memory operation interface. |
| 720 | * @param linkerBase The base address of the linker. |
| 721 | */ |
| 722 | LinkerScannerMgr(IKittyMemOp *pMem, const ElfScanner &linkerElf); |
| 723 | |
| 724 | /** |
| 725 | * @brief Constructor for LinkerScannerMgr with the linker ElfScanner object. |
| 726 | * @param pMem Pointer to the memory operation interface. |
| 727 | * @param linkerElf Linker ElfScanner object. |
| 728 | */ |
| 729 | LinkerScannerMgr(IKittyMemOp *pMem, uintptr_t linkerBase); |
| 730 | |
| 731 | /** |
| 732 | * @brief Initializes the linker scanner. |
| 733 | * @return True if initialization is successful, false otherwise. |
| 734 | */ |
| 735 | bool init(); |
| 736 | |
| 737 | /** |
| 738 | * @brief Returns true if initialized, false otherwise. |
| 739 | */ |
| 740 | inline bool isInitialized() const |
| 741 | { |
| 742 | return isValid() && _init; |
| 743 | } |
| 744 | |
| 745 | /** |
| 746 | * @brief Converts the LinkerScannerMgr object to an ElfScanner pointer. |
| 747 | * @return The ElfScanner pointer. |
| 748 | */ |
| 749 | inline ElfScanner *asELF() const |
| 750 | { |
| 751 | return (ElfScanner *)this; |
| 752 | } |
| 753 | |
| 754 | /** |
| 755 | * @brief Returns the linker symbols offsets. |
| 756 | */ |
| 757 | inline kitty_linker_syms_t linker_offsets() const |
| 758 | { |
| 759 | return _linker_syms; |
| 760 | } |
no outgoing calls
no test coverage detected