Skip to content

Commit 1ed04d6

Browse files
committed
Merge branch 'dev' into stable
2 parents e70aa0f + 30cd6b0 commit 1ed04d6

32 files changed

+1380
-928
lines changed

.builds/freebsd.yml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ sources:
1616
- https://github.com/rizinorg/rizin#stable
1717
- https://github.com/rizinorg/rz-ghidra
1818
- https://github.com/rizinorg/rizin-testbins
19+
hottub_trigger: '.*'
1920
tasks:
2021
- rizinbuild: |
2122
cd rizin

.builds/openbsd.yml

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ sources:
1414
- https://github.com/rizinorg/rizin#stable
1515
- https://github.com/rizinorg/rz-ghidra
1616
- https://github.com/rizinorg/rizin-testbins
17+
hottub_trigger: '.*'
1718
tasks:
1819
- rizinbuild: |
1920
cd rizin

.github/workflows/ci.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
name: ${{ matrix.name }}
2929
runs-on: ubuntu-latest
3030
steps:
31-
- uses: actions/checkout@v2
31+
- uses: actions/checkout@v3
3232
- name: Checkout submodules
3333
run: |
3434
git submodule init
@@ -40,10 +40,10 @@ jobs:
4040
windows:
4141
runs-on: windows-latest
4242
steps:
43-
- uses: actions/checkout@v2
43+
- uses: actions/checkout@v3
4444
with:
4545
submodules: recursive
46-
- uses: actions/setup-python@v2
46+
- uses: actions/setup-python@v4
4747
- name: Preparing msvc toolchain
4848
uses: ilammy/msvc-dev-cmd@v1
4949
with:
@@ -52,14 +52,14 @@ jobs:
5252
run: |
5353
python -m pip install --upgrade pip
5454
pip install meson ninja PyYAML
55-
- uses: actions/checkout@v2
55+
- uses: actions/checkout@v3
5656
with:
5757
repository: rizinorg/rizin
5858
path: rizin
5959
ref: stable
6060
- name: Extract rizin version
6161
shell: pwsh
62-
run: echo "##[set-output name=branch;]$( python sys\\version.py )"
62+
run: echo "branch=$(python sys/version.py)" >> $Env:GITHUB_OUTPUT
6363
id: extract_version
6464
working-directory: rizin
6565
- name: Build with meson + ninja

.github/workflows/codeql-analysis.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ on:
1111
jobs:
1212
analyze:
1313
name: Analyze
14-
runs-on: ubuntu-20.04
14+
runs-on: ubuntu-22.04
1515
strategy:
1616
fail-fast: false
1717
matrix:
1818
language: ['cpp']
1919

2020
steps:
2121
- name: Checkout repository
22-
uses: actions/checkout@v2
22+
uses: actions/checkout@v3
2323
with:
2424
# We must fetch at least the immediate parents so that if this is
2525
# a pull request then we can checkout the head.
@@ -30,14 +30,14 @@ jobs:
3030
git submodule init
3131
git submodule update
3232
33-
- uses: actions/setup-python@v1
33+
- uses: actions/setup-python@v4
3434
with:
35-
python-version: 3.8.x
35+
python-version: 3.10.x
3636

3737
- name: apt dependencies
3838
run: |
3939
sudo apt-get --assume-yes update
40-
sudo apt-get --assume-yes install ninja-build libgraphviz-dev bison flex qt5-default
40+
sudo apt-get --assume-yes install ninja-build libgraphviz-dev bison flex qtbase5-dev cmake
4141
4242
- name: py dependencies
4343
run: |
@@ -53,7 +53,7 @@ jobs:
5353
5454
# Initializes the CodeQL tools for scanning.
5555
- name: Initialize CodeQL
56-
uses: github/codeql-action/init@v1
56+
uses: github/codeql-action/init@v2
5757
with:
5858
languages: ${{ matrix.language }}
5959

@@ -64,4 +64,4 @@ jobs:
6464
make
6565
6666
- name: Perform CodeQL Analysis
67-
uses: github/codeql-action/analyze@v1
67+
uses: github/codeql-action/analyze@v2

.github/workflows/coverity-scan.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ on:
55

66
jobs:
77
latest:
8-
runs-on: ubuntu-20.04
8+
runs-on: ubuntu-22.04
99
steps:
10-
- uses: actions/checkout@v1
10+
- uses: actions/checkout@v3
1111
with:
1212
submodules: true
13-
- uses: actions/setup-python@v1
13+
- uses: actions/setup-python@v4
1414
with:
15-
python-version: 3.7.x
15+
python-version: 3.10.x
1616

1717
- name: Download Coverity Build Tool
1818
run: |
@@ -28,7 +28,7 @@ jobs:
2828
sudo chmod -R go-w /usr/share
2929
3030
- name: apt dependencies
31-
run: sudo apt-get install ninja-build libgraphviz-dev bison flex qt5-default
31+
run: sudo apt-get install ninja-build libgraphviz-dev bison flex qtbase5-dev qt5-qmake cmake
3232

3333
- name: py dependencies
3434
run: |

