Skip to content

Commit

Permalink
[Build] Bump 0.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sijung07 committed Mar 29, 2024
1 parent 2092877 commit 6253b31
Show file tree
Hide file tree
Showing 641 changed files with 97,464 additions and 63,804 deletions.
4 changes: 2 additions & 2 deletions .b2r2-ci.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"evaltest": "311ef72ce3898f74d82ba3a1845042637eeb9fb9",
"switchtest": "ab771e0395067631afcd2a4522e7b038033e2451"
"evaltest": "main",
"switchtest": "main"
}
8 changes: 7 additions & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
"commands": [
"fsdocs"
]
},
"dotnet-fsharplint": {
"version": "0.21.3",
"commands": [
"dotnet-fsharplint"
]
}
}
}
}
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,12 @@ indent_style = space
indent_size = 2
end_of_line = lf
trim_trailing_whitespace = true

[*.{fs,fsi,fsx}]
indent_size = 2
max_line_length = 80
fsharp_space_before_parameter = true
fsharp_space_before_lowercase_invocation = true
fsharp_space_before_uppercase_invocation = true
fsharp_space_before_class_constructor = true
fsharp_space_before_member = true
35 changes: 26 additions & 9 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,46 @@
image: mcr.microsoft.com/dotnet/sdk:6.0

stages:
- build
- extra

