summaryrefslogtreecommitdiff
path: root/function.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'function.cpp')
-rw-r--r--function.cpp27
1 files changed, 15 insertions, 12 deletions
diff --git a/function.cpp b/function.cpp
index 033a8453..33cb5e52 100644
--- a/function.cpp
+++ b/function.cpp
@@ -200,12 +200,12 @@ ConstantData::ConstantData(BNRegisterValueType _state, uint64_t _value, size_t _
}
-DataBuffer ConstantData::ToDataBuffer() const
+pair<DataBuffer, BNBuiltinType> ConstantData::ToDataBuffer() const
{
if (func)
return func->GetConstantData(state, value, size);
- return DataBuffer();
+ return make_pair(DataBuffer(), BuiltinNone);
}
@@ -612,9 +612,11 @@ void PossibleValueSet::FreeAPIObject(BNPossibleValueSet* value)
}
-DataBuffer Function::GetConstantData(BNRegisterValueType state, uint64_t value, size_t size)
+pair<DataBuffer, BNBuiltinType> Function::GetConstantData(BNRegisterValueType state, uint64_t value, size_t size)
{
- return DataBuffer(BNGetConstantData(m_object, state, value, size));
+ BNBuiltinType builtin;
+ auto buffer = DataBuffer(BNGetConstantData(m_object, state, value, size, &builtin));
+ return make_pair(buffer, builtin);
}
@@ -908,21 +910,22 @@ Ref<HighLevelILFunction> Function::GetHighLevelILIfAvailable() const
}
-Ref<LanguageRepresentationFunction> Function::GetLanguageRepresentation() const
+Ref<LanguageRepresentationFunction> Function::GetLanguageRepresentation(const string& language) const
{
- BNLanguageRepresentationFunction* function = BNGetFunctionLanguageRepresentation(m_object);
+ BNLanguageRepresentationFunction* function = BNGetFunctionLanguageRepresentation(m_object, language.c_str());
if (!function)
return nullptr;
- return new LanguageRepresentationFunction(function);
+ return new CoreLanguageRepresentationFunction(function);
}
-Ref<LanguageRepresentationFunction> Function::GetLanguageRepresentationIfAvailable() const
+Ref<LanguageRepresentationFunction> Function::GetLanguageRepresentationIfAvailable(const string& language) const
{
- BNLanguageRepresentationFunction* function = BNGetFunctionLanguageRepresentationIfAvailable(m_object);
+ BNLanguageRepresentationFunction* function =
+ BNGetFunctionLanguageRepresentationIfAvailable(m_object, language.c_str());
if (!function)
return nullptr;
- return new LanguageRepresentationFunction(function);
+ return new CoreLanguageRepresentationFunction(function);
}
@@ -1275,9 +1278,9 @@ void Function::ApplyAutoDiscoveredType(Type* type)
}
-Ref<FlowGraph> Function::CreateFunctionGraph(BNFunctionGraphType type, DisassemblySettings* settings)
+Ref<FlowGraph> Function::CreateFunctionGraph(const FunctionViewType& type, DisassemblySettings* settings)
{
- BNFlowGraph* graph = BNCreateFunctionGraph(m_object, type, settings ? settings->GetObject() : nullptr);
+ BNFlowGraph* graph = BNCreateFunctionGraph(m_object, type.ToAPIObject(), settings ? settings->GetObject() : nullptr);
return new CoreFlowGraph(graph);
}