Skip to content

Commit fdafcea

Browse files
authored
Bytekiller & Clones (ANC, JEK), JAMPacker
1 parent f25eb99 commit fdafcea

37 files changed

+2072
-66
lines changed

Ancient.vcxproj

+4
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@
203203
<ClCompile Include="src\API.cpp" />
204204
<ClCompile Include="src\ARTMDecompressor.cpp" />
205205
<ClCompile Include="src\BLZWDecompressor.cpp" />
206+
<ClCompile Include="src\ByteKillerDecompressor.cpp" />
206207
<ClCompile Include="src\BZIP2Decompressor.cpp" />
207208
<ClCompile Include="src\CBR0Decompressor.cpp" />
208209
<ClCompile Include="src\common\Buffer.cpp" />
@@ -231,6 +232,7 @@
231232
<ClCompile Include="src\ILZRDecompressor.cpp" />
232233
<ClCompile Include="src\IMPDecompressor.cpp" />
233234
<ClCompile Include="src\InputStream.cpp" />
235+
<ClCompile Include="src\JAMPackerDecompressor.cpp" />
234236
<ClCompile Include="src\LHDecompressor.cpp" />
235237
<ClCompile Include="src\LIN1Decompressor.cpp" />
236238
<ClCompile Include="src\LIN2Decompressor.cpp" />
@@ -277,6 +279,7 @@
277279
<ClInclude Include="src\ACCADecompressor.hpp" />
278280
<ClInclude Include="src\ARTMDecompressor.hpp" />
279281
<ClInclude Include="src\BLZWDecompressor.hpp" />
282+
<ClInclude Include="src\ByteKillerDecompressor.hpp" />
280283
<ClInclude Include="src\BZIP2Decompressor.hpp" />
281284
<ClInclude Include="src\BZIP2Table.hpp" />
282285
<ClInclude Include="src\CBR0Decompressor.hpp" />
@@ -310,6 +313,7 @@
310313
<ClInclude Include="src\ILZRDecompressor.hpp" />
311314
<ClInclude Include="src\IMPDecompressor.hpp" />
312315
<ClInclude Include="src\InputStream.hpp" />
316+
<ClInclude Include="src\JAMPackerDecompressor.hpp" />
313317
<ClInclude Include="src\LHDecompressor.hpp" />
314318
<ClInclude Include="src\LIN1Decompressor.hpp" />
315319
<ClInclude Include="src\LIN2Decompressor.hpp" />

Makefile.am

+4
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ LIBANCIENT_FILES_SRC += src/ARTMDecompressor.cpp
4040
LIBANCIENT_FILES_SRC += src/ARTMDecompressor.hpp
4141
LIBANCIENT_FILES_SRC += src/BLZWDecompressor.cpp
4242
LIBANCIENT_FILES_SRC += src/BLZWDecompressor.hpp
43+
LIBANCIENT_FILES_SRC += src/ByteKillerDecompressor.cpp
44+
LIBANCIENT_FILES_SRC += src/ByteKillerDecompressor.hpp
4345
LIBANCIENT_FILES_SRC += src/BZIP2Decompressor.cpp
4446
LIBANCIENT_FILES_SRC += src/BZIP2Decompressor.hpp
4547
LIBANCIENT_FILES_SRC += src/BZIP2Table.hpp
@@ -84,6 +86,8 @@ LIBANCIENT_FILES_SRC += src/IMPDecompressor.cpp
8486
LIBANCIENT_FILES_SRC += src/IMPDecompressor.hpp
8587
LIBANCIENT_FILES_SRC += src/InputStream.cpp
8688
LIBANCIENT_FILES_SRC += src/InputStream.hpp
89+
LIBANCIENT_FILES_SRC += src/JAMPackerDecompressor.cpp
90+
LIBANCIENT_FILES_SRC += src/JAMPackerDecompressor.hpp
8791
LIBANCIENT_FILES_SRC += src/LHDecompressor.cpp
8892
LIBANCIENT_FILES_SRC += src/LHDecompressor.hpp
8993
LIBANCIENT_FILES_SRC += src/LIN1Decompressor.cpp

