]> git.siccegge.de Git - frida/frida.git/commitdiff
implement entryAddress()
authorChristoph Egger <siccegge@faui49man12.informatik.uni-erlangen.de>
Wed, 14 Jan 2015 16:51:01 +0000 (17:51 +0100)
committerChristoph Egger <siccegge@faui49man12.informatik.uni-erlangen.de>
Wed, 14 Jan 2015 16:51:01 +0000 (17:51 +0100)
at least silences warning and is not (really) more work than eliminating
the function

src/disassembler/llvm/LLVMDisassembler.cxx
src/disassembler/llvm/LLVMDisassembler.hxx

index 1f92ab04410624c1a3ede4957234e2ad21cb0671..7d4da0119955da9087ea2a70a5b11c4ae0e4a485 100644 (file)
@@ -316,20 +316,19 @@ void LLVMDisassembler<ELFT>::disassemble() {
        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()) {
index 5c54f3945fe89a4ed8798e8b99717334b5da6678..906318103bfd61aa87d67082c344f3ad13adad5b 100644 (file)
@@ -25,7 +25,7 @@ public:
 
        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,
@@ -76,6 +76,7 @@ private:
        std::map<std::string, llvm::object::SectionRef> sections;
        std::map<std::string, llvm::object::SymbolRef> symbols;
        InformationManager * manager;
+       uint64_t _entryAddress;
 };
 
 #endif