Commit graph

62 commits

Author SHA1 Message Date
echo-devim
f4f0d8a0c2
Merge pull request #4 from xtexChooser/patch-1
Update README.md
2024-03-20 16:57:05 +01:00
489ba1c627
Update README.md 2024-02-04 22:27:52 +08:00
echo-devim
149ccbd1a2
Merge pull request #3 from zoujunhua/master
Adapt the extract img file name with multiple same file types
2023-10-31 14:27:43 +01:00
zoujunhua
1e26df9704 Adapt the extract img file name with multiple same file types
There are multiple same file types with name 'SUPER' appears in the latest 'UPDATE.APP' file,
which is from the HM4 OS. There may be multiple other same file types in the future.
So add the extract img file name with the index of the file block can avoid the issue.

Signed-off-by: zoujunhua <zoujunhua86@gmail.com>
2023-10-10 14:33:57 +08:00
echo-devim
f9cdc99563
Merge pull request #2 from rogarb/v2.0
V2.0
2022-09-15 10:18:38 +02:00
Romain Garbage
30866f8283
Update README.md 2022-09-09 00:13:23 +02:00
Romain Garbage
82cc5e0100
Remove num_cpus dep and bump to version 0.2.0
The crate num_cpus is not needed anymore as the multithreaded part
spawns as many threads as needed: since the execution bottleneck is the
extraction of the data to the disk, the calculation of the checksums in
the threads for the currently extracted images will be finished all the
images are extracted.
2022-09-09 00:07:26 +02:00
Romain Garbage
cd3e75b5f1
Code cleanup 2022-09-09 00:06:02 +02:00
Romain Garbage
773e2c2fc5
Fix ImgHeader definition
Remove blank field 2 and read 4 bytes for blocksize instead of 2.
2022-09-09 00:00:59 +02:00
Romain Garbage
a85593f273
Fix CSV export for headers 2022-09-08 23:53:55 +02:00
Romain Garbage
81922a39ae
Redefine ImgHeader
According to analysis of an UPDATE.APP for P20 Lite, the filename is
coded in more than 16 bytes, using the bytes of the next "Blank1" field,
which is not blank anymore. I suggest that the filename is coded with 32
bytes.
2022-09-08 23:53:33 +02:00
Romain Garbage
dce9fd678f
Add code comment in main.rs 2022-09-08 23:42:54 +02:00
Romain Garbage
39b6dd1025
Modify remove_null_bytes() to work with slices 2022-09-08 23:41:38 +02:00
Romain Garbage
de472ff4bf
Implement header extraction 2022-09-08 23:04:15 +02:00
Romain Garbage
b9cc2444c7
Remove useless column in list command result 2022-09-08 19:07:29 +02:00
Romain Garbage
514302d88e
Set default value for padding field in Img 2022-09-08 19:06:47 +02:00
Romain Garbage
70b18ae980
Fix padding size calculation 2022-09-08 18:57:25 +02:00
Romain Garbage
9417dc7992
Remove compilation warnings 2022-09-08 18:36:16 +02:00
Romain Garbage
83519d184f
Implement multithreaded checksum calculation 2022-09-08 17:56:31 +02:00
Romain Garbage
02dfb490ed
Add CLI option for multithreaded checksumming
While the extraction wouldn't benefit from multithreading, checksum
calculation would definitely benefit from it.
2022-09-08 13:19:08 +02:00
Romain Garbage
d0f705c691
Print long help on argument error 2022-09-08 01:23:56 +02:00
Romain Garbage
10fae2c31a
Add switch for input file on CLI 2022-09-08 01:23:19 +02:00
Romain Garbage
2557aa2e33
Refactor CLI by adding commands 2022-09-08 01:10:54 +02:00
Romain Garbage
4ed3331eac
Optionally disable checksum verification in Input 2022-09-08 01:09:24 +02:00
Romain Garbage
58c1e18eb8
Add Readme 2022-09-07 15:25:02 +02:00
Romain Garbage
2241372bd8
Add checksum verification when extracting imgs 2022-09-07 14:50:12 +02:00
Romain Garbage
23f1d4cc52
Add file checksum related const and method 2022-09-07 14:49:27 +02:00
Romain Garbage
ac7b62c29d
Update crc module to use BufReader<File> 2022-09-07 14:48:22 +02:00
Romain Garbage
78cddbb92c
Print usage on error 2022-09-07 11:00:24 +02:00
Romain Garbage
be01f03ff6
Display information message 2022-09-07 10:59:48 +02:00
Romain Garbage
c59b8de2e7
Remove binary blob huextract.bin from repo 2022-09-07 00:40:29 +02:00
Romain Garbage
b80a660e8d
Cleanup src/main.rs 2022-09-07 00:38:12 +02:00
Romain Garbage
e149478fd4
Add crc module
This module allows checksumming img files packed in the firmware.
2022-09-07 00:37:05 +02:00
Romain Garbage
f1a4b9ba69
Add extraction options in the CLI 2022-09-05 15:55:07 +02:00
Romain Garbage
45e23b58bc
Implement image extraction functions in Input 2022-09-05 15:54:29 +02:00
Romain Garbage
e49625c399
Remove ImgHeader::paddingsize() stub
Padding is not part of the header information and is calculated when
parsing input.
2022-09-05 11:01:07 +02:00
Romain Garbage
1540495dac
Display padding when printing Input 2022-09-05 10:58:50 +02:00
Romain Garbage
a0a10d8d80
Add padding calculation in Input 2022-09-05 10:57:29 +02:00
Romain Garbage
00eb378942
Extend Img struct to store padding information 2022-09-05 10:39:33 +02:00
Romain Garbage
b6e099f5af
Write output to STDOUT instead of STDERR 2022-09-04 23:05:04 +02:00
Romain Garbage
34a6d6a505
Implement exclusive options for CLI 2022-09-04 23:04:39 +02:00
Romain Garbage
dd7dc64273
Add CLI option for CSV format output 2022-09-04 23:02:45 +02:00
Romain Garbage
43a11801b3
Add Input::export_csv() method
This method exports the content of the header table in CSV format.
2022-09-04 23:00:26 +02:00
Romain Garbage
ba294c0900
Update Display implementation for ArrayValue
This allows a better formatting in the table output.
2022-09-04 20:33:20 +02:00
Romain Garbage
b7a0016b9d
Add full header display option in extractor mod
While here, remove debugging code.
2022-09-04 20:31:58 +02:00
Romain Garbage
508aadfd82
Remove debugging code in input module 2022-09-04 20:29:35 +02:00
Romain Garbage
7fb37d01e2
Add Input::full_table()
Allows to display a full formatted dump of the headers contained in the
input file.
2022-09-04 20:15:00 +02:00
Romain Garbage
36dde9f332
Implement Display for ImgHeader 2022-09-04 20:08:07 +02:00
Romain Garbage
9d93690f2c
Update tabled to version 0.8.0 2022-09-04 20:04:42 +02:00
Romain Garbage
aecbd9c6b4
Reimplement Display for ImgHeader
The new implementation uses tabled for pretty table formatting.
2022-09-03 01:06:07 +02:00