Makefile.unix

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ MAIN_N ?= main.o
1313
OBJS_N = API.o Buffer.o Common.o MemoryBuffer.o StaticBuffer.o SubBuffer.o WrappedVectorBuffer.o CRC16.o CRC32.o \
1414
Decompressor.o LZWDecoder.o XPKDecompressor.o XPKMain.o \
1515
OutputStream.o InputStream.o RangeDecoder.o \
16-
ACCADecompressor.o ARTMDecompressor.o BLZWDecompressor.o BZIP2Decompressor.o \
16+
ACCADecompressor.o ARTMDecompressor.o BLZWDecompressor.o ByteKillerDecompressor.o BZIP2Decompressor.o \
1717
CBR0Decompressor.o CompactDecompressor.o CompressDecompressor.o CRMDecompressor.o \
1818
CYB2Decoder.o DEFLATEDecompressor.o DLTADecode.o DMSDecompressor.o \
1919
FASTDecompressor.o FBR2Decompressor.o FreezeDecompressor.o FRLEDecompressor.o \
2020
HFMNDecompressor.o HUFFDecompressor.o IceDecompressor.o ILZRDecompressor.o \
21-
IMPDecompressor.o LHDecompressor.o LIN1Decompressor.o LIN2Decompressor.o \
21+
IMPDecompressor.o JAMPackerDecompressor.o LHDecompressor.o LIN1Decompressor.o LIN2Decompressor.o \
2222
LOBDecompressor.o LZBSDecompressor.o LZCBDecompressor.o LZW2Decompressor.o \
2323
LZW4Decompressor.o LZW5Decompressor.o LZXDecompressor.o MASHDecompressor.o \
2424
MMCMPDecompressor.o NONEDecompressor.o NUKEDecompressor.o PackDecompressor.o \

README.md

+18
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ Some formats have incorporated weak password protection on them which can be byp
1616
Currently the project does not support any archival files nor self extracting executables.
1717

1818
Decompression algorithms provided:
19+
* ANC Cruncher (ByteKiller Clone)
20+
* Bytekiller
21+
* BK: ByteKiller (all versions)
22+
* BK: ByteKiller Pro
23+
* ID ACE! (ByteKiller Clone)
24+
* ID GR20 (ByteKiller Clone)
25+
* ID MD10 (ByteKiller Clone)
26+
* ID MD11 (ByteKiller Clone)
1927
* bzip2
2028
* both normal and randomized bitstreams
2129
* Compact (Unix)
@@ -48,6 +56,14 @@ Decompression algorithms provided:
4856
* Freeze/Melt
4957
* Supports both old and new formats
5058
* gzip
59+
* JAM Packer
60+
* JEK: JAM Packer v1.x (ByteKiller Clone)
61+
* Supports JAMPacker ICE algorithm (handled by Pack-Ice)
62+
* LSD: JAMPacker V2 v2.x+
63+
* LZW: JAMPacker LZH v3.0 / v4.0
64+
* LZH: JAMPacker LZW v4.0
65+
* JEK Packer
66+
* JEK: Jek Packer v1.x - v2.x (ByteKiller Clone)
5167
* LOB's File Compressor (Also known as a Multipak)
5268
* Supports all original 6 modes and their combinations (BMC, HUF, LZW, LZB, MSP, MSS)
5369
* Does not support mode 8 (as defined by some game files)
@@ -174,6 +190,8 @@ There is some support for archival decompressors: However, these are not built i
174190

175191
Special thanks go to Cholok for providing me references to many of the XPK-compressors.
176192

193+
Thanks to nocash for ByteKiller format and variants reverse engineering
194+
177195
BZIP2 tables for randomization have been included, they have BZIP2-license.
178196

179197
SASC/SHSC decompressors have been re-implemented by using the original HA code from Harri Hirvola as reference. (No code re-used)

main.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ std::unique_ptr<std::vector<uint8_t>> readFile(const std::string &fileName)
4343
if (!success)
4444
{
4545
fprintf(stderr,"Could not read file %s\n",fileName.c_str());
46-
return std::make_unique<std::vector<uint8_t>>();
46+
return std::unique_ptr<std::vector<uint8_t>>{};
4747
}
4848
return ret;
4949
}
@@ -107,6 +107,7 @@ int main(int argc,char **argv)
107107
for (int i=2;i<argc;i++)
108108
{
109109
auto packed{readFile(argv[i])};
110+
if (!packed) return -1;
110111
std::optional<ancient::Decompressor> decompressor;
111112
try
112113
{
@@ -128,6 +129,7 @@ int main(int argc,char **argv)
128129
return -1;
129130
}
130131
auto packed{readFile(argv[2])};
132+
if (!packed) return -1;
131133
std::optional<ancient::Decompressor> decompressor;
132134
try
133135
{
@@ -178,6 +180,7 @@ int main(int argc,char **argv)
178180
} else {
179181
size_t actualSize=decompressor->getImageSize()?decompressor->getImageSize().value():raw.size();
180182
auto verify{readFile(argv[3])};
183+
if (!verify) return -1;
181184
if (verify->size()!=actualSize)
182185
{
183186
fprintf(stderr,"Verify failed for %s and %s - sizes differ\n",argv[2],argv[3]);
@@ -229,6 +232,7 @@ int main(int argc,char **argv)
229232
processDir(name);
230233
} else if (st.st_mode&S_IFREG) {
231234
auto packed{readFile(name)};
235+
if (!packed) return -1;
232236
for (size_t i=0;i<packed->size();)
233237
{
234238
// We will detect first, before trying the format for real

0 commit comments

Comments
 (0)