小弟不才猜不出是什么压缩算法,但是这压缩后还是能看到原始数据,以为很简单,就是没试出来
压缩后的数据:
[JavaScript] 纯文本查看 复制代码 000008dd696e7374c0643d33363533363300320a6d6574686f643d717566756e646300616c630a6d61726b65743d31370a72650074747970653d320a00a30800007b226400617461223a5b7b2231373a36303337307437223a5b223a00313733323233393336362c223132223a00322c223133223a34393530302e30303002302c223139223a3730373835302ee030323002223a313437333231392c22323122023a3532313034377d2c7b22f031373850302c2231322d32f02c2232373430fd302e0b3338393930322e30303832300a323431323834332c223231403230373537387dfc2c7b0e34313838372c2231be322c0736333130302ee8383937395d31332e303083353233323337312c2232a1353434383935377d7b2c87323630362c228a312c2231330f38303030302ed0313134383539bc302e300b363131383638392c2203323835333530327d2c7bf7f6e82d35357e3730302e873739393835322e30e7f801363034363f3535337d2c7bc70033352c2231321f322c0332333230302ef433332e323435362e3030fa2b313832382c2232833134343538327d2cff012c372c22f8312cc734313030f61734353931362e30d836335437322c223234381f37303032317d2c7bc73730362cc3322ce033377e3730302e873533393131302e30f03738393474372c223236322f32343733387d2ca13238312c22bf8f32313030f10031353134362e783017353939393832372c22013330313236317d2cfc5f353538372ce30036303030fb0f31343830302e9f05383333373835332c22a8382f383030357d2c7b45363136392c2231ee2e303030302e5c31391f3432383130304e3230703434cf37332c2260373639343131fd7d2c0a35313732302c2231321a2d312c22833332383630302ef830353e3534382e3030c2393230313736382cd0223938323f3335307d2c7b3f9f322c0334363830302ef436362f333632342e3030cb1e3832352c225d311f37363030c13339323139362e30f9833435343837372c22d833363f373230387d2c798737382c2231321f322c113331307530a8391f3535363339332e309835323d303838322c22b85f313330387d8700323137332c2231321f2d322334303930302ef70738313138392e3030e0383732383931332c223231b0323430357e397d2c7be13634342c2231db329137303030302efa3e3939303530309c3230073337333439342c2232310131303438343832337d2cfb87333432392c229f2d3145323330302ee8333133377e34322e300531313039383633382cc6c13335343334347d2c7b7b893934312c22fa3f34393730302e433639393237392e30f3823734353137385b2c326139353638377d7b2c85343239302c22317f57383030d03339355d31352e3030e8344b343433352c3205323130333538337d2cf61d3533332c22317c322c2f323231c703303530352e30ee3133343635392c2232f1c1373630377d2cfc3f363133362c22b134343030fe002f33393136302e3030333831345b3034322c2260373637333333fe7d2c15373239322c2231bb2d3f35383030c50035363034302e30e8343935395c3730352c227038327f3030327d6c3a3739352c2231f8312c2f3330363030853432303735302ef0353639343d3235302c2232c138393134357d7b2c8b383138372c872d32d134393030fce236313234f72e06363235383238312cb6326230343730317dfb2c0e3534382c2231fe17303030302ea2353530343030e72e5330803836363534352c22ee3231003536323733377d5d7d5d7dfd
观察到的数据如下
反汇编这部分伪代码:[JavaScript] 纯文本查看 复制代码 #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h> // 引入stdint.h以便使用int64_t
#include <immintrin.h> // 引入 SSE 指令支持
// 修复后的 decompress 函数
int64_t decompress(char *a1, int64_t a2, unsigned uint8_t **a3) {
unsigned int v4;
uint8_t *v5, *v6, *v7, *v8, *v9, *v11, *v12, *v13, *v14, *v15, *v16, *v17;
uint8_t *v40, *v41;
uint64_t *v42;
__m128i v43; // xmm0
int64_t i, v18, v19;
int v20, v21, v22, v23, v24, v25;
// 读取解压数据的头部信息
v4 = (((*a1 << 16) | ((unsigned uint8_t)a1[1] << 8) | (unsigned uint8_t)a1[2]) << 8) | (unsigned uint8_t)a1[3];
// 分配内存
v5 = (uint8_t *)malloc(v4 + 8);
if (!v5) return 0LL;
v6 = v5;
v41 = (uint8_t *)malloc((unsigned int)a2);
if (!v41) return 0LL;
v7 = malloc(0x80000uLL); // 分配内存
if (!v7) return 0LL;
v8 = v7;
v40 = v6;
// 初始化内存和数据
v43 = _mm_shuffle_epi32((__m128i)(uint64_t)v6, 68);
for (i = 0LL; i != 0x10000; i += 2LL)
*(__m128i *)&v8 = v43;
// 拷贝输入数据
memcpy(v41, a1 + 4, a2 - 4);
*v6 = *v41;
v6[1] = v41[1];
v6[2] = v41[2];
v6[3] = v41[3];
// 如果数据量大于4字节,开始解压
if (v4 >= 5uLL) {
v11 = &v6[v4];
v40 = &v41[(unsigned int)a2];
v20 = v41[4];
v13 = (char *)(v41 + 5);
v14 = v6 + 4;
v15 = 8;
while (v14 < v11) {
// 确定当前字节的处理方式
if (--v15) {
v21 = 2 * v20;
} else {
v21 = (unsigned uint8_t)*v13++;
v15 = 8;
}
// 处理条件
if ((v20 & 0x80u) != 0) {
v18 = v15 - 1;
if (v18) {
v22 = 2 * v21;
} else {
v22 = (unsigned uint8_t)*v13++;
v18 = 8;
}
// 执行数据解压和内存操作
if ((v21 & 0x80u) == 0) {
v8[*(v14 - 1) ^ ((unsigned uint64_t)*(v14 - 2) << 7) ^ (unsigned uint16_t)(*(v14 - 3) << 11)] = v14;
v20 = *v13++;
*v14++ = v20;
}
v19 = *(v14 - 1) ^ ((unsigned uint64_t)*(v14 - 2) << 7) ^ (unsigned uint16_t)(*(v14 - 3) << 11);
v16 = (uint8_t *)v8[v19];
v8[v19] = v14;
*v14 = *v16;
if (--v18) {
v21 = 2 * v22;
} else {
v21 = (unsigned uint8_t)*v13++;
v18 = 8;
}
if ((v22 & 0x80u) == 0) {
++v14;
} else {
v14[1] = v16[1];
v23 = v18 - 1;
if (v23) {
v24 = 2 * v21;
} else {
v24 = (unsigned uint8_t)*v13++;
v23 = 8;
}
if ((v21 & 0x80u) != 0) {
v14[2] = v16[2];
v14[3] = v16[3];
v18 = v23 - 1;
if (v18) {
v25 = 2 * v24;
} else {
v25 = (unsigned uint8_t)*v13++;
v18 = 8;
}
if ((v24 & 0x80u) != 0) {
v14[4] = v16[4];
v14[5] = v16[5];
v14[6] = v16[6];
v14[7] = v16[7];
v14[8] = v16[8];
v15 = v25 - 1;
if (v15) {
v21 = 2 * v25;
} else {
v21 = (unsigned uint8_t)*v13++;
v15 = 8;
}
v25 = 2 * v21;
v14 += 12;
}
} else {
v14 += 4;
}
}
}
}
}
*a3 = v40;
free(v8);
free(v41);
return v4;
}
求大佬看看可能是什么压缩算法 |