Skip to content

Commit 6c78209

Browse files
committed
merge in master
2 parents ae80211 + 6c514ea commit 6c78209

File tree

22 files changed

+724
-18
lines changed

22 files changed

+724
-18
lines changed

binaryninjaapi.h

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2114,6 +2114,33 @@ namespace BinaryNinja {
21142114
\returns Whether decompression was successful
21152115
*/
21162116
bool ZlibDecompress(DataBuffer& output) const;
2117+
2118+
/*! Decompress the contents of this buffer via LZMA compression
2119+
2120+
@threadunsafe
2121+
2122+
\param[out] output Output DataBuffer the decompressed contents will be stored in.
2123+
\returns Whether decompression was successful
2124+
*/
2125+
bool LzmaDecompress(DataBuffer& output) const;
2126+
2127+
/*! Decompress the contents of this buffer via LZMA2 compression
2128+
2129+
@threadunsafe
2130+
2131+
\param[out] output Output DataBuffer the decompressed contents will be stored in.
2132+
\returns Whether decompression was successful
2133+
*/
2134+
bool Lzma2Decompress(DataBuffer& output) const;
2135+
2136+
/*! Decompress the contents of this buffer via XZ compression
2137+
2138+
@threadunsafe
2139+
2140+
\param[out] output Output DataBuffer the decompressed contents will be stored in.
2141+
\returns Whether decompression was successful
2142+
*/
2143+
bool XzDecompress(DataBuffer& output) const;
21172144
};
21182145