.github/workflows/dist.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
if: startsWith(github.ref, 'refs/tags/deploy-test-') || startsWith(github.ref, 'refs/tags/v')
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v3
1313
- name: Checkout submodules
1414
run: |
1515
git submodule init
@@ -35,10 +35,10 @@ jobs:
3535
tarball
3636
]
3737
steps:
38-
- uses: actions/checkout@v2
38+
- uses: actions/checkout@v3
3939
- name: Extract version
4040
id: extract_version
41-
run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//}
41+
run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
4242
- name: Create Release
4343
id: create_release
4444
uses: actions/create-release@v1
@@ -49,7 +49,7 @@ jobs:
4949
release_name: Release ${{ steps.extract_version.outputs.version }}
5050
draft: true
5151
prerelease: false
52-
- uses: actions/download-artifact@v2
52+
- uses: actions/download-artifact@v3
5353
- name: Display structure of downloaded files
5454
run: ls -R
5555
- name: Upload rz-ghidra src tarball

.github/workflows/linter.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ on:
66

77
jobs:
88
licenses:
9-
runs-on: ubuntu-20.04
9+
runs-on: ubuntu-22.04
1010
steps:
1111
- name: Checkout repository
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v3
1313
- name: REUSE Compliance Check
14-
uses: fsfe/reuse-action@v1.1
14+
uses: fsfe/reuse-action@v1

.travis.yml

+4-9
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,19 @@ jobs:
1010
include:
1111
- os: linux
1212
name: X86_64
13-
dist: focal
13+
dist: jammy
1414
- os: linux
1515
name: S390X
1616
arch: s390x
17-
dist: focal
17+
dist: jammy
1818
- os: linux
1919
name: PPC64
2020
arch: ppc64le
21-
dist: focal
21+
dist: jammy
2222
- os: linux
2323
name: ARM64
2424
arch: arm64
25-
dist: focal
26-
allow_failures:
27-
- os: linux
28-
name: S390X
29-
arch: s390x
30-
dist: focal
25+
dist: jammy
3126

3227
addons:
3328
apt:

CMakeLists.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ set(CORE_SOURCE
5555
src/RizinPrintC.cpp
5656
src/RzCoreMutex.h
5757
src/RzCoreMutex.cpp
58-
src/rz_ghidra.h)
58+
src/PrettyXmlEncode.h
59+
src/PrettyXmlEncode.cpp
60+
src/rz_ghidra.h
61+
src/rz_ghidra_internal.h)
5962

