From 6bd2a47e548dbc48c1755c047e697ffe59d4d6e1 Mon Sep 17 00:00:00 2001 From: ko1N Date: Thu, 31 Dec 2020 16:58:42 +0100 Subject: [PATCH 01/24] Updated readme and leechcore dependency --- README.md | 2 -- leechcore-sys/src/leechcore | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index d908948..313fb49 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -# This repository is currently work-in-progress and might not fully work. - # memflow-pcileech This connector implements a rust-native implementation of the pcileech interface. diff --git a/leechcore-sys/src/leechcore b/leechcore-sys/src/leechcore index 9b859f1..e31a508 160000 --- a/leechcore-sys/src/leechcore +++ b/leechcore-sys/src/leechcore @@ -1 +1 @@ -Subproject commit 9b859f127784961882ab8ea8803043b37fd1ab61 +Subproject commit e31a5084e264b4ab3c21238a95f703e994ec3384 From 6f55c169097488122b37054b0216cb2390894bfe Mon Sep 17 00:00:00 2001 From: ko1N Date: Fri, 1 Jan 2021 02:27:00 +0100 Subject: [PATCH 02/24] Added macports --- .github/workflows/build.yml | 67 +++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0a27471..44a939f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,25 +7,45 @@ env: jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-latest, ubuntu-latest, windows-latest] + build-windows: + runs-on: windows-latest steps: - uses: actions/checkout@v2 + - name: build + run: cargo build --workspace --verbose + - name: run tests + run: cargo test --workspace --verbose + - name: build examples + run: cargo build --workspace --examples --verbose - - name: Install libusb-1.0 + build-ubuntu: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: install libusb-1.0 run: sudo apt-get install libusb-1.0-0-dev - if: runner.os != 'Windows' - - - name: Build + - name: build run: cargo build --workspace --verbose + - name: run tests + run: cargo test --workspace --verbose + - name: build examples + run: cargo build --workspace --examples --verbose - - name: Build examples + build-macos: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - uses: keepitsimpletech/actions/setup-macports@setup-macports/releases/v1 + - name: install libusb-1.0 + run: sudo port -vs install libusb libusb-devel + - name: build + run: cargo build --workspace --verbose + - name: run tests + run: cargo test --workspace --verbose + - name: build examples run: cargo build --workspace --examples --verbose - build-arm: + build-ubuntu-aarch64: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -40,32 +60,13 @@ jobs: use-cross: true command: build args: --target aarch64-unknown-linux-gnu --workspace --verbose - - test: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-latest, ubuntu-latest, windows-latest] - steps: - - uses: actions/checkout@v2 - - - name: Install libusb-1.0 - run: sudo apt-get install libusb-1.0-0-dev - if: runner.os != 'Windows' - - - name: Run all tests - run: cargo test --workspace --verbose - if: runner.os == 'Linux' - - - name: Run all tests - run: cargo test --workspace --exclude memflow-derive --verbose lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - run: rustup component add clippy - - name: Check formatting + - name: check formatting run: cargo fmt -- --check - uses: actions-rs/clippy-check@v1 with: @@ -76,14 +77,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Set up Rust nightly + - name: setup rust nightly uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: nightly override: true - run: cargo install grcov - - name: Run tests with coverage + - name: run tests with coverage run: | export CARGO_INCREMENTAL=0 export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort" From 6b55f1b9e0ae2cdcebe6d6cb882b7188cbe6b6ca Mon Sep 17 00:00:00 2001 From: ko1N Date: Fri, 1 Jan 2021 02:29:23 +0100 Subject: [PATCH 03/24] Enforced macos version 10.14 in ci --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 44a939f..702dc04 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,7 @@ jobs: run: cargo build --workspace --examples --verbose build-macos: - runs-on: macos-latest + runs-on: macOS-10.14 steps: - uses: actions/checkout@v2 - uses: keepitsimpletech/actions/setup-macports@setup-macports/releases/v1 From a681307712fbd9f240d7384c7576ec8f9bb53aff Mon Sep 17 00:00:00 2001 From: ko1N Date: Fri, 1 Jan 2021 02:31:02 +0100 Subject: [PATCH 04/24] Added submodule checkout to ci --- .github/workflows/build.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 702dc04..f8bcc1f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,8 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v2 + with: + submodules: 'true' - name: build run: cargo build --workspace --verbose - name: run tests @@ -22,6 +24,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + submodules: 'true' - name: install libusb-1.0 run: sudo apt-get install libusb-1.0-0-dev - name: build @@ -35,6 +39,8 @@ jobs: runs-on: macOS-10.14 steps: - uses: actions/checkout@v2 + with: + submodules: 'true' - uses: keepitsimpletech/actions/setup-macports@setup-macports/releases/v1 - name: install libusb-1.0 run: sudo port -vs install libusb libusb-devel @@ -49,6 +55,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + submodules: 'true' - uses: actions-rs/toolchain@v1 with: toolchain: stable @@ -65,6 +73,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + submodules: 'true' - run: rustup component add clippy - name: check formatting run: cargo fmt -- --check @@ -77,6 +87,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + submodules: 'true' - name: setup rust nightly uses: actions-rs/toolchain@v1 with: From 97d56bfc1cf5c10378e4224ad293a551aee9395e Mon Sep 17 00:00:00 2001 From: ko1N Date: Fri, 1 Jan 2021 02:36:43 +0100 Subject: [PATCH 05/24] Added clip lint exclusion --- memflow-pcileech/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/memflow-pcileech/src/lib.rs b/memflow-pcileech/src/lib.rs index 0ad9af9..4d7d240 100644 --- a/memflow-pcileech/src/lib.rs +++ b/memflow-pcileech/src/lib.rs @@ -46,6 +46,7 @@ const fn calc_num_pages(start: u64, size: u64) -> u64 { ((start & (PAGE_SIZE as u64 - 1)) + size + (PAGE_SIZE as u64 - 1)) >> 12 } +#[allow(clippy::mutex_atomic)] #[derive(Debug)] pub struct PciLeech { handle: Arc>, @@ -81,6 +82,7 @@ impl PciLeech { Self::with_mapping(device, memmap) } + #[allow(clippy::mutex_atomic)] fn with_mapping(device: &str, mem_map: MemoryMap<(Address, usize)>) -> Result { // open device let mut conf = build_lc_config(device); From 5569a2e3fa77070376eaa9279ef4517a4209807e Mon Sep 17 00:00:00 2001 From: ko1N Date: Fri, 1 Jan 2021 02:41:21 +0100 Subject: [PATCH 06/24] Removed aarch64 ci and added llvm/libclang installation for windows --- .github/workflows/build.yml | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f8bcc1f..3a93bdf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,6 +13,10 @@ jobs: - uses: actions/checkout@v2 with: submodules: 'true' + - name: install libclang + uses: crazy-max/ghaction-chocolatey@v1 + with: + args: install llvm - name: build run: cargo build --workspace --verbose - name: run tests @@ -51,24 +55,6 @@ jobs: - name: build examples run: cargo build --workspace --examples --verbose - build-ubuntu-aarch64: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - submodules: 'true' - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - target: aarch64-unknown-linux-gnu - override: true - - run: sudo apt-get install libusb-1.0-0-dev - - uses: actions-rs/cargo@v1 - with: - use-cross: true - command: build - args: --target aarch64-unknown-linux-gnu --workspace --verbose - lint: runs-on: ubuntu-latest steps: @@ -89,6 +75,8 @@ jobs: - uses: actions/checkout@v2 with: submodules: 'true' + - name: install libusb-1.0 + run: sudo apt-get install libusb-1.0-0-dev - name: setup rust nightly uses: actions-rs/toolchain@v1 with: From 2f0009751b3b15825c9bc49653146fa9eda45cbb Mon Sep 17 00:00:00 2001 From: ko1N Date: Fri, 1 Jan 2021 02:54:07 +0100 Subject: [PATCH 07/24] Added manual llvm installation on windows --- .github/workflows/build.yml | 31 +++---------------------------- leechcore-sys/build.rs | 4 ++-- 2 files changed, 5 insertions(+), 30 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3a93bdf..e3aeba0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,9 +14,9 @@ jobs: with: submodules: 'true' - name: install libclang - uses: crazy-max/ghaction-chocolatey@v1 - with: - args: install llvm + run: | + curl -Ls -o "LLVM-10.0.0-win64.exe" "https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/LLVM-10.0.0-win64.exe" + LLVM-10.0.0-win64.exe /S - name: build run: cargo build --workspace --verbose - name: run tests @@ -68,28 +68,3 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} args: --all-targets - - build-coverage: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - submodules: 'true' - - name: install libusb-1.0 - run: sudo apt-get install libusb-1.0-0-dev - - name: setup rust nightly - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - - run: cargo install grcov - - name: run tests with coverage - run: | - export CARGO_INCREMENTAL=0 - export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort" - export RUSTDOCFLAGS="-Cpanic=abort" - cargo build --workspace --exclude memflow-derive - cargo test --workspace --exclude memflow-derive - grcov ./target/debug/ -s . -t lcov --llvm --branch --ignore-not-existing -o ./target/debug/coverage - bash <(curl -s https://codecov.io/bash) -f ./target/debug/coverage -t ${{ secrets.CODECOV_TOKEN }}; diff --git a/leechcore-sys/build.rs b/leechcore-sys/build.rs index 8465fe2..3ee2e5b 100644 --- a/leechcore-sys/build.rs +++ b/leechcore-sys/build.rs @@ -64,7 +64,7 @@ fn build_leechcore(target: &str) { for flag in String::from_utf8_lossy(&libusb_flags.stdout) .trim() - .split(" ") + .split(' ') { cfg.flag(flag); } @@ -91,7 +91,7 @@ fn build_leechcore(target: &str) { println!("cargo:rustc-link-lib=static=leechcore"); } -fn main() -> () { +fn main() { let target = env::var("TARGET").unwrap(); let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap()); From 647e5d77fd442de55b79397e73d23d263e73538f Mon Sep 17 00:00:00 2001 From: ko1N Date: Fri, 1 Jan 2021 03:00:11 +0100 Subject: [PATCH 08/24] Updated to latest choco installer --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e3aeba0..3900f05 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,9 +14,9 @@ jobs: with: submodules: 'true' - name: install libclang - run: | - curl -Ls -o "LLVM-10.0.0-win64.exe" "https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/LLVM-10.0.0-win64.exe" - LLVM-10.0.0-win64.exe /S + uses: crazy-max/ghaction-chocolatey@master + with: + args: install llvm - name: build run: cargo build --workspace --verbose - name: run tests From c52bd8354cfcfede67b89a959061b130b66f4efb Mon Sep 17 00:00:00 2001 From: ko1N Date: Fri, 1 Jan 2021 03:02:45 +0100 Subject: [PATCH 09/24] Changed macports installation --- .github/workflows/build.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3900f05..91fc03f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,12 +40,15 @@ jobs: run: cargo build --workspace --examples --verbose build-macos: - runs-on: macOS-10.14 + runs-on: macos-latest steps: - uses: actions/checkout@v2 with: submodules: 'true' - - uses: keepitsimpletech/actions/setup-macports@setup-macports/releases/v1 + - name: install macports + run: | + curl -LO https://raw.githubusercontent.com/GiovanniBussi/macports-ci/master/macports-ci + source ./macports-ci install - name: install libusb-1.0 run: sudo port -vs install libusb libusb-devel - name: build From a9369ad0ee500d5b0ed38c19ba1fa7c034e3955e Mon Sep 17 00:00:00 2001 From: ko1N Date: Fri, 1 Jan 2021 03:21:04 +0100 Subject: [PATCH 10/24] Added mingw path to ci --- .github/workflows/build.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 91fc03f..4444331 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,11 +17,17 @@ jobs: uses: crazy-max/ghaction-chocolatey@master with: args: install llvm + - name: add clang path to $PATH env + shell: bash + run: echo "PATH=$PATH:C:\msys64\mingw64\bin" >> $GITHUB_ENV - name: build + shell: bash run: cargo build --workspace --verbose - name: run tests + shell: bash run: cargo test --workspace --verbose - name: build examples + shell: bash run: cargo build --workspace --examples --verbose build-ubuntu: @@ -50,7 +56,7 @@ jobs: curl -LO https://raw.githubusercontent.com/GiovanniBussi/macports-ci/master/macports-ci source ./macports-ci install - name: install libusb-1.0 - run: sudo port -vs install libusb libusb-devel + run: sudo port -vs install libusb-devel - name: build run: cargo build --workspace --verbose - name: run tests @@ -64,6 +70,8 @@ jobs: - uses: actions/checkout@v2 with: submodules: 'true' + - name: install libusb-1.0 + run: sudo apt-get install libusb-1.0-0-dev - run: rustup component add clippy - name: check formatting run: cargo fmt -- --check From 119a9de022281ea0c1f1bad82876f2444080de9e Mon Sep 17 00:00:00 2001 From: ko1N Date: Fri, 1 Jan 2021 03:36:36 +0100 Subject: [PATCH 11/24] Added clang compiler to windows build --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4444331..ab89c28 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,7 @@ jobs: build-windows: runs-on: windows-latest + compiler: clang steps: - uses: actions/checkout@v2 with: From 931e421a0f7a496d01a1cd05ba12267b490b0da4 Mon Sep 17 00:00:00 2001 From: ko1N Date: Fri, 1 Jan 2021 03:41:46 +0100 Subject: [PATCH 12/24] Fixed ci script --- .github/workflows/build.yml | 3 +-- leechcore-sys/build.rs | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ab89c28..b4c2d07 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,6 @@ jobs: build-windows: runs-on: windows-latest - compiler: clang steps: - uses: actions/checkout@v2 with: @@ -20,7 +19,7 @@ jobs: args: install llvm - name: add clang path to $PATH env shell: bash - run: echo "PATH=$PATH:C:\msys64\mingw64\bin" >> $GITHUB_ENV + run: echo "PATH=$PATH:C:\msys64\mingw32\bin" >> $GITHUB_ENV - name: build shell: bash run: cargo build --workspace --verbose diff --git a/leechcore-sys/build.rs b/leechcore-sys/build.rs index 3ee2e5b..8c8d32f 100644 --- a/leechcore-sys/build.rs +++ b/leechcore-sys/build.rs @@ -16,6 +16,11 @@ fn os_define() -> &'static str { "LINUX" } +#[cfg(target_os = "macos")] +fn os_define() -> &'static str { + "LINUX" +} + fn build_leechcore(target: &str) { let mut files = vec![ "oscompatibility.c", From 98da62e3dc4f9cb475775d74730d334f83caecfd Mon Sep 17 00:00:00 2001 From: ko1N Date: Fri, 1 Jan 2021 03:52:31 +0100 Subject: [PATCH 13/24] Updated build dependencies --- .github/workflows/build.yml | 3 --- leechcore-sys/Cargo.toml | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b4c2d07..52fcec1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,9 +17,6 @@ jobs: uses: crazy-max/ghaction-chocolatey@master with: args: install llvm - - name: add clang path to $PATH env - shell: bash - run: echo "PATH=$PATH:C:\msys64\mingw32\bin" >> $GITHUB_ENV - name: build shell: bash run: cargo build --workspace --verbose diff --git a/leechcore-sys/Cargo.toml b/leechcore-sys/Cargo.toml index 80449bf..469e47b 100644 --- a/leechcore-sys/Cargo.toml +++ b/leechcore-sys/Cargo.toml @@ -12,6 +12,6 @@ links = "leechcore" ctor = "0.1" [build-dependencies] -cc = "1.0.62" -bindgen = "0.55" +cc = "1.0" +bindgen = "0.56" pkg-config = "0.3" From bc1ab377e6ffdd541ba2380de4ac83cf76686c9c Mon Sep 17 00:00:00 2001 From: ko1N Date: Mon, 15 Feb 2021 22:14:01 +0100 Subject: [PATCH 14/24] Added workaround for missing libclang on github ci --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 52fcec1..a3c4c54 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,6 +17,8 @@ jobs: uses: crazy-max/ghaction-chocolatey@master with: args: install llvm + - name: set LIBCLANG_PATH + run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV - name: build shell: bash run: cargo build --workspace --verbose From 51074701e32c0b45ed7419203062db8a4ca8926b Mon Sep 17 00:00:00 2001 From: ko1N Date: Mon, 15 Feb 2021 22:20:56 +0100 Subject: [PATCH 15/24] Changed llvm installation --- .github/workflows/build.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a3c4c54..97e3583 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,10 +13,11 @@ jobs: - uses: actions/checkout@v2 with: submodules: 'true' - - name: install libclang - uses: crazy-max/ghaction-chocolatey@master + - name: install llvm and clang + uses: KyleMayes/install-llvm-action@v1 with: - args: install llvm + version: "10.0" + directory: ${{ runner.temp }}/llvm - name: set LIBCLANG_PATH run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV - name: build From 5357a10791d2a193e6aa00b6a2be619435f018e4 Mon Sep 17 00:00:00 2001 From: ko1N Date: Mon, 15 Mar 2021 12:43:46 +0100 Subject: [PATCH 16/24] Removed mac os builds from ci; added LIBCLANG_PATH remarks to readme --- .github/workflows/build.yml | 4 ++-- README.md | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0a27471..6a05591 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-latest, ubuntu-latest, windows-latest] + os: [ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v2 @@ -45,7 +45,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-latest, ubuntu-latest, windows-latest] + os: [ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v2 diff --git a/README.md b/README.md index d908948..bc4a5b3 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,8 @@ Install the following build tools: - clang - libusb-1.0 (only required on linux) +Make sure that libclang can be found by either adding it to your `PATH` or via the `LIBCLANG_PATH=` environment variable. + On Windows you additionally need to supply the proprietary `FTD3XX.dll`. It can be downloaded from the [FTDI Website](https://www.ftdichip.com/Drivers/D3XX.htm) in the `Application Library (DLL)` column. On Linux you need to check-out and compile the `leechcore_ft601_driver_linux` project from the [LeechCore-Plugins](https://github.com/ufrisk/LeechCore-plugins) repository. From 6580b3ca14ac617b014772d0b57a8f5ccfa72074 Mon Sep 17 00:00:00 2001 From: ko1N Date: Mon, 15 Mar 2021 12:50:00 +0100 Subject: [PATCH 17/24] Updated github actions --- .github/workflows/build.yml | 38 ++++++++-------- .github/workflows/release.yml | 81 +++++++++++++++++++++++++++++++++++ README.md | 2 +- 3 files changed, 102 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1e6517f..71e1262 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,24 @@ env: jobs: - build-windows: + build_ubuntu_x86-64: + name: Build for ubuntu-latest (x86-64) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: 'true' + - name: install libusb-1.0 + run: sudo apt-get install libusb-1.0-0-dev + - name: build + run: cargo build --workspace --all-features --verbose + - name: run tests + run: cargo test --workspace --verbose + - name: build examples + run: cargo build --workspace --all-features --examples --verbose + + build_windows_x86-64: + name: Build for windows-latest (x86-64) runs-on: windows-latest steps: - uses: actions/checkout@v2 @@ -22,28 +39,13 @@ jobs: run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV - name: build shell: bash - run: cargo build --workspace --verbose + run: cargo build --workspace --all-features --verbose - name: run tests shell: bash run: cargo test --workspace --verbose - name: build examples shell: bash - run: cargo build --workspace --examples --verbose - - build-ubuntu: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - submodules: 'true' - - name: install libusb-1.0 - run: sudo apt-get install libusb-1.0-0-dev - - name: build - run: cargo build --workspace --verbose - - name: run tests - run: cargo test --workspace --verbose - - name: build examples - run: cargo build --workspace --examples --verbose + run: cargo build --workspace --all-features --examples --verbose lint: runs-on: ubuntu-latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ceae3e4 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,81 @@ +name: Release binaries + +on: + release: + types: [created] + +env: + CARGO_TERM_COLOR: always + +jobs: + + build_ubuntu_x86-64: + name: Build artifacts for ubuntu-latest (x86-64) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: 'true' + - name: install libusb-1.0 + run: sudo apt-get install libusb-1.0-0-dev + - name: build + run: cargo build --workspace --all-features --verbose + - uses: actions/upload-artifact@v2 + with: + name: library-ubuntu + path: target/release/*.so + + build_windows_x86-64: + name: Build artifacts for windows-latest (x86-64) + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: 'true' + - name: install llvm and clang + uses: KyleMayes/install-llvm-action@v1 + with: + version: "10.0" + directory: ${{ runner.temp }}/llvm + - name: set LIBCLANG_PATH + run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV + - name: build + shell: bash + run: cargo build --workspace --all-features --verbose + - uses: actions/upload-artifact@v2 + with: + name: library-windows + path: target/release/*.dll + + publish_artifacts: + name: Publish artifacts for x86-64/windows-latest + runs-on: ubuntu-latest + needs: [build_ubuntu_x86-64, build_windows_x86-64, build_macos_x86-64] + steps: + - uses: actions/download-artifact@v2 + with: + name: library-ubuntu + - name: Upload ubuntu artifacts + uses: skx/github-action-publish-binaries@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + args: '*.so' + - uses: actions/download-artifact@v2 + with: + name: library-windows + - name: Upload windows artifacts + uses: skx/github-action-publish-binaries@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + args: '*.dll' + - uses: actions/download-artifact@v2 + with: + name: library-macos + - name: Upload macos artifacts + uses: skx/github-action-publish-binaries@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + args: '*.dylib' diff --git a/README.md b/README.md index 71491bc..a6cfac8 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Install the following build tools: - clang - libusb-1.0 (only required on linux) -Make sure that libclang can be found by either adding it to your `PATH` or via the `LIBCLANG_PATH=` environment variable. +Make sure that libclang can be found by either adding it to your `PATH` or via the `LIBCLANG_PATH` environment variable. On Windows you additionally need to supply the proprietary `FTD3XX.dll`. It can be downloaded from the [FTDI Website](https://www.ftdichip.com/Drivers/D3XX.htm) in the `Application Library (DLL)` column. From 6bfe84dfe1e0e49966000294ebffbc146551a4a6 Mon Sep 17 00:00:00 2001 From: ko1N Date: Mon, 15 Mar 2021 12:51:06 +0100 Subject: [PATCH 18/24] Fixed github action syntax --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 71e1262..94f1c5d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ env: jobs: build_ubuntu_x86-64: - name: Build for ubuntu-latest (x86-64) + name: Build for ubuntu-latest (x86-64) runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 From e0fb116a84997874e855a7efea0d31cbb09a7b5d Mon Sep 17 00:00:00 2001 From: ko1N Date: Mon, 15 Mar 2021 12:56:34 +0100 Subject: [PATCH 19/24] Fixed release workflow --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ceae3e4..0eaa2c5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,7 +50,7 @@ jobs: publish_artifacts: name: Publish artifacts for x86-64/windows-latest runs-on: ubuntu-latest - needs: [build_ubuntu_x86-64, build_windows_x86-64, build_macos_x86-64] + needs: [build_ubuntu_x86-64, build_windows_x86-64] steps: - uses: actions/download-artifact@v2 with: From 6466aeca59f5121f0c17f7fc658fecbadc2e6473 Mon Sep 17 00:00:00 2001 From: ko1N Date: Mon, 15 Mar 2021 12:57:24 +0100 Subject: [PATCH 20/24] Bumped version to 0.1.5 --- leechcore-sys/Cargo.toml | 2 +- memflow-pcileech/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/leechcore-sys/Cargo.toml b/leechcore-sys/Cargo.toml index 469e47b..da07684 100644 --- a/leechcore-sys/Cargo.toml +++ b/leechcore-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "leechcore-sys" -version = "0.1.0" +version = "0.1.5" authors = ["ko1N "] edition = "2018" readme = "../README.md" diff --git a/memflow-pcileech/Cargo.toml b/memflow-pcileech/Cargo.toml index 35bc00c..fabfb07 100644 --- a/memflow-pcileech/Cargo.toml +++ b/memflow-pcileech/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "memflow-pcileech" -version = "0.1.0" +version = "0.1.5" authors = ["ko1N "] edition = "2018" description = "qemu procfs connector for leechcore/pcileech" From 0166bf703a33f8e0ffb81a07bf6b3f326127621a Mon Sep 17 00:00:00 2001 From: ko1N Date: Mon, 15 Mar 2021 20:20:58 +0100 Subject: [PATCH 21/24] Switched to release build --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0eaa2c5..9b37cc7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: - name: install libusb-1.0 run: sudo apt-get install libusb-1.0-0-dev - name: build - run: cargo build --workspace --all-features --verbose + run: cargo build --release --workspace --all-features --verbose - uses: actions/upload-artifact@v2 with: name: library-ubuntu @@ -41,7 +41,7 @@ jobs: run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV - name: build shell: bash - run: cargo build --workspace --all-features --verbose + run: cargo build --release --workspace --all-features --verbose - uses: actions/upload-artifact@v2 with: name: library-windows From a09c544363ffb71adbe8060fc46a33645a0afc6e Mon Sep 17 00:00:00 2001 From: ko1N Date: Mon, 15 Mar 2021 20:22:10 +0100 Subject: [PATCH 22/24] Removed mac os from asset upload --- .github/workflows/release.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9b37cc7..b72b7a9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -70,12 +70,3 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: args: '*.dll' - - uses: actions/download-artifact@v2 - with: - name: library-macos - - name: Upload macos artifacts - uses: skx/github-action-publish-binaries@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - args: '*.dylib' From e77f291e72b2003184ccf7887bdd60fed9aebde5 Mon Sep 17 00:00:00 2001 From: ko1N Date: Mon, 15 Mar 2021 22:41:19 +0100 Subject: [PATCH 23/24] Added zip generation for artifacts --- .github/workflows/release.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b72b7a9..0e18642 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -55,18 +55,22 @@ jobs: - uses: actions/download-artifact@v2 with: name: library-ubuntu + - name: Create archive for linux x86-64 + run: zip memflow_pcileech_linux_x86-64.zip *.so - name: Upload ubuntu artifacts uses: skx/github-action-publish-binaries@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - args: '*.so' + args: 'memflow_pcileech_linux_x86-64.zip' - uses: actions/download-artifact@v2 with: name: library-windows + - name: Create archive for windows x86-64 + run: zip memflow_pcileech_windows_x86-64.zip *.dll - name: Upload windows artifacts uses: skx/github-action-publish-binaries@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - args: '*.dll' + args: 'memflow_pcileech_windows_x86-64.zip' From 125be46db3fc4f2c73d1424ace537dcea06078f4 Mon Sep 17 00:00:00 2001 From: ko1N Date: Wed, 17 Mar 2021 19:28:53 +0100 Subject: [PATCH 24/24] Added registry key to acquire the memory map to readme --- .github/workflows/release.yml | 5 +++-- README.md | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0e18642..c7c8352 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -57,18 +57,19 @@ jobs: name: library-ubuntu - name: Create archive for linux x86-64 run: zip memflow_pcileech_linux_x86-64.zip *.so - - name: Upload ubuntu artifacts + - name: Upload artifacts for linux x86-64 uses: skx/github-action-publish-binaries@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: args: 'memflow_pcileech_linux_x86-64.zip' + - uses: actions/download-artifact@v2 with: name: library-windows - name: Create archive for windows x86-64 run: zip memflow_pcileech_windows_x86-64.zip *.dll - - name: Upload windows artifacts + - name: Upload artifacts for windows x86-64 uses: skx/github-action-publish-binaries@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index a6cfac8..595df65 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,11 @@ real_base=0x3000 The `real_base` parameter is optional. If it is not set there will be no re-mapping. +On Windows systems the memory map can be obtained from the Registry under the following Key: +``` +HKEY_LOCAL_MACHINE\\HARDWARE\\RESOURCEMAP\\System Resources\\Physical Memory\\.Translated +``` + ## License Licensed under GPL-3.0 License, see [LICENSE](LICENSE).