Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions binaryninjaapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#include <optional>
#include <memory>
#include <any>
#include <utility>
#include <fmt/format.h>
#include <fmt/ranges.h>
#include <fmt/core.h>
Expand Down Expand Up @@ -5437,6 +5438,11 @@ namespace BinaryNinja {
uint64_t addr;
uint64_t len;

DerivedStringLocation() = default;
DerivedStringLocation(BNDerivedStringLocationType type, uint64_t address, uint64_t length) :
locationType(type), addr(address), len(length)
{}

bool operator==(const DerivedStringLocation& other) const
{
if (locationType != other.locationType)
Expand Down Expand Up @@ -5477,6 +5483,11 @@ namespace BinaryNinja {
std::optional<DerivedStringLocation> location;
Ref<CustomStringType> customType;

DerivedString() = default;
DerivedString(StringRef val, std::optional<DerivedStringLocation> loc, Ref<CustomStringType> type) :
value(std::move(val)), location(std::move(loc)), customType(std::move(type))
{}

bool operator==(const DerivedString& other) const
{
if (value != other.value)
Expand Down Expand Up @@ -10815,6 +10826,9 @@ namespace BinaryNinja {
{
std::string name;
std::string value;

TypeAttribute() = default;
TypeAttribute(std::string name, std::string value) : name(std::move(name)), value(std::move(value)) {}
};

/*!
Expand Down
4 changes: 2 additions & 2 deletions examples/triage/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ file(GLOB SOURCES CONFIGURE_DEPENDS
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

find_package(Qt6 COMPONENTS Core Gui Widgets REQUIRED)
find_package(Qt6 COMPONENTS Concurrent Core Gui Widgets REQUIRED)

if(DEMO)
add_library(triage STATIC ${SOURCES} ${MOCS})
Expand All @@ -28,7 +28,7 @@ if(NOT BN_API_BUILD_EXAMPLES AND NOT BN_INTERNAL_BUILD)
add_subdirectory(${BN_API_PATH} api)
endif()

target_link_libraries(triage binaryninjaui Qt6::Core Qt6::Gui Qt6::Widgets)
target_link_libraries(triage binaryninjaui Qt6::Concurrent Qt6::Core Qt6::Gui Qt6::Widgets)

set_target_properties(triage PROPERTIES
CXX_STANDARD 20
Expand Down
4 changes: 4 additions & 0 deletions mediumlevelilinstruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ namespace BinaryNinja
Variable var;
size_t version = 0;

SSAVariable() = default;
SSAVariable(const Variable& v, size_t ver) : var(v), version(ver) {}
SSAVariable(const BNVariable& v, size_t ver) : var(v), version(ver) {}

// TODO: `= default` these when we can rely on C++20
bool operator==(const SSAVariable& other) const
{
Expand Down
7 changes: 5 additions & 2 deletions scripts/test_build_external.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
parser.add_argument('--cmake', default=os.environ.get('CMAKE'), help='Path to cmake. Defaults to CMAKE or PATH lookup.')
parser.add_argument('--cc', default=os.environ.get('CC'), help='C compiler to use. Defaults to CC or CMake platform default.')
parser.add_argument('--cxx', default=os.environ.get('CXX'), help='C++ compiler to use. Defaults to CXX or CMake platform default.')
parser.add_argument('--config', default=os.environ.get('CMAKE_BUILD_CONFIG', 'Release'),
help='CMake build configuration to use. Defaults to CMAKE_BUILD_CONFIG or Release.')
parser.add_argument('--extra-project', action='append', default=[],
help='Additional out-of-tree CMake project directory to build. May be specified multiple times.')
args = parser.parse_args()
Expand Down Expand Up @@ -170,9 +172,10 @@ def external_project_cmake_files():

print(f'C compiler: {configure_env.get("CC", "CMake platform default")}')
print(f'C++ compiler: {configure_env.get("CXX", "CMake platform default")}')
print(f'CMake build config: {args.config}')

configure_args = []
build_args = []
configure_args = [f'-DCMAKE_BUILD_TYPE={args.config}']
build_args = ['--config', args.config]

if platform.system() == "Windows":
configure_env['CXXFLAGS'] = f'/MP{args.parallel}'
Expand Down
7 changes: 5 additions & 2 deletions scripts/test_build_internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
parser.add_argument('--cmake', default=os.environ.get('CMAKE'), help='Path to cmake. Defaults to CMAKE or PATH lookup.')
parser.add_argument('--cc', default=os.environ.get('CC'), help='C compiler to use. Defaults to CC or CMake platform default.')
parser.add_argument('--cxx', default=os.environ.get('CXX'), help='C++ compiler to use. Defaults to CXX or CMake platform default.')
parser.add_argument('--config', default=os.environ.get('CMAKE_BUILD_CONFIG', 'Release'),
help='CMake build configuration to use. Defaults to CMAKE_BUILD_CONFIG or Release.')
args = parser.parse_args()

api_base = Path(__file__).parent.parent.absolute()
Expand Down Expand Up @@ -113,9 +115,10 @@ def configure_binary_ninja_env(env):

print(f'C compiler: {env.get("CC", "CMake platform default")}')
print(f'C++ compiler: {env.get("CXX", "CMake platform default")}')
print(f'CMake build config: {args.config}')

configure_args = ['-DBN_API_BUILD_EXAMPLES=1']
build_args = []
configure_args = ['-DBN_API_BUILD_EXAMPLES=1', f'-DCMAKE_BUILD_TYPE={args.config}']
build_args = ['--config', args.config]

if platform.system() == 'Windows':
env['CXXFLAGS'] = f'/MP{args.parallel}'
Expand Down