21192146
/*! TemporaryFile is used for creating temporary files, stored (temporarily) in the system's default temporary file

binaryninjacore.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3323,6 +3323,9 @@ extern "C"
33233323

33243324
BINARYNINJACOREAPI BNDataBuffer* BNZlibCompress(BNDataBuffer* buf);
33253325
BINARYNINJACOREAPI BNDataBuffer* BNZlibDecompress(BNDataBuffer* buf);
3326+
BINARYNINJACOREAPI BNDataBuffer* BNLzmaDecompress(BNDataBuffer* buf);
3327+
BINARYNINJACOREAPI BNDataBuffer* BNLzma2Decompress(BNDataBuffer* buf);
3328+
BINARYNINJACOREAPI BNDataBuffer* BNXzDecompress(BNDataBuffer* buf);
33263329

33273330
// Save settings
33283331
BINARYNINJACOREAPI BNSaveSettings* BNCreateSaveSettings(void);

databuffer.cpp

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ DataBuffer DataBuffer::FromBase64(const string& src)
222222

223223
bool DataBuffer::ZlibCompress(DataBuffer& output) const
224224
{
225-
BNDataBuffer* result = BNZlibCompress(output.m_buffer);
225+
BNDataBuffer* result = BNZlibCompress(m_buffer);
226226
if (!result)
227227
return false;
228228
output = DataBuffer(result);
@@ -232,7 +232,37 @@ bool DataBuffer::ZlibCompress(DataBuffer& output) const
232232

233233
bool DataBuffer::ZlibDecompress(DataBuffer& output) const
234234
{
235-
BNDataBuffer* result = BNZlibDecompress(output.m_buffer);
235+
BNDataBuffer* result = BNZlibDecompress(m_buffer);
236+
if (!result)
237+
return false;
238+
output = DataBuffer(result);
239+
return true;
240+
}
241+
242+
243+
bool DataBuffer::LzmaDecompress(DataBuffer& output) const
244+
{
245+
BNDataBuffer* result = BNLzmaDecompress(m_buffer);
246+
if (!result)
247+
return false;
248+
output = DataBuffer(result);
249+
return true;
250+
}
251+
252+
253+
bool DataBuffer::Lzma2Decompress(DataBuffer& output) const
254+
{
255+
BNDataBuffer* result = BNLzma2Decompress(m_buffer);
256+
if (!result)
257+
return false;
258+
output = DataBuffer(result);
259+
return true;
260+
}
261+
262+
263+
bool DataBuffer::XzDecompress(DataBuffer& output) const
264+
{
265+
BNDataBuffer* result = BNXzDecompress(m_buffer);
236266
if (!result)
237267
return false;
238268
output = DataBuffer(result);

docs/about/open-source.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ The previous tools are used in the generation of our documentation, but are not
7070
- [core-foundation-sys] ([core-foundation-sys license] - APACHE 2.0 / MIT)
7171
- [core-foundation] ([core-foundation license] - APACHE 2.0 / MIT)
7272
- [cpufeatures] ([cpufeatures license] - APACHE 2.0 / MIT)
73+
- [crc] ([crc license] - APACHE 2.0 / MIT)
74+
- [crc-catalog] ([crc-catalog license] - APACHE 2.0 / MIT)
7375
- [crc32fast] ([crc32fast license] - APACHE 2.0 / MIT)
7476
- [crypto-common] ([crypto-common license] - APACHE 2.0 / MIT)
7577
- [ctr] ([ctr license] - APACHE 2.0 / MIT)
@@ -126,6 +128,7 @@ The previous tools are used in the generation of our documentation, but are not
126128
- [libloading] ([libloading license] - ISC)
127129
- [libz-sys] ([libz-sys license] - APACHE 2.0 / MIT)
128130
- [log] ([log license] - APACHE 2.0 / MIT)
131+
- [lzma-rs] ([lzma-rs license] - MIT)
129132
- [lzxd] ([lzxd license] - APACHE 2.0 / MIT)
130133
- [machine-uid] ([machine-uid license] - MIT)
131134
- [markdown] ([markdown license] - MIT)
@@ -416,6 +419,10 @@ Please note that we offer no support for running Binary Ninja with modified Qt l
416419
[core-foundation license]: https://github.com/servo/core-foundation-rs/blob/master/LICENSE-MIT
417420
[cpufeatures]: https://github.com/RustCrypto/utils/tree/master/cpufeatures
418421
[cpufeatures license]: https://github.com/RustCrypto/utils/blob/master/cpufeatures/LICENSE-MIT
422+
[crc]: https://github.com/mrhooray/crc-rs
423+
[crc license]: https://github.com/mrhooray/crc-rs/blob/master/LICENSE-MIT
424+
[crc-catalog]: https://github.com/akhilles/crc-catalog
425+
[crc-catalog license]: https://github.com/akhilles/crc-catalog/blob/master/LICENSES/MIT.txt
419426
[crc32fast]: https://github.com/srijs/rust-crc32fast
420427
[crc32fast license]: https://github.com/srijs/rust-crc32fast/blob/master/LICENSE-MIT
421428
[crypto-common]: https://github.com/RustCrypto/traits/tree/master/crypto-common
@@ -530,6 +537,8 @@ Please note that we offer no support for running Binary Ninja with modified Qt l
530537
[libz-sys license]: https://github.com/rust-lang/libz-sys/blob/main/LICENSE-MIT
531538
[log]: https://github.com/rust-lang/log
532539
[log license]: https://github.com/rust-lang/log/blob/master/LICENSE-MIT
540+
[lzma-rs]: https://github.com/gendx/lzma-rs
541+
[lzma-rs license]: https://github.com/gendx/lzma-rs/blob/master/LICENSE
533542
[lzxd]: https://github.com/Lonami/lzxd
534543
[lzxd license]: https://github.com/Lonami/lzxd/blob/master/LICENSE-MIT
535544
[machine-uid]: https://github.com/Hanaasagi/machine-uid

platform/decree/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2021 Vector 35 Inc.
1+
Copyright 2021-2024 Vector 35 Inc.
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

platform/efi/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2021 Vector 35 Inc.
1+
Copyright 2021-2024 Vector 35 Inc.
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

platform/freebsd/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2021 Vector 35 Inc.
1+
Copyright 2021-2024 Vector 35 Inc.
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

platform/linux/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2021 Vector 35 Inc.
1+
Copyright 2021-2024 Vector 35 Inc.
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

platform/mac/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2021 Vector 35 Inc.
1+
Copyright 2021-2024 Vector 35 Inc.
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

platform/windows-kernel/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2021 Vector 35 Inc.
1+
Copyright 2021-2024 Vector 35 Inc.
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)