Skip to content

Commit

Permalink
🎉 change example to examples; add demo picture
Browse files Browse the repository at this point in the history
  • Loading branch information
jiusanzhou committed Oct 22, 2021
1 parent bedecf0 commit c895ce4
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .cargo/config
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[build]
target = "x86_64-pc-windows-msvc"
target = "i686-pc-windows-msvc"
6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
[package]
name = "injrs"
version = "0.1.1"
version = "0.1.2"
description = "DLL injector library and tool written in Rust. Rust 实现的DLL注入工具/库。"
authors = ["Zoe <[email protected]>"]
license = "Apache-2.0"
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[[example]]
name = "hellobox"
crate-type = ["cdylib"]


[dependencies.winapi]
Expand All @@ -16,6 +19,7 @@ features = [
"memoryapi",
"minwindef",
"ntdef",
"winuser",
"tlhelp32",
"psapi",
"securitybaseapi",
Expand Down
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<div align="center">

<img alt="Hello Box Demo" src="./hello-box-demo.png" width="100">

# `injrs`

**DLL injector library and tool written in Rust. Rust 实现的DLL注入工具/库**
Expand Down Expand Up @@ -42,7 +44,24 @@ EXAMPLES:
$ injrs 1888 test.dll demo.dll
```

The code in [example](./example) is a simple message box dll for testing injector.
## DLL Demo

The code in [examples/hellobox](./examples/hellobox) is a simple message box dll for testing injector.

You can build with command:
```bash
cargo build --release --example hellobox
```

Build target will locate in:
```bash
target/i686-pc-windows-msvc/release/examples/hellobox.dll
```

Try to inject the demo dll to your target process:
```bash
injrs PID/PNAME target/i686-pc-windows-msvc/release/examples/hellobox.dll
```

## Usage as library

Expand Down
2 changes: 0 additions & 2 deletions example/.cargo/config

This file was deleted.

13 changes: 0 additions & 13 deletions example/Cargo.toml

This file was deleted.

2 changes: 1 addition & 1 deletion example/src/lib.rs → examples/hellobox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fn show_message_box(caption: &str, text: &str) {
// define dllmain to handle the init action
#[no_mangle]
#[allow(non_snake_case)]
pub extern "stdcall" fn DllMain(hinst: HINSTANCE, reason: DWORD, _reserved: LPVOID) -> BOOL {
unsafe extern "system" fn DllMain(hinst: HINSTANCE, reason: DWORD, _reserved: LPVOID) -> BOOL {
match reason {
DLL_PROCESS_DETACH => {
println!("Remove from main process.");
Expand Down
Binary file added hello-box-demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c895ce4

Please sign in to comment.