summaryrefslogtreecommitdiff
path: root/arch/arm64/arch_arm64.cpp
diff options
context:
space:
mode:
authorZichuan Li <34680029+river-li@users.noreply.github.com>2024-05-31 12:48:17 -0400
committerZichuan Li <34680029+river-li@users.noreply.github.com>2024-05-31 15:27:38 -0400
commit87d236e815b3c8c92eaef76b2b4e69c84229d40a (patch)
tree750c12adedcecd7a09eef9829d07402198335204 /arch/arm64/arch_arm64.cpp
parent4279136cc033e93a2ec4afec0c6cab037e76c907 (diff)
improve efficiency
Diffstat (limited to 'arch/arm64/arch_arm64.cpp')
-rw-r--r--arch/arm64/arch_arm64.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/arch/arm64/arch_arm64.cpp b/arch/arm64/arch_arm64.cpp
index 68cfae5a..be856e79 100644
--- a/arch/arm64/arch_arm64.cpp
+++ b/arch/arm64/arch_arm64.cpp
@@ -2448,20 +2448,17 @@ class Arm64ImportedFunctionRecognizer : public FunctionRecognizer
if (jumpOperand.GetSourceRegister<LLIL_REG>() != targetReg)
return false;
- Ref<Symbol> funcSym = Symbol::ImportedFunctionFromImportAddressSymbol(sym, func->GetStart()); // func is plt function
+ Ref<Symbol> funcSym = Symbol::ImportedFunctionFromImportAddressSymbol(sym, func->GetStart());
data->DefineAutoSymbol(funcSym);
- for (auto& extSym : data->GetSymbolsByName(funcSym->GetRawName()))
- {
- if (extSym->GetType() == ExternalSymbol)
- {
- DataVariable var;
- if (data->GetDataVariableAtAddress(extSym->GetAddress(), var))
- {
- func->ApplyImportedTypes(funcSym, var.type);
- }
- return true;
+ auto extSym = data->GetSymbolsByName(funcSym->GetRawName(), data->GetExternalNameSpace());
+ if (!extSym.empty()) {
+ DataVariable var;
+ if (data->GetDataVariableAtAddress(extSym.front()->GetAddress(), var))
+ {
+ func->ApplyImportedTypes(funcSym, var.type);
}
+ return true;
}
return false;
}