Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build Auxtools

on:
push:
branches: [master]
pull_request:
branches: [master]

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ${{ matrix.os.runner }}
strategy:
fail-fast: false
matrix:
os:
- name: linux
runner: ubuntu-latest
target: i686-unknown-linux-gnu
- name: win
runner: windows-latest
target: i686-pc-windows-msvc
steps:
- uses: actions/checkout@v2

- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: ${{ matrix.os.target }}

- name: Install Dependencies (Linux)
if: ${{ matrix.os.name == 'linux' }}
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libgcc-s1:i386 g++-multilib zlib1g-dev:i386 libssl-dev:i386

- name: Build
run: cargo build --target=${{ matrix.os.target }} --release --verbose
env:
PKG_CONFIG_ALLOW_CROSS: 1

- name: Upload debug-server (Windows)
uses: actions/upload-artifact@v2
if: ${{ matrix.os.name == 'win' }}
with:
name: debug-server-windows
path: |
target/i686-pc-windows-msvc/release/debug_server.dll
target/i686-pc-windows-msvc/release/debug_server.pdb

- name: Run Tests (Windows)
if: ${{ matrix.os.name == 'win' }}
run: cargo test --target=${{matrix.os.target}} --verbose
env:
PKG_CONFIG_ALLOW_CROSS: 1
File renamed without changes.
57 changes: 0 additions & 57 deletions .github/workflows/windows.yml

This file was deleted.

6 changes: 5 additions & 1 deletion instruction_hooking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ extern "C" {
fn execute_instruction_hook();

// The 514 version of the instruction hook.
#[cfg(windows)]
fn execute_instruction_hook_514();
}

Expand All @@ -58,11 +59,14 @@ fn instruction_hooking_init() -> Result<(), String> {
execute_instruction
}

let versioned_hook = if cfg!(windows) && auxtools::version::get().0 == 514 {
#[cfg(windows)]
let versioned_hook = if auxtools::version::get().0 == 514 {
execute_instruction_hook_514 as *const ()
} else {
execute_instruction_hook as *const ()
};
#[cfg(unix)]
let versioned_hook = execute_instruction_hook as *const ();

unsafe {
let hook = RawDetour::new(execute_instruction as *const (), versioned_hook).map_err(|_| "Couldn't detour execute_instruction")?;
Expand Down