build:
lint:
image: mcr.microsoft.com/dotnet/sdk:5.0.408-focal
stage: build
before_script:
- LATEST_COMMIT=$(git ls-remote https://gitlab-ci-token:${CI_JOB_TOKEN}@softsec.kaist.ac.kr:8000/B2R2/B2R2.git HEAD | awk '{print $1}')
- CHANGES=$(if [ "$LATEST_COMMIT" == "$CI_COMMIT_SHA" ]; then git diff-tree --diff-filter=ACM --no-commit-id --name-only -r $LATEST_COMMIT; else git diff-tree --diff-filter=ACM --no-commit-id --name-only -r $LATEST_COMMIT -r $CI_COMMIT_SHA; fi | sed '/.fs$/!d' | sed '/CFG.Tests.fs/d')
script:
- dotnet tool install --global dotnet-fsharplint --version 0.21.3
- echo $CHANGES
- for f in $CHANGES; do echo $f; /root/.dotnet/tools/dotnet-fsharplint lint $f; done
tags:
- b2r2

build-debug:
image: mcr.microsoft.com/dotnet/sdk:8.0
stage: build
script:
- dotnet restore
- dotnet tool restore
- dotnet test
tags:
- b2r2

build-release:
image: mcr.microsoft.com/dotnet/sdk:8.0
stage: build
script:
- dotnet restore
- dotnet tool restore
- dotnet test -c Release
- dotnet pack -p:PackageVersion=0.0.0-test -c Release -o `pwd`/build/
artifacts:
paths:
- build/
expire_in: 3 hrs
tags:
- b2r2

extra:
image: mcr.microsoft.com/dotnet/sdk:8.0
stage: extra
script:
- git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@softsec.kaist.ac.kr:8000/B2R2/ci-runner
- dotnet run --project ci-runner/CIStarter -- $CI_URL $CI_COMMIT_SHA $CI_COMMIT_REF_NAME "$GITLAB_USER_NAME"
dependencies:
- build
tags:
- b2r2
11 changes: 10 additions & 1 deletion AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@

# Current Developers (alphabetical order)

- Jaeseung Choi <[email protected]>
- Su Geun Ji <[email protected]>
- Seung Il Jung <[email protected]>
- Jun Tae Kim <[email protected]>
- Soomin Kim <[email protected]>
- Hee Dong Yang <[email protected]>

# Contributors

Expand All @@ -15,22 +16,30 @@ a list of the contributors in alphabetic order.

- Anar Abbas
- Mehdi Aghakishiyev
- Zunnoor Fayyaz Awan
- Jaeseung Choi
- TA Thanh Dinh
- HyungSeok Han
- Abdirakhman Ismail
- Cheonhoo Jeon
- Subin Jeong
- Minkyu Jung
- Dohyeok Kim
- Dongkwan Kim
- Doyeon Kim
- Hongsik Kim
- Hyungseok Kim
- Jaemin Kim
- JungHyun Kim
- Kangsu Kim
- Yeonghun Kim
- JeongWoo Lee
- Junoh Lee
- Minsu Lee
- Sihoon Lee
- DongYeop Oh
- Geonwoo Park
- Ali Ahmed Sheikh
- MyeongGeun Shin
- Michael Tegegn
- Hyungjoon Yoon
300 changes: 111 additions & 189 deletions B2R2.sln

Large diffs are not rendered by default.

65 changes: 65 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,70 @@
# B2R2 Change Log

## 0.7.0 (2024-03-26)

### Added

- More instruction supports for Intel, AArch64, PPC, and RISCV.
- Support Intel's AT&T syntax.
- Support lazy loading of ELF metadata.
- Handle dwarf action `DW_CFA_same_value`
- Add a new rear-end module, Transformer, which allows users to transform
binary code into another form.
- Add initial SPARC support.
- Add initial SH4 support.

### Changed

- Use .NET 8 (and F# 8): Our framework is not compatible with prior
versions of .NET.
- Fix many lifting/parsing bugs for Intel, PPC, AArch64, and RISCV.
- Refactored many modules. Quite many modules/classes have been renamed.
- Improve XML documentation.
- Fix many bugs in the ELF parser.
- Add more unit tests.

## 0.6.0 (2022-06-29)

### Added
- More instruction supports for MIPS
- More instruction supports for Intel
- Added initial support for WASM (thanks to @kimdora)
- Added several more classes in the Core module

### Changed
- Now we use .NET 6 (and F# 6). Our framework is not compatible with .NET 5.
- Fixed MIPS exception frame parser
- Optimized ELF parser for loading callsite tables
- Fixed several bugs in Intel assembler
- Changed ConcEval's interface
- We now avoid using non-standard register sizes, such as `2<rt>` and `3<rt>`;
we only use sizes multiple of 8 (e.g., 8, 16, 32, 64) or size 1. For those
register variables whose size is non-standard, e.g., `FTOP` in Intel, we
assign larger size for the variable.
- Fixed several bugs in Intel and MIPS lifters
- Fixed several bugs in BinFile module (ELF and PE)
- Fixed several bugs in the middle-end (such as tail-call detection logic, etc.)

## 0.5.0 (2021-10-22)

### Added
- Handle ELF exception frames
- Introduce new CFG recovery engine
- Introduce `BinaryPointer` type which allows accessing non-addressable region
of binary
- Add few more instruction support for x86-64 and ARMv7
- Add a RearEnd.Launcher, which is a .NET CLI tool. You can now install B2R2 by
typing `dotnet tool install -g B2R2.RearEnd.Launcher`
- Add support for AVR architecture

### Changed
- MiddleEnd has been largely rewritten
- Module and function names largely changed
- Hash-consing is now controlled with build macro `HASHCONS`
- MiddleEnd.ConcEval works with base address changes
- Local IR optimizer has been rewritten
- Optimized data-flow engine

## 0.4.0 (2020-05-02)

### Added
Expand Down
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,14 @@ before you proceed as we mostly follow it.
- We use nouns for variables (or parameters).
- We *mostly* use verbs for function names.

### Line-endings

We always use unix-style (LF) line-endings for every file.

#### Editor Settings

- See our [.editorconfig](.editorconfig)

- For Emacs users:
```
(setq-default fsharp-indent-offset 2)
Expand Down
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project>
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Product>B2R2</Product>
<Authors>SoftSec Lab. @ KAIST</Authors>
<Company>SoftSec Lab. @ KAIST</Company>
<VersionPrefix>0.6.0</VersionPrefix>
<VersionPrefix>0.7.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<Copyright>Copyright (c) SoftSec Lab. @ KAIST, since 2016</Copyright>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down
43 changes: 23 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ B2R2?

1. B2R2 is *easy* to play with: there is absolutely no dependency hell for B2R2
because it is a fully-managed library. All you need to do is to install
[.NET Core SDK](https://dotnet.microsoft.com/download), and you are ready to
[.NET SDK](https://dotnet.microsoft.com/download), and you are ready to
go! Native
[IntelliSense](https://docs.microsoft.com/en-us/visualstudio/ide/using-intellisense)
support is another plus!
Expand All @@ -59,17 +59,17 @@ progress, but we look forward to your contributions! Feel free to write a PR
(Pull Request) while making sure that you have read our [contribution
guideline](CONTRIBUTING.md).

| Feature | x86 | x86-64 | ARMv7 | ARMv8 | MIPS32 | MIPS64 | EVM | TMS320C600 | AVR | PPC | SPARC64 | SH4 | RISC-V |
|-----------------------|:-----------:|:-----------:|:--------------------:|:--------------------:|:--------------------:|:--------------------:|:-----------:|:-----------:|:-----------:|:-----------:|:----------:|:-----------:|:----------:|
| Instruction Parsing | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :new_moon: | :full_moon: | :new_moon: |
| Disassembly | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :new_moon: | :full_moon: | :new_moon: |
| Lifting | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :new_moon: | :full_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: |
| CFG Recovery | :full_moon: | :full_moon: | :first_quarter_moon: | :first_quarter_moon: | :first_quarter_moon: | :first_quarter_moon: | :full_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: |
| Data-Flow | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: |
| Instruction Emulation | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: |
| Assembly | :full_moon: | :full_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: |
| REPL | :full_moon: | :full_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: |
| ROP Compilation | :full_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: |
| Feature | x86 | x86-64 | ARMv7 | ARMv8 | MIPS32 | MIPS64 | EVM | TMS320C600 | AVR | PPC | SPARC | SH4 | RISC-V |
|-----------------------|:-----------:|:-----------:|:--------------------:|:--------------------:|:--------------------:|:--------------------:|:-----------:|:-----------:|:-----------:|:-----------:|:-----------:|:---------------------:|:-----------:|
| Instruction Parsing | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :waxing_gibbous_moon: | :full_moon: |
| Disassembly | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :waxing_gibbous_moon: | :full_moon: |
| Lifting | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :new_moon: | :full_moon: | :new_moon: | :full_moon: | :new_moon: | :full_moon: |
| CFG Recovery | :full_moon: | :full_moon: | :first_quarter_moon: | :first_quarter_moon: | :first_quarter_moon: | :first_quarter_moon: | :full_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: |
| Data-Flow | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: |
| Instruction Emulation | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :full_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: |
| Assembly | :full_moon: | :full_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: |
| REPL | :full_moon: | :full_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: |
| ROP Compilation | :full_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: | :new_moon: |

Dependencies?
-------------
Expand All @@ -78,8 +78,10 @@ B2R2 relies on a tiny set of external .NET libraries, and our design principle
is to use a minimum number of libraries. Below is a list of libraries that we
leverage.

- [System.Reflection.Metadata](https://www.nuget.org/packages/System.Reflection.Metadata/)
- [Microsoft.FSharpLu.Json](https://www.nuget.org/packages/Microsoft.FSharpLu.Json/)
- [System.Reflection.Metadata](https://www.nuget.org/packages/System.Reflection.Metadata)
- [System.IO.Hashing](https://www.nuget.org/packages/System.IO.Hashing)
- [Microsoft.FSharpLu.Json](https://www.nuget.org/packages/Microsoft.FSharpLu.Json)
- [FSharp.Compiler.Service](https://www.nuget.org/packages/FSharp.Compiler.Service)
- [FParsec](https://www.nuget.org/packages/FParsec)

API Documentation
Expand Down Expand Up @@ -116,14 +118,14 @@ Let's try to use B2R2 APIs.
```fsharp
open B2R2
open B2R2.FrontEnd
open B2R2.FrontEnd.BinInterface
[<EntryPoint>]
let main argv =
let isa = ISA.OfString "amd64"
let bytes = [| 0x65uy; 0xffuy; 0x15uy; 0x10uy; 0x00uy; 0x00uy; 0x00uy |]
let hdl = BinHandle.Init (isa, bytes)
let ins = BinHandle.ParseInstr hdl 0UL
let ins = BinHandle.ParseInstr (hdl, 0UL)
ins.Translate hdl.TranslationContext |> printfn "%A"
0
```
Expand All @@ -135,7 +137,7 @@ Let's try to use B2R2 APIs.
Build
-----
Building B2R2 is fun and easy. All you need to do is to install .NET 6 SDK or
Building B2R2 is fun and easy. All you need to do is to install .NET 8 SDK or
above. Yea, that's it!
- To build B2R2 in release mode, type ```make release``` or ```dotnet build -c
Expand Down Expand Up @@ -174,6 +176,7 @@ Publications

Here are papers using our work. Please create a PR if you want to add yours.

- How'd Security Benefit Reverse Engineers? The Implication of Intel CET on Function Identification, In Proceedings of the International Conference on Dependable Systems Networks, 2022 [(PDF)](https://softsec.kaist.ac.kr/~sangkilc/papers/kim-dsn2022.pdf)
- Smartian: Enhancing Smart Contract Fuzzing with Static and Dynamic Data-Flow Analyses, In Proceedings of the IEEE/ACM International Conference on Automated Software Engineering, 2021 [(PDF)](https://softsec.kaist.ac.kr/~jschoi/data/ase2021.pdf)
- NTFuzz: Enabling Type-Aware Kernel Fuzzing on Windows with Static Binary Analysis, In Proceedings of the IEEE Symposium on Security and Privacy, 2021 [(PDF)](https://softsec.kaist.ac.kr/~jschoi/data/oakland2021.pdf)
- FunProbe: Probing Functions from Binary Code through Probabilistic Analysis, FSE 2023
- How'd Security Benefit Reverse Engineers? The Implication of Intel CET on Function Identification, DSN 2022 [(PDF)](https://softsec.kaist.ac.kr/~sangkilc/papers/kim-dsn2022.pdf)
- Smartian: Enhancing Smart Contract Fuzzing with Static and Dynamic Data-Flow Analyses, ASE 2021 [(PDF)](https://softsec.kaist.ac.kr/~jschoi/data/ase2021.pdf)
- NTFuzz: Enabling Type-Aware Kernel Fuzzing on Windows with Static Binary Analysis, Oakland 2021 [(PDF)](https://softsec.kaist.ac.kr/~jschoi/data/oakland2021.pdf)
Binary file modified assets/b2r2-240x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6253b31

Please sign in to comment.