Skip to content

Commit

Permalink
get rid of nightly features, update README
Browse files Browse the repository at this point in the history
  • Loading branch information
StackOverflowExcept1on committed Sep 9, 2024
1 parent 907ebc0 commit 7db277b
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@nightly
- uses: dtolnay/rust-toolchain@stable

- run: cargo run --release
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "anonlink"
version = "0.1.2"
version = "0.1.3"
authors = ["StackOverflowExcept1on"]
edition = "2021"
description = "Command line tool to automatically patch link.exe to remove Rich PE Header"
Expand Down
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,30 @@ version of compiler and number of C/C++ source files

For more advanced
users: [The Undocumented Microsoft "Rich" Header](https://bytepointer.com/articles/the_microsoft_rich_header.htm)


### Installing from [crates.io](https://crates.io/crates/anonlink)

```bat
cargo install anonlink
```

### Building

```bat
cargo build --release
```

### Usage

```bat
:: run as administrator!
cargo run --release
```

```
linker path: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.41.34120\bin\Hostx64\x64\link.exe
Found call instruction at address 140051A96
Found add instruction at address 140051AAA
Patching bytes [03, CF] => [90, 90]
```
9 changes: 5 additions & 4 deletions src/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ pub trait OutputExt: Sized {
impl OutputExt for Output {
#[inline]
fn exit_result(self) -> io::Result<Self> {
self.status
.exit_ok()
.map_err(|_| io::Error::from(io::ErrorKind::InvalidInput))?;
Ok(self)
if self.status.success() {
Ok(self)
} else {
Err(io::Error::from(io::ErrorKind::InvalidInput))
}
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(exit_status_error)]

use iced_x86::{Code, Decoder, DecoderOptions};
use pelite::pe64::{Pe, PeFile};
use std::io::{Read, Seek, Write};
Expand Down

0 comments on commit 7db277b

Please sign in to comment.