Skip to content

Commit

Permalink
only do the endbr stuff with newer capstone?
Browse files Browse the repository at this point in the history
  • Loading branch information
eteran committed Mar 19, 2024
1 parent 947fef6 commit d77848c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions plugins/Analyzer/Analyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ edb::address_t module_entry_point(const std::shared_ptr<IRegion> &region) {

// if it does, we can just try to see if there is a region that fits the bill
// one page before us. it's a guess, but it's not a bad one
const size_t page_size = edb::v1::debugger_core->pageSize();
const size_t page_size = edb::v1::debugger_core->pageSize();
const edb::address_t prevRegion = region->start() - page_size;
if (std::shared_ptr<IRegion> region = edb::v1::memory_regions().findRegion(prevRegion)) {
if (std::unique_ptr<IBinary> binary_info = edb::v1::get_binary_info(region)) {
Expand Down Expand Up @@ -620,6 +620,8 @@ void Analyzer::collectFuzzyFunctions(RegionData *data) {
}
}
}
#if defined(EDB_X86) || defined(EDB_X86_64)
#if CS_API_MAJOR >= 4
} else if (inst->id == X86_INS_ENDBR64 || inst->id == X86_INS_ENDBR32) {

// Intel's CET stuff actually helps us identify functions pretty easily
Expand All @@ -628,6 +630,8 @@ void Analyzer::collectFuzzyFunctions(RegionData *data) {
fuzzy_functions[addr] = MinRefCount + 1;
}
}
#endif
#endif
}
++p;
}
Expand Down Expand Up @@ -755,7 +759,7 @@ IAnalyzer::FunctionMap Analyzer::functions() const {
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
results.insert(it.functions);
#else
results.unite(it.functions);
results.unite(it.functions);
#endif
}
return results;
Expand Down

0 comments on commit d77848c

Please sign in to comment.