summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXusheng <xusheng@vector35.com>2022-09-28 14:47:48 +0800
committerXusheng <xusheng@vector35.com>2022-10-04 15:51:02 +0800
commited820d2ab81470b3e5ac543d75211e87ff3bc738 (patch)
treeb2d81cb67936d8aa7dcd0888c28c31d6df982d65
parent9f4b0d882a5fd4c7d46c8515694f72fc5845e1ab (diff)
Deprecate unused BinaryViewTypeArchitectureConstant API
-rw-r--r--architecture.cpp6
-rw-r--r--binaryninjaapi.h2
-rw-r--r--binaryninjacore.h6
-rw-r--r--python/architecture.py11
4 files changed, 13 insertions, 12 deletions
diff --git a/architecture.cpp b/architecture.cpp
index b1acceb5..828aa0ff 100644
--- a/architecture.cpp
+++ b/architecture.cpp
@@ -1257,19 +1257,19 @@ Ref<RelocationHandler> Architecture::GetRelocationHandler(const std::string& vie
bool Architecture::IsBinaryViewTypeConstantDefined(const string& type, const string& name)
{
- return BNIsBinaryViewTypeArchitectureConstantDefined(m_object, type.c_str(), name.c_str());
+ return false;
}
uint64_t Architecture::GetBinaryViewTypeConstant(const string& type, const string& name, uint64_t defaultValue)
{
- return BNGetBinaryViewTypeArchitectureConstant(m_object, type.c_str(), name.c_str(), defaultValue);
+ return 0;
}
void Architecture::SetBinaryViewTypeConstant(const string& type, const string& name, uint64_t value)
{
- BNSetBinaryViewTypeArchitectureConstant(m_object, type.c_str(), name.c_str(), value);
+
}
diff --git a/binaryninjaapi.h b/binaryninjaapi.h
index 64206875..91395a90 100644
--- a/binaryninjaapi.h
+++ b/binaryninjaapi.h
@@ -5617,6 +5617,8 @@ namespace BinaryNinja {
void RegisterRelocationHandler(const std::string& viewName, RelocationHandler* handler);
Ref<RelocationHandler> GetRelocationHandler(const std::string& viewName);
+ // These three binary view type constant APIs are deprecated and should no longer be used. There implementations
+ // have been removed, and they now have no effects.
bool IsBinaryViewTypeConstantDefined(const std::string& type, const std::string& name);
uint64_t GetBinaryViewTypeConstant(const std::string& type, const std::string& name, uint64_t defaultValue = 0);
void SetBinaryViewTypeConstant(const std::string& type, const std::string& name, uint64_t value);
diff --git a/binaryninjacore.h b/binaryninjacore.h
index bc4b9bfd..e49a020b 100644
--- a/binaryninjacore.h
+++ b/binaryninjacore.h
@@ -3627,12 +3627,6 @@ extern "C"
BINARYNINJACOREAPI bool BNArchitectureSkipAndReturnValue(
BNArchitecture* arch, uint8_t* data, uint64_t addr, size_t len, uint64_t value);
BINARYNINJACOREAPI void BNRegisterArchitectureFunctionRecognizer(BNArchitecture* arch, BNFunctionRecognizer* rec);
- BINARYNINJACOREAPI bool BNIsBinaryViewTypeArchitectureConstantDefined(
- BNArchitecture* arch, const char* type, const char* name);
- BINARYNINJACOREAPI uint64_t BNGetBinaryViewTypeArchitectureConstant(
- BNArchitecture* arch, const char* type, const char* name, uint64_t defaultValue);
- BINARYNINJACOREAPI void BNSetBinaryViewTypeArchitectureConstant(
- BNArchitecture* arch, const char* type, const char* name, uint64_t value);
BINARYNINJACOREAPI void BNArchitectureRegisterRelocationHandler(
BNArchitecture* arch, const char* viewName, BNRelocationHandler* handler);
diff --git a/python/architecture.py b/python/architecture.py
index 65f1f455..600bf7a6 100644
--- a/python/architecture.py
+++ b/python/architecture.py
@@ -1967,6 +1967,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
def is_view_type_constant_defined(self, type_name: str, const_name: str) -> bool:
"""
+ This API is deprecated and should not be used anymore.
:param str type_name: the BinaryView type name of the constant to query
:param str const_name: the constant name to query
@@ -1981,10 +1982,12 @@ class Architecture(metaclass=_ArchitectureMetaClass):
False
>>>
"""
- return core.BNIsBinaryViewTypeArchitectureConstantDefined(self.handle, type_name, const_name)
+ return False
def get_view_type_constant(self, type_name: str, const_name: str, default_value: int = 0) -> int:
"""
+ This API is deprecated and should not be used anymore.
+
``get_view_type_constant`` retrieves the view type constant for the given type_name and const_name.
:param str type_name: the BinaryView type name of the constant to be retrieved
@@ -2001,10 +2004,12 @@ class Architecture(metaclass=_ArchitectureMetaClass):
>>> arch.get_view_type_constant("ELF", "NOT_HERE", 100)
100
"""
- return core.BNGetBinaryViewTypeArchitectureConstant(self.handle, type_name, const_name, default_value)
+ return 0
def set_view_type_constant(self, type_name: str, const_name: str, value: int) -> None:
"""
+ This API is deprecated and should not be used anymore.
+
``set_view_type_constant`` creates a new binaryview type constant.
:param str type_name: the BinaryView type name of the constant to be registered
@@ -2017,7 +2022,7 @@ class Architecture(metaclass=_ArchitectureMetaClass):
>>> arch.set_view_type_constant("ELF", "R_COPY", ELF_RELOC_COPY)
>>>
"""
- core.BNSetBinaryViewTypeArchitectureConstant(self.handle, type_name, const_name, value)
+ pass
def register_calling_convention(self, cc: 'callingconvention.CallingConvention') -> None:
"""