Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: encounter/objdiff
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.5.2
Choose a base ref
...
head repository: encounter/objdiff
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing with 27,296 additions and 7,107 deletions.
  1. +5 −0 .cargo/config.toml
  2. +168 −24 .github/workflows/build.yaml
  3. +1 −4 .gitignore
  4. +3,012 −1,677 Cargo.lock
  5. +18 −85 Cargo.toml
  6. +94 −41 README.md
  7. +0 −10 build.rs
  8. +228 −0 config.schema.json
  9. +101 −74 deny.toml
  10. +34 −0 objdiff-cli/Cargo.toml
  11. +63 −0 objdiff-cli/src/argp_version.rs
  12. +471 −0 objdiff-cli/src/cmd/diff.rs
  13. +2 −0 objdiff-cli/src/cmd/mod.rs
  14. +418 −0 objdiff-cli/src/cmd/report.rs
  15. +148 −0 objdiff-cli/src/main.rs
  16. +2 −0 objdiff-cli/src/util/mod.rs
  17. +87 −0 objdiff-cli/src/util/output.rs
  18. +16 −0 objdiff-cli/src/util/term.rs
  19. +672 −0 objdiff-cli/src/views/function_diff.rs
  20. +25 −0 objdiff-cli/src/views/mod.rs
  21. +209 −0 objdiff-core/Cargo.toml
  22. +15 −0 objdiff-core/README.md
  23. +67 −0 objdiff-core/build.rs
  24. +248 −0 objdiff-core/config-schema.json
  25. +500 −0 objdiff-core/config_gen.rs
  26. +170 −0 objdiff-core/protos/diff.proto
  27. BIN objdiff-core/protos/proto_descriptor.bin
  28. +164 −0 objdiff-core/protos/report.proto
  29. +458 −0 objdiff-core/src/arch/arm.rs
  30. +2,863 −0 objdiff-core/src/arch/arm64.rs
  31. +337 −0 objdiff-core/src/arch/mips.rs
  32. +248 −0 objdiff-core/src/arch/mod.rs
  33. +749 −0 objdiff-core/src/arch/ppc.rs
  34. +365 −0 objdiff-core/src/arch/x86.rs
  35. +261 −0 objdiff-core/src/bindings/diff.rs
  36. +3 −0 objdiff-core/src/bindings/mod.rs
  37. +463 −0 objdiff-core/src/bindings/report.rs
  38. +104 −0 objdiff-core/src/build/mod.rs
  39. +75 −0 objdiff-core/src/build/watcher.rs
  40. +292 −0 objdiff-core/src/config/mod.rs
  41. +65 −0 objdiff-core/src/config/path.rs
  42. +428 −0 objdiff-core/src/diff/code.rs
  43. +401 −0 objdiff-core/src/diff/data.rs
  44. +135 −0 objdiff-core/src/diff/display.rs
  45. +770 −0 objdiff-core/src/diff/mod.rs
  46. +50 −0 objdiff-core/src/jobs/check_update.rs
  47. +103 −0 objdiff-core/src/jobs/create_scratch.rs
  48. +79 −29 { → objdiff-core}/src/jobs/mod.rs
  49. +194 −0 objdiff-core/src/jobs/objdiff.rs
  50. +25 −19 { → objdiff-core}/src/jobs/update.rs
  51. +21 −0 objdiff-core/src/lib.rs
  52. +191 −0 objdiff-core/src/obj/mod.rs
  53. +771 −0 objdiff-core/src/obj/read.rs
  54. +225 −0 objdiff-core/src/obj/split_meta.rs
  55. +43 −0 objdiff-core/src/util.rs
  56. +99 −0 objdiff-core/src/wasm/api.rs
  57. +64 −0 objdiff-core/src/wasm/cabi_realloc.rs
  58. +18 −0 objdiff-core/src/wasm/mod.rs
  59. +29 −0 objdiff-core/wit/objdiff.wit
  60. +97 −0 objdiff-gui/Cargo.toml
  61. BIN { → objdiff-gui}/assets/icon.ico
  62. BIN { → objdiff-gui}/assets/icon.png
  63. BIN { → objdiff-gui}/assets/icon_64.png
  64. +12 −0 objdiff-gui/build.rs
  65. +817 −0 objdiff-gui/src/app.rs
  66. +398 −0 objdiff-gui/src/app_config.rs
  67. +131 −0 objdiff-gui/src/config.rs
  68. +146 −0 objdiff-gui/src/fonts/matching.rs
  69. +107 −0 objdiff-gui/src/fonts/mod.rs
  70. +108 −0 objdiff-gui/src/hotkeys.rs
  71. +141 −0 objdiff-gui/src/jobs.rs
  72. +249 −0 objdiff-gui/src/main.rs
  73. +10 −6 { → objdiff-gui}/src/update.rs
  74. +313 −0 objdiff-gui/src/views/appearance.rs
  75. +82 −0 objdiff-gui/src/views/column_layout.rs
  76. +961 −0 objdiff-gui/src/views/config.rs
  77. +262 −0 objdiff-gui/src/views/data_diff.rs
  78. +20 −0 objdiff-gui/src/views/debug.rs
  79. 0 { → objdiff-gui}/src/views/demangle.rs
  80. +741 −0 objdiff-gui/src/views/diff.rs
  81. +66 −0 objdiff-gui/src/views/extab_diff.rs
  82. +54 −0 objdiff-gui/src/views/file.rs
  83. +142 −0 objdiff-gui/src/views/frame_history.rs
  84. +416 −0 objdiff-gui/src/views/function_diff.rs
  85. +159 −0 objdiff-gui/src/views/graphics.rs
  86. +160 −0 objdiff-gui/src/views/jobs.rs
  87. +8 −0 { → objdiff-gui}/src/views/mod.rs
  88. +34 −0 objdiff-gui/src/views/rlwinm.rs
  89. +830 −0 objdiff-gui/src/views/symbol_diff.rs
  90. +4 −0 objdiff-wasm/.gitignore
  91. +28 −0 objdiff-wasm/eslint.config.js
  92. +3,519 −0 objdiff-wasm/package-lock.json
  93. +39 −0 objdiff-wasm/package.json
  94. +107 −0 objdiff-wasm/src/display.ts
  95. +132 −0 objdiff-wasm/src/main.ts
  96. +93 −0 objdiff-wasm/src/worker.ts
  97. +9 −0 objdiff-wasm/tsconfig.json
  98. +34 −0 objdiff-wasm/tsup.config.ts
  99. +0 −555 src/app.rs
  100. +0 −96 src/app_config.rs
  101. +0 −207 src/config.rs
  102. +0 −735 src/diff.rs
  103. +0 −162 src/editops.rs
  104. +0 −33 src/jobs/check_update.rs
  105. +0 −213 src/jobs/objdiff.rs
  106. +0 −13 src/lib.rs
  107. +0 −101 src/main.rs
  108. +0 −337 src/obj/elf.rs
  109. +0 −99 src/obj/mips.rs
  110. +0 −180 src/obj/mod.rs
  111. +0 −96 src/obj/ppc.rs
  112. +0 −139 src/views/appearance.rs
  113. +0 −753 src/views/config.rs
  114. +0 −269 src/views/data_diff.rs
  115. +0 −686 src/views/function_diff.rs
  116. +0 −58 src/views/jobs.rs
  117. +0 −406 src/views/symbol_diff.rs
