if (binary->isELF()) {
bool is64bit = (binary->getData()[4] == 0x02);
- uint64_t entry(0);
for (int i(0); i < (is64bit? 8 : 4); ++i) {
if (binary->isLittleEndian()) {
- entry |= (unsigned int)((unsigned char)binary->getData()[0x18 + i]) << 8*i;
+ _entryAddress |= (unsigned int)((unsigned char)binary->getData()[0x18 + i]) << 8*i;
} else {
- entry = entry << 8;
- entry |= (unsigned char)binary->getData()[0x18 + i];
+ _entryAddress = _entryAddress << 8;
+ _entryAddress |= (unsigned char)binary->getData()[0x18 + i];
}
}
- LOG4CXX_DEBUG(logger, "Adding entry at: " << std::hex << entry);
+ LOG4CXX_DEBUG(logger, "Adding entryAddress at: " << std::hex << _entryAddress);
std::stringstream s;
- s << "<_start 0x" << std::hex << entry << ">";
+ s << "<_start 0x" << std::hex << _entryAddress << ">";
- disassembleFunctionAt(entry, s.str());
+ disassembleFunctionAt(_entryAddress, s.str());
}
if (functions.empty()) {
void start();
void getSymbols() {}
- uint64_t entryAddress() {}
+ uint64_t entryAddress() {return _entryAddress;}
void forEachFunction(std::function<void (uint64_t, Function*)> callback);
void printEachInstruction(uint64_t start, uint64_t end,
std::map<std::string, llvm::object::SectionRef> sections;
std::map<std::string, llvm::object::SymbolRef> symbols;
InformationManager * manager;
+ uint64_t _entryAddress;
};
#endif