Skip to content

Commit 7762273

Browse files
committed
2 parents 82e05b3 + b34ddd0 commit 7762273

File tree

257 files changed

+34698
-1762
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

257 files changed

+34698
-1762
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Install Rust
2525
uses: actions-rs/toolchain@v1
2626
with:
27-
toolchain: 1.77.0
27+
toolchain: 1.83.0
2828
profile: minimal
2929
override: true
3030
components: clippy

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ suite/binaryninja/
7676
build
7777
generator
7878
types/
79-
plugins/
8079

8180
# Rust
8281
rust/**/*.swp

activity.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ using namespace BinaryNinja;
55
using namespace std;
66

77

8-
Activity::Activity(const string& configuration, const std::function<void(Ref<AnalysisContext> analysisContext)>& action) :
9-
m_action(action)
8+
Activity::Activity(const string& configuration, const std::function<void(Ref<AnalysisContext> analysisContext)>& action) : m_action(action)
109
{
1110
// LogError("API-Side Activity Constructed!");
1211
m_object = BNCreateActivity(configuration.c_str(), this, Run);
@@ -15,6 +14,7 @@ Activity::Activity(const string& configuration, const std::function<void(Ref<Ana
1514

1615
Activity::Activity(BNActivity* activity)
1716
{
17+
// LogError("API-Side Activity Constructed!");
1818
m_object = BNNewActivityReference(activity);
1919
}
2020

@@ -27,6 +27,7 @@ Activity::~Activity()
2727

2828
void Activity::Run(void* ctxt, BNAnalysisContext* analysisContext)
2929
{
30+
// LogError("API-Side Activity Run!");
3031
Activity* activity = (Activity*)ctxt;
3132
Ref<AnalysisContext> ac = new AnalysisContext(BNNewAnalysisContextReference(analysisContext));
3233
activity->m_action(ac);
@@ -35,6 +36,7 @@ void Activity::Run(void* ctxt, BNAnalysisContext* analysisContext)
3536

3637
string Activity::GetName() const
3738
{
39+
// LogError("API-Side Activity GetName!");
3840
char* name = BNActivityGetName(m_object);
3941
string result = name;
4042
BNFreeString(name);

api-docs/cppdocs/DoxygenLayout.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<navindex>
55
<tab type="mainpage" visible="yes" title="Binary Ninja API"/>
66
<tab type="pages" visible="yes" title="Binary Ninja API" intro=""/>
7-
<tab type="modules" visible="yes" title="" intro=""/>
7+
<tab type="topics" visible="yes" title="" intro=""/>
88
<tab type="namespacelist" visible="yes" title="Namespaces" intro=""/>
99
<tab type="interfaces" visible="yes" title="">
1010
<tab type="interfacelist" visible="yes" title="" intro=""/>

api-docs/cppdocs/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
We currently use `doxygen` for our C++ documentation generation.
44

5-
> Note: Using anything newer than doxygen 1.9.4 will cause minor issues with the website whenever the selected theme conflicts with the OS/browser light/dark mode selection.
6-
75
Generating documentation with Doxygen couldn't be simpler. Just install it and run:
86

97
```
@@ -14,7 +12,7 @@ From this directory. The output will be stored in `html/`
1412

1513
## Installing doxygen
1614

17-
The theme for our documentation works best with doxygen 1.9.0 - 1.9.4
15+
The theme for our documentation works best with doxygen 1.12.0
1816

1917
### macOS (Homebrew)
2018

api-docs/cppdocs/build_min_docs.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,24 @@
55
# This allows shipping a few thousand fewer files in updates including C++ documentation.
66
#
77
# Usage:
8-
# install doxygen 1.9.4 (or this script will not work. running minification on a different version can cause
9-
# real issues.)
10-
# python3 build_min_docs.py
8+
# install doxygen 1.12.0
9+
#
10+
# make html
11+
# OR
12+
# make docset
1113
# =-=--
1214

13-
__DOXYGEN_REQUIRED_VERSION__ = "1.9.4"
15+
__DOXYGEN_REQUIRED_VERSION__ = "1.12.0"
1416

1517
import argparse
1618
import os
1719
import sys
1820
import json
1921
from collections import namedtuple
20-
from typing import List
2122
import subprocess
2223
import shutil
2324

25+
doxygen = "doxygen" #to make testing other versions easier
2426

2527
def system_with_output(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE):
2628
proc = subprocess.Popen("" + cmd,
@@ -66,7 +68,7 @@ def load_items_in_file(filename):
6668
"""
6769
Recursively load in the text of file {filename} and all subfiles referenced by it.
6870
69-
:param filename: Target root filename. e.g. 'modules.js'
71+
:param filename: Target root filename. e.g. 'topics.js'
7072
:return: Combined text of javascript file tree.
7173
"""
7274
items = []
@@ -87,7 +89,7 @@ def minifier():
8789
# add them to the top of the navbar.js file itself.
8890

8991
navtree_built_data = ""
90-
for mod in load_items_in_file("html/modules.js"):
92+
for mod in load_items_in_file("html/topics.js"):
9193
navtree_built_data += mod + "\n"
9294
for mod in load_items_in_file("html/namespaces.js"):
9395
navtree_built_data += mod + "\n"
@@ -115,8 +117,8 @@ def minifier():
115117
# Here, we just want to skip the whole process and immediately call the callback.
116118
nav_tree_fixed_get_script = "function getScript(scriptName,func,show) { func(); }"
117119

118-
navtree_before_get_script = navtree_orig.split("function getScript(scriptName,func,show)")[0]
119-
navtree_after_get_script = navtree_orig.split("function getScript(scriptName,func,show)")[1].split('}', 1)[1]
120+
navtree_before_get_script = navtree_orig.split("const getScript = function(scriptName,func) {")[0]
121+
navtree_after_get_script = navtree_orig.split("const getScript = function(scriptName,func) {")[1].split('}', 1)[1]
120122

121123
nav_tree_fixed = navtree_before_get_script + nav_tree_fixed_get_script + navtree_after_get_script
122124
navtree = navtree_built_data + "\n" + nav_tree_fixed
@@ -130,9 +132,8 @@ def build_doxygen(args):
130132
if not os.path.exists('./Doxyfile-HTML'):
131133
print('No Doxyfile found. Are you in the right directory?')
132134
sys.exit(1)
133-
_, vers, _ = system_with_output("doxygen -V")
135+
_, vers, _ = system_with_output(f"{doxygen} -V")
134136
if __DOXYGEN_REQUIRED_VERSION__ not in vers.strip():
135-
print(f'Please use Doxygen {__DOXYGEN_REQUIRED_VERSION__} to build documentation')
136137
print(f'Please use Doxygen {__DOXYGEN_REQUIRED_VERSION__} to build documentation')
137138
sys.exit(1)
138139

@@ -154,9 +155,9 @@ def build_doxygen(args):
154155
print(f'Building doxygen docs...')
155156

156157
if args.docset:
157-
stat, out, err = system_with_output("doxygen Doxyfile-Docset")
158+
stat, out, err = system_with_output(f"{doxygen} Doxyfile-Docset")
158159
else:
159-
stat, out, err = system_with_output("doxygen Doxyfile-HTML")
160+
stat, out, err = system_with_output(f"{doxygen} Doxyfile-HTML")
160161
print(f"Built Doxygen with status code {stat}")
161162
print("Output dir is ./html/")
162163
stat, out, err = system_with_output("cp _static/img/* html/")

api-docs/cppdocs/custom.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ input#MSearchField {
6767
top: -1px;
6868
}
6969

70+
#MSearchSelect {
71+
background-repeat: no-repeat !important;
72+
}
73+
7074
/* Replicating an "undecorated root node" */
7175

7276
.children_ul a.index\.html {
@@ -193,4 +197,4 @@ img.thread {
193197

194198
.dark-mode img.thread {
195199
filter: invert(0.7);
196-
}
200+
}

api-docs/cppdocs/make.bat

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
@echo off
2+
set PYTHON=poetry run python
3+
4+
if "%1" == "help" (
5+
echo Please use `make <target>` where <target> is one of
6+
echo clean to clean the folders
7+
echo html to make standalone HTML files
8+
echo docset to make a Dash docset
9+
exit /b
10+
)
11+
12+
if "%1" == "clean" (
13+
rmdir /s /q html
14+
rmdir /s /q docset
15+
rmdir /s /q xml
16+
exit /b
17+
)
18+
19+
if "%1" == "html" (
20+
%PYTHON% build_min_docs.py
21+
exit /b
22+
)
23+
24+
if "%1" == "docset" (
25+
%PYTHON% build_min_docs.py --docset
26+
exit /b
27+
)
28+
29+
echo Unknown target: %1
30+
exit /b 1
31+

arch/arm64/arch_arm64.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2722,6 +2722,26 @@ class AppleArm64CallingConvention: public Arm64CallingConvention
27222722
};
27232723

27242724

2725+
class AppleArm64ObjcFastARCCallingConvention: public Arm64CallingConvention
2726+
{
2727+
uint32_t m_reg;
2728+
public:
2729+
AppleArm64ObjcFastARCCallingConvention(Architecture* arch, uint32_t reg): Arm64CallingConvention(arch, "apple-arm64-objc-fast-arc-" + to_string(reg - REG_X0)), m_reg(reg)
2730+
{
2731+
}
2732+
2733+
virtual vector<uint32_t> GetIntegerArgumentRegisters() override
2734+
{
2735+
return vector<uint32_t> {m_reg};
2736+
}
2737+
2738+
virtual bool AreArgumentRegistersUsedForVarArgs() override
2739+
{
2740+
return false;
2741+
}
2742+
};
2743+
2744+
27252745
class LinuxArm64SystemCallConvention: public CallingConvention
27262746
{
27272747
public:
@@ -3583,6 +3603,14 @@ extern "C"
35833603
conv = new AppleArm64CallingConvention(arm64);
35843604
arm64->RegisterCallingConvention(conv);
35853605

3606+
for (uint32_t i = REG_X0; i <= REG_X28; i++)
3607+
{
3608+
if (i == REG_X16 || i == REG_X17 || i == REG_X18) // reserved by os.
3609+
continue;
3610+
conv = new AppleArm64ObjcFastARCCallingConvention(arm64, i);
3611+
arm64->RegisterCallingConvention(conv);
3612+
}
3613+
35863614
// Register ARM64 specific PLT trampoline recognizer
35873615
arm64->RegisterFunctionRecognizer(new Arm64ImportedFunctionRecognizer());
35883616

0 commit comments

Comments
 (0)