5 : buf(v_buf), bitMode(v_bitMode)
7 if (v_buf == NULL)
throw ExeException(
"Cannot make Exe from NULL buffer");
29 return (addr >= mappedFrom && addr < mappedTo) ? true :
false;
40 if (va < mappedFrom)
return va;
54 if (inType == outType)
return inAddr;
61 inAddr = inAddr - imgBase;
77 return inAddr - imgBase;
80 return inAddr + imgBase;
99 offset =
VaToRva(offset,
false);
104 convertedOffset = this->
rvaToRaw(offset);
106 if (allowExceptions)
throw e;
112 "Address out of bounds: offset = %llX addrType = %u",
113 static_cast<unsigned long long>(offset),
114 static_cast<unsigned int>(aT)
119 return convertedOffset;
125 if (this->
isValidAddr(offset, hintType) ==
false) {
127 }
else return hintType;
133 if (this->
isValidAddr(offset, hintType) ==
false) {
140 if (this->
isValidAddr(offset, hintType) ==
false) {
const offset_t INVALID_ADDR
virtual BYTE * getContentAt(offset_t offset, bufsize_t size, bool allowExceptions=false)
virtual offset_t toRaw(offset_t offset, addr_type addrType, bool allowExceptions=false)
virtual bool isValidAddr(offset_t addr, addr_type addrType)
BYTE * getContentAt(offset_t offset, bufsize_t size, bool allowExceptions=false)
Executable(AbstractByteBuffer *v_buf, exe_bits v_bitMode)
virtual offset_t VaToRva(offset_t va, bool autodetect)
virtual bufsize_t getMappedSize(Executable::addr_type aType)=0
virtual offset_t rawToRva(offset_t raw)=0
virtual offset_t rvaToRaw(offset_t rva)=0
virtual offset_t getImageBase()=0
virtual offset_t convertAddr(offset_t inAddr, Executable::addr_type inType, Executable::addr_type outType)
Executable::addr_type detectAddrType(offset_t addr, Executable::addr_type hintType)
bool append(dbg_level lvl, const char *format,...)