5 changes: 5 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[target.x86_64-pc-windows-msvc]
linker = "rust-lld"

[target.aarch64-pc-windows-msvc]
linker = "rust-lld"
192 changes: 168 additions & 24 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -9,8 +9,9 @@ on:
workflow_dispatch:

env:
CARGO_BIN_NAME: objdiff
BUILD_PROFILE: release-lto
CARGO_TARGET_DIR: target
CARGO_INCREMENTAL: 0

jobs:
check:
@@ -24,15 +25,33 @@ jobs:
sudo apt-get update
sudo apt-get -y install libgtk-3-dev
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
components: clippy
- name: Cache Rust workspace
uses: Swatinem/rust-cache@v2
- name: Cargo check
run: cargo check --all-features
run: cargo check --features all
- name: Cargo clippy
run: cargo clippy --all-features
run: cargo clippy --features all

fmt:
name: Format
runs-on: ubuntu-latest
env:
RUSTFLAGS: -D warnings
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust toolchain
# We use nightly options in rustfmt.toml
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Cargo fmt
run: cargo fmt --all --check

deny:
name: Deny
@@ -45,13 +64,14 @@ jobs:
# Prevent new advisories from failing CI
continue-on-error: ${{ matrix.checks == 'advisories' }}
steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v2
with:
command: check ${{ matrix.checks }}

test:
name: Test
if: 'false' # No tests yet
strategy:
matrix:
platform: [ ubuntu-latest, windows-latest, macos-latest ]
@@ -64,30 +84,118 @@ jobs:
sudo apt-get update
sudo apt-get -y install libgtk-3-dev
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust workspace
uses: Swatinem/rust-cache@v2
- name: Cargo test
run: cargo test --release --all-features
run: cargo test --release --features all

