https://github.com/bunopnu/shellbin
Ship your shell script as executable binary
https://github.com/bunopnu/shellbin
assembly batch batch-to-exe binary rust shell
Last synced: about 2 months ago
JSON representation
Ship your shell script as executable binary
- Host: GitHub
- URL: https://github.com/bunopnu/shellbin
- Owner: bunopnu
- License: mit
- Created: 2024-04-13T02:46:15.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-05T11:38:51.000Z (about 2 years ago)
- Last Synced: 2025-05-21T02:46:22.876Z (about 1 year ago)
- Topics: assembly, batch, batch-to-exe, binary, rust, shell
- Language: Rust
- Homepage:
- Size: 45.9 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ShellBin
Ship your shell script as executable binary!
## Output
This tool doesn't need additional tools like compilers or assemblers to generate a binary.
### Windows
The generated binary invokes the `system` function to execute the specified script. **Keep in mind that some anti-malware software may flag binaries due to this behavior.**
### Linux
The generated binary uses the `execve` syscall to execute the specified shell script, calling `/bin/bash` to run the script.
## Example
> Note that you can cross-compile your script, allowing you to compile a Bash script for Linux while using Windows, for example.
### Windows
```
$ shellbin -s "echo testing for windows! && ping bun.rip" -o output.exe -t windows
Successfully wrote 16384 bytes to: output.exe
$ .\output.exe
testing for windows!
Pinging bun.rip [104.21.28.78] with 32 bytes of data:
Reply from 104.21.28.78: bytes=32 time=64ms TTL=48
Reply from 104.21.28.78: bytes=32 time=66ms TTL=48
Reply from 104.21.28.78: bytes=32 time=70ms TTL=48
Reply from 104.21.28.78: bytes=32 time=63ms TTL=48
Ping statistics for 104.21.28.78:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 63ms, Maximum = 70ms, Average = 65ms
```
### Linux
```
$ shellbin -s "echo testing for linux! && dir" -o output -t linux-amd64
Successfully wrote 288 bytes to: output
$ ./output
testing for linux!
Cargo.lock Cargo.toml LICENSE README.md output src target testing
```
## License
ShellBin is licensed under the MIT license.