6063
if(BUILD_SLEIGH_PLUGIN)
6164
set(ASM_SOURCE

ghidra/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# Base of everything
66
set(SOURCE_BASE_CXX
77
# xml.cc // generated by yacc task
8+
marshal.cc
89
space.cc
910
float.cc
1011
address.cc
@@ -46,6 +47,7 @@ set(SOURCE_DECOMPILER_CXX
4647
funcdata.cc
4748
funcdata_block.cc
4849
funcdata_varnode.cc
50+
unionresolve.cc
4951
funcdata_op.cc
5052
pcodeinject.cc
5153
heritage.cc

ghidra/ghidra

Submodule ghidra updated 7367 files

src/CodeXMLParse.cpp

+36-21
Original file line numberDiff line numberDiff line change
@@ -139,32 +139,47 @@ void AnnotateCommentOffset(ANNOTATOR_PARAMS)
139139
void AnnotateColor(ANNOTATOR_PARAMS)
140140
{
141141
pugi::xml_attribute attr = node.attribute("color");
142-
if (attr.empty())
142+
if(attr.empty())
143143
return;
144144

145-
std::string color = attr.as_string();
146-
if (color == "")
145+
int color = attr.as_int(-1);
146+
if(color < 0)
147147
return;
148148

149149
RSyntaxHighlightType type;
150-
if (color == "keyword")
151-
type = RZ_SYNTAX_HIGHLIGHT_TYPE_KEYWORD;
152-
else if (color == "comment")
153-
type = RZ_SYNTAX_HIGHLIGHT_TYPE_COMMENT;
154-
else if (color == "type")
155-
type = RZ_SYNTAX_HIGHLIGHT_TYPE_DATATYPE;
156-
else if (color == "funcname")
157-
type = RZ_SYNTAX_HIGHLIGHT_TYPE_FUNCTION_NAME;
158-
else if (color == "param")
159-
type = RZ_SYNTAX_HIGHLIGHT_TYPE_FUNCTION_PARAMETER;
160-
else if (color == "var")
161-
type = RZ_SYNTAX_HIGHLIGHT_TYPE_LOCAL_VARIABLE;
162-
else if (color == "const")
163-
type = RZ_SYNTAX_HIGHLIGHT_TYPE_CONSTANT_VARIABLE;
164-
else if (color == "global")
165-
type = RZ_SYNTAX_HIGHLIGHT_TYPE_GLOBAL_VARIABLE;
166-
else
167-
return;
150+
switch(color)
151+
{
152+
case Emit::syntax_highlight::keyword_color:
153+
type = RZ_SYNTAX_HIGHLIGHT_TYPE_KEYWORD;
154+
break;
155+
case Emit::syntax_highlight::comment_color:
156+
type = RZ_SYNTAX_HIGHLIGHT_TYPE_COMMENT;
157+
break;
158+
case Emit::syntax_highlight::type_color:
159+
type = RZ_SYNTAX_HIGHLIGHT_TYPE_DATATYPE;
160+
break;
161+
case Emit::syntax_highlight::funcname_color:
162+
type = RZ_SYNTAX_HIGHLIGHT_TYPE_FUNCTION_NAME;
163+
break;
164+
case Emit::syntax_highlight::var_color:
165+
type = RZ_SYNTAX_HIGHLIGHT_TYPE_LOCAL_VARIABLE;
166+
break;
167+
case Emit::syntax_highlight::const_color:
168+
type = RZ_SYNTAX_HIGHLIGHT_TYPE_CONSTANT_VARIABLE;
169+
break;
170+
case Emit::syntax_highlight::param_color:
171+
type = RZ_SYNTAX_HIGHLIGHT_TYPE_FUNCTION_PARAMETER;
172+
break;
173+
case Emit::syntax_highlight::global_color:
174+
type = RZ_SYNTAX_HIGHLIGHT_TYPE_GLOBAL_VARIABLE;
175+
break;
176+
case Emit::syntax_highlight::no_color:
177+
case Emit::syntax_highlight::error_color:
178+
case Emit::syntax_highlight::special_color:
179+
default:
180+
return;
181+
}
182+
168183
RzCodeAnnotation annotation = {};
169184
annotation.type = RZ_CODE_ANNOTATION_TYPE_SYNTAX_HIGHLIGHT;
170185
annotation.syntax_highlight.type = type;

src/PrettyXmlEncode.cpp

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// SPDX-FileCopyrightText: 2023 Florian Märkl <[email protected]>
2+
// SPDX-License-Identifier: LGPL-3.0-or-later
3+
4+
#include "PrettyXmlEncode.h"
5+
6+
void PrettyXmlEncode::indent()
7+
{
8+
for(int i = 0; i < depth; i++)
9+
outStream << " ";
10+
}
11+
12+
void PrettyXmlEncode::openElement(const ElementId &elemId)
13+
{
14+
if(elementTagIsOpen)
15+
outStream << ">\n";
16+
else
17+
elementTagIsOpen = true;
18+
indent();
19+
depth++;
20+
outStream << '<' << elemId.getName();
21+
}
22+
23+
void PrettyXmlEncode::closeElement(const ElementId &elemId)
24+
{
25+
depth--;
26+
if(elementTagIsOpen)
27+
{
28+
outStream << "/>\n";
29+
elementTagIsOpen = false;
30+
}
31+
else
32+
{
33+
indent();
34+
outStream << "</" << elemId.getName() << ">\n";
35+
}
36+
}
37+

src/PrettyXmlEncode.h

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// SPDX-FileCopyrightText: 2023 Florian Märkl <[email protected]>
2+
// SPDX-License-Identifier: LGPL-3.0-or-later
3+
4+
#ifndef PRETTY_XML_ENCODE_H
5+
#define PRETTY_XML_ENCODE_H
6+
7+
#include <marshal.hh>
8+
9+
class PrettyXmlEncode: public XmlEncode
10+
{
11+
private:
12+
int depth = 0;
13+
void indent();
14+
15+
public:
16+
PrettyXmlEncode(std::ostream &s) : XmlEncode(s) {}
17+
void openElement(const ElementId &elemId) override;
18+
void closeElement(const ElementId &elemId) override;
19+
};
20+
21+
#endif

src/RizinArchitecture.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ std::string FilenameFromCore(RzCore *core)
3737
}
3838

3939
RizinArchitecture::RizinArchitecture(RzCore *core, const std::string &sleigh_id)
40-
: SleighArchitecture(FilenameFromCore(core), sleigh_id.empty() ? SleighIdFromCore(core) : sleigh_id, &cout),
40+
: SleighArchitecture(FilenameFromCore(core), sleigh_id.empty() ? SleighIdFromCore(core) : sleigh_id, &std::cout),
4141
coreMutex(core)
4242
{
4343
}

src/RizinCommentDatabase.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ class RizinCommentDatabase : public CommentDatabase
2929
CommentSet::const_iterator beginComment(const Address &fad) const override;
3030
CommentSet::const_iterator endComment(const Address &fad) const override;
3131

32-
void saveXml(ostream &s) const override { cache.saveXml(s); }
33-
void restoreXml(const Element *el, const AddrSpaceManager *trans) override { throw LowlevelError("commentdb::restoreXml unimplemented"); }
32+
void encode(Encoder &encoder) const override { cache.encode(encoder); }
33+
void decode(Decoder &decoder) override { throw LowlevelError("CommentDatabaseGhidra::decode unimplemented"); }
3434
};
3535

3636
#endif //RZ_GHIDRA_RizinCOMMENTDATABASE_H

0 commit comments

Comments
 (0)