build:
name: Build
build-cli:
name: Build objdiff-cli
env:
CARGO_BIN_NAME: objdiff-cli
strategy:
matrix:
include:
- platform: ubuntu-latest
target: x86_64-unknown-linux-musl
name: linux-x86_64
build: zigbuild
features: default
- platform: ubuntu-latest
target: i686-unknown-linux-musl
name: linux-i686
build: zigbuild
features: default
- platform: ubuntu-latest
target: aarch64-unknown-linux-musl
name: linux-aarch64
build: zigbuild
features: default
- platform: windows-latest
target: i686-pc-windows-msvc
name: windows-x86
build: build
features: default
- platform: windows-latest
target: x86_64-pc-windows-msvc
name: windows-x86_64
build: build
features: default
- platform: windows-latest
target: aarch64-pc-windows-msvc
name: windows-arm64
build: build
features: default
- platform: macos-latest
target: x86_64-apple-darwin
name: macos-x86_64
build: build
features: default
- platform: macos-latest
target: aarch64-apple-darwin
name: macos-arm64
build: build
features: default
fail-fast: false
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install cargo-zigbuild
if: matrix.build == 'zigbuild'
run: |
python3 -m venv .venv
. .venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
pip install ziglang==0.13.0 cargo-zigbuild==0.19.1
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Cache Rust workspace
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: Cargo build
run: >
cargo ${{ matrix.build }} --profile ${{ env.BUILD_PROFILE }} --target ${{ matrix.target }}
--bin ${{ env.CARGO_BIN_NAME }} --features ${{ matrix.features }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.CARGO_BIN_NAME }}-${{ matrix.name }}
path: |
${{ env.CARGO_TARGET_DIR }}/${{ matrix.target }}/${{ env.BUILD_PROFILE }}/${{ env.CARGO_BIN_NAME }}
${{ env.CARGO_TARGET_DIR }}/${{ matrix.target }}/${{ env.BUILD_PROFILE }}/${{ env.CARGO_BIN_NAME }}.exe
if-no-files-found: error

build-gui:
name: Build objdiff-gui
env:
CARGO_BIN_NAME: objdiff
strategy:
matrix:
include:
- platform: ubuntu-latest
target: x86_64-unknown-linux-gnu
name: linux-x86_64
packages: libgtk-3-dev
features: default
- platform: windows-latest
target: x86_64-pc-windows-msvc
name: windows-x86_64
features: default
- platform: macos-latest
target: x86_64-apple-darwin
name: macos-x86_64
features: default
- platform: macos-latest
target: aarch64-apple-darwin
name: macos-arm64
features: default
fail-fast: false
runs-on: ${{ matrix.platform }}
steps:
@@ -97,43 +205,79 @@ jobs:
sudo apt-get update
sudo apt-get -y install ${{ matrix.packages }}
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Cache Rust workspace
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: Cargo build
run: cargo build --release --all-features --target ${{ matrix.target }} --bin ${{ env.CARGO_BIN_NAME }}
run: >
cargo build --profile ${{ env.BUILD_PROFILE }} --target ${{ matrix.target }}
--bin ${{ env.CARGO_BIN_NAME }} --features ${{ matrix.features }}
- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}
name: ${{ env.CARGO_BIN_NAME }}-${{ matrix.name }}
path: |
${{ env.CARGO_TARGET_DIR }}/release/${{ env.CARGO_BIN_NAME }}
${{ env.CARGO_TARGET_DIR }}/release/${{ env.CARGO_BIN_NAME }}.exe
${{ env.CARGO_TARGET_DIR }}/${{ matrix.target }}/release/${{ env.CARGO_BIN_NAME }}
${{ env.CARGO_TARGET_DIR }}/${{ matrix.target }}/release/${{ env.CARGO_BIN_NAME }}.exe
${{ env.CARGO_TARGET_DIR }}/${{ matrix.target }}/${{ env.BUILD_PROFILE }}/${{ env.CARGO_BIN_NAME }}
${{ env.CARGO_TARGET_DIR }}/${{ matrix.target }}/${{ env.BUILD_PROFILE }}/${{ env.CARGO_BIN_NAME }}.exe
if-no-files-found: error

release:
name: Release
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: [ build ]
needs: [ build-cli, build-gui ]
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check git tag against Cargo version
shell: bash
run: |
set -eou pipefail
tag='${{github.ref}}'
tag="${tag#refs/tags/}"
version=$(grep '^version' Cargo.toml | head -1 | awk -F' = ' '{print $2}' | tr -d '"')
version="v$version"
if [ "$tag" != "$version" ]; then
echo "::error::Git tag doesn't match the Cargo version! ($tag != $version)"
exit 1
fi
- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Rename artifacts
working-directory: artifacts
run: |
set -euo pipefail
mkdir ../out
for i in */*/release/$CARGO_BIN_NAME*; do
mv "$i" "../out/$(sed -E "s/([^/]+)\/[^/]+\/release\/($CARGO_BIN_NAME)/\2-\1/" <<< "$i")"
for dir in */; do
for file in "$dir"*; do
base=$(basename "$file")
name="${base%.*}"
ext="${base##*.}"
if [ "$ext" = "$base" ]; then
ext=""
else
ext=".$ext"
fi
arch="${dir%/}" # remove trailing slash
arch="${arch##"$name-"}" # remove bin name
dst="../out/${name}-${arch}${ext}"
mv "$file" "$dst"
done
done
ls -R ../out
- name: Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: out/*
draft: true
generate_release_notes: true
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -3,10 +3,6 @@ target/
**/*.rs.bk
generated/

# cargo-mobile
.cargo/
/gen

# macOS
.DS_Store

@@ -22,3 +18,4 @@ android.keystore
*.frag
*.vert
*.metal
.vscode/
Loading