mirror of
https://github.com/exoticorn/upkr.git
synced 2026-01-20 19:46:42 +01:00
Compare commits
2 Commits
e11622202b
...
588c1452b9
| Author | SHA1 | Date | |
|---|---|---|---|
| 588c1452b9 | |||
| 1e0c8bb5a7 |
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -308,7 +308,7 @@ checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd"
|
||||
|
||||
[[package]]
|
||||
name = "upkr"
|
||||
version = "0.2.1"
|
||||
version = "0.2.2"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"cdivsufsort",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "upkr"
|
||||
version = "0.2.1"
|
||||
version = "0.2.2"
|
||||
edition = "2021"
|
||||
|
||||
[profile.release]
|
||||
|
||||
11
README.md
11
README.md
@@ -22,6 +22,12 @@ c_unpacker and asm_unpackers unpack the default upkr compressed format. The z80_
|
||||
is based on some variations to the compressed format. (Use `upkr --z80` to select those variations.)
|
||||
The 16 bit dos unpacker also uses some variations. (`upkr --x86`)
|
||||
|
||||
### More unpackers outside this repository
|
||||
|
||||
* [Atari Lynx](https://github.com/42Bastian/new_bll/blob/master/demos/depacker/unupkr.asm)
|
||||
* [Atari Jaguar](https://github.com/42Bastian/new_bjl/blob/main/exp/depacker/unupkr.js)
|
||||
* [8080, R800](https://github.com/ivagorRetrocomp/DeUpkr)
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
@@ -32,10 +38,13 @@ The 16 bit dos unpacker also uses some variations. (`upkr --x86`)
|
||||
|
||||
-l, --level N compression level 0-9
|
||||
-0, ..., -9 short form for setting compression level
|
||||
-u, --unpack unpack infile
|
||||
-d, --decompress decompress infile
|
||||
--heatmap calculate heatmap from compressed file
|
||||
--margin calculate margin for overlapped unpacking of a packed file
|
||||
|
||||
When no infile is given, or the infile is '-', read from stdin.
|
||||
When no outfile is given and reading from stdin, or when outfile is '-', write to stdout.
|
||||
|
||||
Config presets for specific unpackers:
|
||||
--z80 --big-endian-bitstream --invert-bit-encoding --simplified-prob-update -9
|
||||
--x86 --bitstream --invert-is-match-bit --invert-continue-value-bit --invert-new-offset-bit
|
||||
|
||||
@@ -26,10 +26,12 @@ upkr-linux/upkr:
|
||||
cargo build --target x86_64-unknown-linux-musl --release -F terminal
|
||||
mkdir -p upkr-linux
|
||||
cp ../target/x86_64-unknown-linux-musl/release/upkr upkr-linux/
|
||||
strip upkr-linux/upkr
|
||||
|
||||
upkr-windows/upkr.exe:
|
||||
cargo build --target x86_64-pc-windows-gnu --release -F terminal
|
||||
mkdir -p upkr-windows
|
||||
cp ../target/x86_64-pc-windows-gnu/release/upkr.exe upkr-windows/
|
||||
x86_64-w64-mingw32-strip upkr-windows/upkr.exe
|
||||
|
||||
PHONY:
|
||||
@@ -59,7 +59,7 @@ fn main() -> Result<()> {
|
||||
level = 9;
|
||||
}
|
||||
|
||||
Short('u') | Long("unpack") => unpack = true,
|
||||
Short('u') | Long("unpack") | Short('d') | Long("decompress") => unpack = true,
|
||||
Long("margin") => calculate_margin = true,
|
||||
Long("heatmap") => create_heatmap = true,
|
||||
#[cfg(feature = "crossterm")]
|
||||
@@ -68,7 +68,7 @@ fn main() -> Result<()> {
|
||||
Short(n) if n.is_ascii_digit() => level = n as u8 - b'0',
|
||||
Short('h') | Long("help") => print_help(0),
|
||||
Long("version") => {
|
||||
eprintln!("{}", env!("CARGO_PKG_VERSION"));
|
||||
println!("{}", env!("CARGO_PKG_VERSION"));
|
||||
process::exit(0);
|
||||
}
|
||||
Long("max-unpacked-size") => max_unpacked_size = parser.value()?.parse()?,
|
||||
@@ -94,7 +94,7 @@ fn main() -> Result<()> {
|
||||
|
||||
#[cfg(feature = "terminal")]
|
||||
let mut packed_data = {
|
||||
let mut pb = pbr::ProgressBar::new(data.len() as u64);
|
||||
let mut pb = pbr::ProgressBar::on(std::io::stderr(), data.len() as u64);
|
||||
pb.set_units(pbr::Units::Bytes);
|
||||
let packed_data = upkr::pack(
|
||||
&data,
|
||||
@@ -105,6 +105,7 @@ fn main() -> Result<()> {
|
||||
}),
|
||||
);
|
||||
pb.finish();
|
||||
eprintln!();
|
||||
packed_data
|
||||
};
|
||||
#[cfg(not(feature = "terminal"))]
|
||||
@@ -246,7 +247,7 @@ fn print_help(exit_code: i32) -> ! {
|
||||
eprintln!();
|
||||
eprintln!(" -l, --level N compression level 0-9");
|
||||
eprintln!(" -0, ..., -9 short form for setting compression level");
|
||||
eprintln!(" -u, --unpack unpack infile");
|
||||
eprintln!(" -d, --decompress decompress infile");
|
||||
eprintln!(" --heatmap calculate heatmap from compressed file");
|
||||
eprintln!(" --margin calculate margin for overlapped unpacking of a packed file");
|
||||
eprintln!();
|
||||
|
||||
Reference in New Issue
Block a user