Closed hanli2016 closed 10 months ago
Hello, thank you for clearly describing your issue.
The problem is that your bookinfo.dat
files are compressed completely differently by deflate compression algorithm even though they are very similar.
To understand this, let's use bkcrack to decipher compressed data:
$ bkcrack -C bookinfo.zip -c bookinfo.dat -d bookinfo.deflate --password 123
$ bkcrack -C bookinfo_.zip -c bookinfo.dat -d bookinfo_.deflate --password 123
Then let's have a look at how data is compressed using infgen:
$ infgen bookinfo.deflate
! infgen 3.2 output
!
last
fixed
literal '[General Information]
literal 13 10 202 233 195 251 '=
literal 177 228 198 181 181 231 212 180 '12
end
$ infgen bookinfo_.deflate
! infgen 3.2 output
!
last
stored
data '[General Information]
data 13 10 202 233 195 251 '=
data 177 228 198 181 181 231 212 180 188 188 202 245
end
We can see one file is compressed using deflate's predefined Huffman tree ("fixed" mode), but the other file is not. Instead it contains plain data after the deflate block header ("stored" mode).
What you have tried in step 2 is to recreate the beginning of the "fixed" block. It can be used successfully to crack bookinfo.zip
as you can see.
In order to crack bookinfo_.zip
, you would have to run bkcrack with a part of the "stored" block. A part of a deflate "stored" block is easy to create if you known some uncompressed data: you just have to offset the data by 5 bytes to skip the stored block header.
This is how you can do it:
plaintext.txt
which contains [General Information]
string with windows line ending.bkcrack -C bookinfo_.zip -c bookinfo.dat -p plaintext.txt -o 5
Does that solve your issue?
I have solved the problem using the ideas you provided, thank you!
English is not my native language, The following content is machine-translated。
First of all thank you for making this very useful tool. It has been working fine before, but today I encountered a problem. After many tests, I constructed the following process to reproduce the problem. 1、Given two compressed package files, bookinfo.zip and bookinfo_.zip, their passwords are both 123, and the internal bookinfo.dat has the same beginning "[General Information]" bookinfo.zip
bookinfo_.zip
2、Using the example you gave in other issues, I first obtained the compressed plaintext using the command below. (I use windows11 x64 system)
3、Use the following command to decrypt the compressed package,bookinfo.zip and bookinfo_.zip。
4、Just like the decryption result shown above, I cannot decrypt bookinfo_.zip. The difference between the two zip files is that the second line of the bookinfo.dat file is different.After my test ,I Found the reason why it cannot be decrypted is that they contain inconsistent numbers of Chinese characters.
What's causing this? Can you help me?"