mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
GP-0: Stronger ObjcMessageAnalzyer.canAnalyze() check (prevents it from
running on Swift-only programs)
This commit is contained in:
@@ -89,7 +89,18 @@ public class ObjcMessageAnalyzer extends AbstractAnalyzer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canAnalyze(Program program) {
|
public boolean canAnalyze(Program program) {
|
||||||
return Objc2Constants.isObjectiveC2(program);
|
if (Objc2Constants.isObjectiveC2(program)) {
|
||||||
|
Memory mem = program.getMemory();
|
||||||
|
if (mem.getBlock(Objc2Constants.OBJC2_STUBS) != null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
for (Symbol s : program.getSymbolTable().getExternalSymbols()) {
|
||||||
|
if (s.getName().startsWith(Objc1Constants.OBJC_MSG_SEND)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user