Add poly Cargo profile, use black_box for anti-DCE, RUSTFLAGS #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [stable, dev] | |
| paths: | |
| - 'src/**' | |
| - 'Cargo.toml' | |
| - 'scripts/**' | |
| pull_request: | |
| branches: [stable] | |
| jobs: | |
| build: | |
| name: Build & Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - run: cargo build --release | |
| - run: cargo test | |
| - name: Verify binary | |
| run: ./target/release/hidemylogs --version | |
| generate-samples: | |
| name: Regenerate samples | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Check if generate script changed | |
| id: check | |
| run: | | |
| if git diff --name-only HEAD~1 2>/dev/null | grep -q 'scripts/generate_samples.py'; then | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "changed=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Generate samples | |
| if: steps.check.outputs.changed == 'true' | |
| run: python3 scripts/generate_samples.py | |
| - name: Build and verify samples parse | |
| if: steps.check.outputs.changed == 'true' | |
| run: | | |
| cargo build --release | |
| echo "--- utmp ---" | |
| ./target/release/hidemylogs -q print -u samples/compromised.utmp -s u | |
| echo "--- wtmp ---" | |
| ./target/release/hidemylogs -q print -w samples/compromised.wtmp -s w | |
| echo "--- btmp ---" | |
| ./target/release/hidemylogs -q print -b samples/compromised.btmp -s b | |
| echo "--- lastlog ---" | |
| ./target/release/hidemylogs -q print -l samples/compromised.lastlog -s l | |
| - name: Commit updated samples | |
| if: steps.check.outputs.changed == 'true' && github.event_name == 'push' | |
| run: | | |
| git config user.name "franckferman" | |
| git config user.email "franckferman@users.noreply.github.com" | |
| git add samples/ | |
| if git diff --cached --quiet; then | |
| echo "[*] No changes to samples." | |
| else | |
| git commit -m "Regenerate sample files" | |
| git push | |
| fi |