2#ifndef ROSE_SgAsmPEImportDirectory_H
3#define ROSE_SgAsmPEImportDirectory_H
5#include <Cxx_GrammarDeclarations.h>
6#include <SgAsmExecutableFileFormat.h>
27#include <Rose/BinaryAnalysis/Address.h>
28#include <Rose/BinaryAnalysis/AddressIntervalSet.h>
29#include <Rose/BinaryAnalysis/RelativeVirtualAddress.h>
30#include <sageContainer.h>
32#ifdef ROSE_SgAsmPEImportDirectory_IMPL
33#include <SgAsmGenericString.h>
34#include <SgAsmPEImportItemList.h>
42#if !defined(DOCUMENTATION)
57#ifdef ROSE_ENABLE_BOOST_SERIALIZATION
59 friend class boost::serialization::access;
65 s & BOOST_SERIALIZATION_NVP(p_dllName);
66 s & BOOST_SERIALIZATION_NVP(p_dllNameRva);
67 s & BOOST_SERIALIZATION_NVP(p_dll_name_nalloc);
68 s & BOOST_SERIALIZATION_NVP(p_time);
69 s & BOOST_SERIALIZATION_NVP(p_forwarder_chain);
70 s & BOOST_SERIALIZATION_NVP(p_ilt_rva);
71 s & BOOST_SERIALIZATION_NVP(p_ilt_nalloc);
72 s & BOOST_SERIALIZATION_NVP(p_iat_rva);
73 s & BOOST_SERIALIZATION_NVP(p_iat_nalloc);
74 s & BOOST_SERIALIZATION_NVP(p_imports);
85 struct PEImportDirectory_disk {
88 uint32_t forwarder_chain;
89 uint32_t dll_name_rva;
92#if !defined(SWIG) && !defined(_MSC_VER)
93 __attribute__((packed))
131 size_t const& get_dll_name_nalloc()
const;
132 void set_dll_name_nalloc(
size_t const&);
141 time_t
const& get_time()
const;
142 void set_time(time_t
const&);
151 unsigned const& get_forwarder_chain()
const;
152 void set_forwarder_chain(
unsigned const&);
172 size_t const& get_ilt_nalloc()
const;
173 void set_ilt_nalloc(
size_t const&);
193 size_t const& get_iat_nalloc()
const;
194 void set_iat_nalloc(
size_t const&);
231 virtual void dump(FILE*,
const char *prefix, ssize_t idx)
const;
238 size_t iatRequiredSize()
const;
262 size_t nalloc)
const;
270 const
Rose::BinaryAnalysis::RelativeVirtualAddress& get_dll_name_rva() const ROSE_DEPRECATED("use get_dllNameRva");
271 Rose::BinaryAnalysis::RelativeVirtualAddress& get_dll_name_rva() ROSE_DEPRECATED("use get_dllNameRva");
272 void set_dll_name_rva(const
Rose::BinaryAnalysis::RelativeVirtualAddress&) ROSE_DEPRECATED("use set_dllNameRva");
273 size_t iat_required_size() const ROSE_DEPRECATED("use iatRequiredSize");
274 int find_import_item(const
SgAsmPEImportItem*,
int=0) const ROSE_DEPRECATED("use findImportItem");
275 size_t hintname_table_extent(
Rose::BinaryAnalysis::AddressIntervalSet&) const ROSE_DEPRECATED("use hintNameTableExtent");
291 void initializeProperties();
310 virtual std::
string class_name() const override;
313 virtual VariantT variantT() const override;
318 enum { static_variant = V_SgAsmPEImportDirectory };
333 static const unsigned pool_size;
335 static std::vector<unsigned char *> pools;
340 static unsigned long initializeStorageClassArray(SgAsmPEImportDirectoryStorageClass *);
343 static void clearMemoryPool();
344 static void deleteMemoryPool();
347 static void extendMemoryPoolForFileIO();
355 static unsigned long getNumberOfValidNodesAndSetGlobalIndexInFreepointer(
unsigned long);
357 static void resetValidFreepointers();
359 static unsigned long getNumberOfLastValidPointer();
362#if defined(INLINE_FUNCTIONS)
364 inline void *
operator new (
size_t size);
367 void *
operator new (
size_t size);
370 void operator delete (
void* pointer,
size_t size);
373 void operator delete (
void* pointer)
419#ifndef ROSE_USE_INTERNAL_FRONTEND_DEVELOPMENT
422 virtual RTIReturnType
roseRTI()
override;
436 virtual const char*
sage_class_name() const override ROSE_DEPRECATED_FUNCTION;
442 virtual int variant() const ROSE_DEPRECATED_FUNCTION;
624 friend class SgAsmPEImportDirectoryStorageClass;
627 friend class AstSpecificDataManagingClass;
630 friend class AstSpecificDataManagingClassStorageClass;
662#define BUILD_ATERM_SUPPORT 0
663 #if BUILD_ATERM_SUPPORT
664 #ifdef ROSE_USE_ROSE_ATERM_SUPPORT
676 virtual ATerm generate_ATerm()
override;
679 virtual void generate_ATerm_Annotation(ATerm & term)
override;
722size_t p_dll_name_nalloc;
730unsigned p_forwarder_chain;
Class holding static data and functions supporting File I/O.
Attribute containing a regex expression as a string.
Optionally bound relative virtual address.
Base class for strings related to binary specimens.
One import directory per library.
A list of imported items.
A single imported object.
Portable Executable Import Section.
Supporting class from copy mechanism within ROSE.
This class represents the base class for all IR nodes within Sage III.
virtual RTIReturnType roseRTI()
return C++ Runtime-Time-Information
virtual size_t get_numberOfTraversalSuccessors() const
return number of children in the traversal successor list
virtual std::vector< std::string > get_traversalSuccessorNamesContainer() const
container of names of variables or container indices used used in the traversal to access AST success...
virtual void debugSerializationEnd(const char *className)
Called by generated serializers.
static std::string getNodeIdString(SgNode *sgnode)
compute the NodeId for a particular SgNode*.
virtual bool isInMemoryPool()
FOR INTERNAL USE This is used in internal tests to verify that all IR nodes are allocated from the he...
int variant() const
Older version function returns enum value "NODE".
virtual void processDataMemberReferenceToPointers(ReferenceToPointerHandler *)
FOR INTERNAL USE Processes pairs of references to SgNode* and strings for use in AST tools
virtual size_t get_childIndex(SgNode *child) const
index-based access to traversal successors by child node
virtual std::vector< SgNode * > get_traversalSuccessorContainer() const
container of pointers to AST successor nodes used in the traversal overridden in every class by gener...
virtual long getChildIndex(SgNode *childNode) const
FOR INTERNAL USE Returns a unique index value for the childNode in the list of children at this IR no...
virtual void debugSerializationBegin(const char *className)
Called by generated serializers.
virtual SgNode * get_traversalSuccessorByIndex(size_t idx) const
index-based access to traversal successors by index number
static void visitRepresentativeNode(ROSE_VisitTraversal &visit)
FOR INTERNAL USE Support for type-based traversal.
virtual void checkDataMemberPointersIfInMemoryPool()
FOR INTERNAL USE This is used in internal tests to verify that all IR nodes are allocated from the he...
static size_t numberOfNodes()
Returns the total number of IR nodes of this type.
virtual void accept(ROSE_VisitorPattern &visitor)
support for the classic visitor pattern done in GoF
static void traverseMemoryPoolVisitorPattern(ROSE_VisitorPattern &visitor)
FOR INTERNAL USE Support for visitor pattern.
void executeVisitorMemberFunction(ROSE_VisitorPattern &visitor)
FOR INTERNAL USE Support for visitor pattern.
static SgNode * getNodeByNodeId(VariantT variantT, size_t poolIdx, size_t itemIdx)
Find a node by its variant type, pool index, and item index.
static size_t memoryUsage()
Returns the size in bytes of the total memory allocated for all IR nodes of this type.
static void traverseMemoryPoolNodes(ROSE_VisitTraversal &visit)
FOR INTERNAL USE Support for visitor pattern over all IR nodes by type of IR node.
virtual const char * sage_class_name() const
generates string representing the class name: (e.g. for SgNode returns "SgNode").
virtual std::vector< std::pair< SgNode *, std::string > > returnDataMemberPointers() const
FOR INTERNAL USE Returns STL vector of pairs of SgNode* and strings for use in AST tools
static SgNode * getNodeByNodeIdInternal(size_t poolIdx, size_t itemIdx)
FOR INTERNAL USE Find an SgNode from its memory pool and location therin.
SgNode * addRegExpAttribute(std::string s, AstRegExAttribute *a)
Support for AST matching using regular expression.
void parse(SgAsmGenericFile *)
Main function to parse DWARF information.
std::uint64_t Address
Address.
void serialize(std::ostream &output, Graph &graph)
Serialize a graph into a stream of bytes.
void copy(const Word *src, const BitRange &srcRange, Word *dst, const BitRange &dstRange)
Copy some bits.