7z-iterator 1.3.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.d.cts +3 -1
- package/dist/cjs/index.d.ts +3 -1
- package/dist/cjs/index.js +7 -28
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/nextEntry.js +1 -2
- package/dist/cjs/nextEntry.js.map +1 -1
- package/dist/cjs/sevenz/codecs/index.js +52 -30
- package/dist/cjs/sevenz/codecs/index.js.map +1 -1
- package/dist/esm/index.d.ts +3 -1
- package/dist/esm/index.js +4 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/nextEntry.js +1 -2
- package/dist/esm/nextEntry.js.map +1 -1
- package/dist/esm/sevenz/codecs/index.js +32 -10
- package/dist/esm/sevenz/codecs/index.js.map +1 -1
- package/package.json +10 -4
- package/dist/cjs/lzma/Lzma2ChunkParser.d.cts +0 -73
- package/dist/cjs/lzma/Lzma2ChunkParser.d.ts +0 -73
- package/dist/cjs/lzma/Lzma2ChunkParser.js +0 -148
- package/dist/cjs/lzma/Lzma2ChunkParser.js.map +0 -1
- package/dist/cjs/lzma/index.d.cts +0 -13
- package/dist/cjs/lzma/index.d.ts +0 -13
- package/dist/cjs/lzma/index.js +0 -63
- package/dist/cjs/lzma/index.js.map +0 -1
- package/dist/cjs/lzma/stream/transforms.d.cts +0 -38
- package/dist/cjs/lzma/stream/transforms.d.ts +0 -38
- package/dist/cjs/lzma/stream/transforms.js +0 -149
- package/dist/cjs/lzma/stream/transforms.js.map +0 -1
- package/dist/cjs/lzma/sync/Lzma2Decoder.d.cts +0 -30
- package/dist/cjs/lzma/sync/Lzma2Decoder.d.ts +0 -30
- package/dist/cjs/lzma/sync/Lzma2Decoder.js +0 -135
- package/dist/cjs/lzma/sync/Lzma2Decoder.js.map +0 -1
- package/dist/cjs/lzma/sync/LzmaDecoder.d.cts +0 -82
- package/dist/cjs/lzma/sync/LzmaDecoder.d.ts +0 -82
- package/dist/cjs/lzma/sync/LzmaDecoder.js +0 -440
- package/dist/cjs/lzma/sync/LzmaDecoder.js.map +0 -1
- package/dist/cjs/lzma/sync/RangeDecoder.d.cts +0 -69
- package/dist/cjs/lzma/sync/RangeDecoder.d.ts +0 -69
- package/dist/cjs/lzma/sync/RangeDecoder.js +0 -162
- package/dist/cjs/lzma/sync/RangeDecoder.js.map +0 -1
- package/dist/cjs/lzma/types.d.cts +0 -110
- package/dist/cjs/lzma/types.d.ts +0 -110
- package/dist/cjs/lzma/types.js +0 -264
- package/dist/cjs/lzma/types.js.map +0 -1
- package/dist/cjs/sevenz/codecs/Bcj.d.cts +0 -16
- package/dist/cjs/sevenz/codecs/Bcj.d.ts +0 -16
- package/dist/cjs/sevenz/codecs/Bcj.js +0 -183
- package/dist/cjs/sevenz/codecs/Bcj.js.map +0 -1
- package/dist/cjs/sevenz/codecs/BcjArm.d.cts +0 -21
- package/dist/cjs/sevenz/codecs/BcjArm.d.ts +0 -21
- package/dist/cjs/sevenz/codecs/BcjArm.js +0 -104
- package/dist/cjs/sevenz/codecs/BcjArm.js.map +0 -1
- package/dist/cjs/sevenz/codecs/BcjArm64.d.cts +0 -21
- package/dist/cjs/sevenz/codecs/BcjArm64.d.ts +0 -21
- package/dist/cjs/sevenz/codecs/BcjArm64.js +0 -65
- package/dist/cjs/sevenz/codecs/BcjArm64.js.map +0 -1
- package/dist/cjs/sevenz/codecs/BcjArmt.d.cts +0 -19
- package/dist/cjs/sevenz/codecs/BcjArmt.d.ts +0 -19
- package/dist/cjs/sevenz/codecs/BcjArmt.js +0 -76
- package/dist/cjs/sevenz/codecs/BcjArmt.js.map +0 -1
- package/dist/cjs/sevenz/codecs/BcjIa64.d.cts +0 -15
- package/dist/cjs/sevenz/codecs/BcjIa64.d.ts +0 -15
- package/dist/cjs/sevenz/codecs/BcjIa64.js +0 -141
- package/dist/cjs/sevenz/codecs/BcjIa64.js.map +0 -1
- package/dist/cjs/sevenz/codecs/BcjPpc.d.cts +0 -20
- package/dist/cjs/sevenz/codecs/BcjPpc.d.ts +0 -20
- package/dist/cjs/sevenz/codecs/BcjPpc.js +0 -64
- package/dist/cjs/sevenz/codecs/BcjPpc.js.map +0 -1
- package/dist/cjs/sevenz/codecs/BcjSparc.d.cts +0 -19
- package/dist/cjs/sevenz/codecs/BcjSparc.d.ts +0 -19
- package/dist/cjs/sevenz/codecs/BcjSparc.js +0 -69
- package/dist/cjs/sevenz/codecs/BcjSparc.js.map +0 -1
- package/dist/cjs/sevenz/codecs/Delta.d.cts +0 -16
- package/dist/cjs/sevenz/codecs/Delta.d.ts +0 -16
- package/dist/cjs/sevenz/codecs/Delta.js +0 -74
- package/dist/cjs/sevenz/codecs/Delta.js.map +0 -1
- package/dist/cjs/sevenz/codecs/Lzma.d.cts +0 -17
- package/dist/cjs/sevenz/codecs/Lzma.d.ts +0 -17
- package/dist/cjs/sevenz/codecs/Lzma.js +0 -40
- package/dist/cjs/sevenz/codecs/Lzma.js.map +0 -1
- package/dist/cjs/sevenz/codecs/Lzma2.d.cts +0 -20
- package/dist/cjs/sevenz/codecs/Lzma2.d.ts +0 -20
- package/dist/cjs/sevenz/codecs/Lzma2.js +0 -42
- package/dist/cjs/sevenz/codecs/Lzma2.js.map +0 -1
- package/dist/esm/lzma/Lzma2ChunkParser.d.ts +0 -73
- package/dist/esm/lzma/Lzma2ChunkParser.js +0 -137
- package/dist/esm/lzma/Lzma2ChunkParser.js.map +0 -1
- package/dist/esm/lzma/index.d.ts +0 -13
- package/dist/esm/lzma/index.js +0 -15
- package/dist/esm/lzma/index.js.map +0 -1
- package/dist/esm/lzma/stream/transforms.d.ts +0 -38
- package/dist/esm/lzma/stream/transforms.js +0 -150
- package/dist/esm/lzma/stream/transforms.js.map +0 -1
- package/dist/esm/lzma/sync/Lzma2Decoder.d.ts +0 -30
- package/dist/esm/lzma/sync/Lzma2Decoder.js +0 -115
- package/dist/esm/lzma/sync/Lzma2Decoder.js.map +0 -1
- package/dist/esm/lzma/sync/LzmaDecoder.d.ts +0 -82
- package/dist/esm/lzma/sync/LzmaDecoder.js +0 -403
- package/dist/esm/lzma/sync/LzmaDecoder.js.map +0 -1
- package/dist/esm/lzma/sync/RangeDecoder.d.ts +0 -69
- package/dist/esm/lzma/sync/RangeDecoder.js +0 -132
- package/dist/esm/lzma/sync/RangeDecoder.js.map +0 -1
- package/dist/esm/lzma/types.d.ts +0 -110
- package/dist/esm/lzma/types.js +0 -154
- package/dist/esm/lzma/types.js.map +0 -1
- package/dist/esm/sevenz/codecs/Bcj.d.ts +0 -16
- package/dist/esm/sevenz/codecs/Bcj.js +0 -175
- package/dist/esm/sevenz/codecs/Bcj.js.map +0 -1
- package/dist/esm/sevenz/codecs/BcjArm.d.ts +0 -21
- package/dist/esm/sevenz/codecs/BcjArm.js +0 -101
- package/dist/esm/sevenz/codecs/BcjArm.js.map +0 -1
- package/dist/esm/sevenz/codecs/BcjArm64.d.ts +0 -21
- package/dist/esm/sevenz/codecs/BcjArm64.js +0 -57
- package/dist/esm/sevenz/codecs/BcjArm64.js.map +0 -1
- package/dist/esm/sevenz/codecs/BcjArmt.d.ts +0 -19
- package/dist/esm/sevenz/codecs/BcjArmt.js +0 -66
- package/dist/esm/sevenz/codecs/BcjArmt.js.map +0 -1
- package/dist/esm/sevenz/codecs/BcjIa64.d.ts +0 -15
- package/dist/esm/sevenz/codecs/BcjIa64.js +0 -127
- package/dist/esm/sevenz/codecs/BcjIa64.js.map +0 -1
- package/dist/esm/sevenz/codecs/BcjPpc.d.ts +0 -20
- package/dist/esm/sevenz/codecs/BcjPpc.js +0 -55
- package/dist/esm/sevenz/codecs/BcjPpc.js.map +0 -1
- package/dist/esm/sevenz/codecs/BcjSparc.d.ts +0 -19
- package/dist/esm/sevenz/codecs/BcjSparc.js +0 -59
- package/dist/esm/sevenz/codecs/BcjSparc.js.map +0 -1
- package/dist/esm/sevenz/codecs/Delta.d.ts +0 -16
- package/dist/esm/sevenz/codecs/Delta.js +0 -66
- package/dist/esm/sevenz/codecs/Delta.js.map +0 -1
- package/dist/esm/sevenz/codecs/Lzma.d.ts +0 -17
- package/dist/esm/sevenz/codecs/Lzma.js +0 -33
- package/dist/esm/sevenz/codecs/Lzma.js.map +0 -1
- package/dist/esm/sevenz/codecs/Lzma2.d.ts +0 -20
- package/dist/esm/sevenz/codecs/Lzma2.js +0 -38
- package/dist/esm/sevenz/codecs/Lzma2.js.map +0 -1
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
// BCJ (x86) filter codec - converts x86 CALL/JMP relative addresses
|
|
2
|
-
// This is a simple filter that makes executables more compressible by LZMA
|
|
3
|
-
//
|
|
4
|
-
// BCJ transforms relative addresses in x86 CALL (0xE8) and JMP (0xE9) instructions
|
|
5
|
-
// to absolute addresses, which creates more repetitive patterns for compression.
|
|
6
|
-
//
|
|
7
|
-
// Reference: https://github.com/jljusten/LZMA-SDK/blob/master/C/Bra86.c
|
|
8
|
-
//
|
|
9
|
-
// This implementation uses true streaming - processes data chunk by chunk
|
|
10
|
-
// while buffering incomplete instructions across chunk boundaries.
|
|
11
|
-
import { allocBuffer, bufferFrom, Transform } from 'extract-base-iterator';
|
|
12
|
-
/**
|
|
13
|
-
* Decode BCJ (x86) filtered data (synchronous, for buffered use)
|
|
14
|
-
* Reverses the BCJ transformation by converting absolute addresses back to relative
|
|
15
|
-
*
|
|
16
|
-
* @param input - BCJ filtered data
|
|
17
|
-
* @param _properties - Unused for BCJ
|
|
18
|
-
* @param _unpackSize - Unused for BCJ
|
|
19
|
-
* @returns Unfiltered data
|
|
20
|
-
*/ export function decodeBcj(input, _properties, _unpackSize) {
|
|
21
|
-
// BCJ filter state
|
|
22
|
-
let pos = 0;
|
|
23
|
-
let prevMask = 0;
|
|
24
|
-
const output = bufferFrom(input); // Copy since we modify in place
|
|
25
|
-
while(pos < output.length - 4){
|
|
26
|
-
const b = output[pos];
|
|
27
|
-
// Check for CALL (0xE8) or JMP (0xE9) opcode
|
|
28
|
-
if (b !== 0xe8 && b !== 0xe9) {
|
|
29
|
-
pos++;
|
|
30
|
-
prevMask = 0;
|
|
31
|
-
continue;
|
|
32
|
-
}
|
|
33
|
-
// Check mask to avoid false positives in data
|
|
34
|
-
const offset = pos + 5;
|
|
35
|
-
if (offset > output.length) {
|
|
36
|
-
break;
|
|
37
|
-
}
|
|
38
|
-
// Skip if in masked region (previous conversion affected this area)
|
|
39
|
-
if ((prevMask & 1) !== 0) {
|
|
40
|
-
prevMask = prevMask >> 1 | 4;
|
|
41
|
-
pos++;
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
// Read the 32-bit address (little-endian)
|
|
45
|
-
const addr = output[pos + 1] | output[pos + 2] << 8 | output[pos + 3] << 16 | output[pos + 4] << 24 >>> 0;
|
|
46
|
-
// Check if this looks like a converted address
|
|
47
|
-
// High byte should be 0x00 or 0xFF for typical code
|
|
48
|
-
const highByte = output[pos + 4];
|
|
49
|
-
if (highByte === 0x00 || highByte === 0xff) {
|
|
50
|
-
// Convert absolute to relative
|
|
51
|
-
let newAddr;
|
|
52
|
-
if (highByte === 0x00) {
|
|
53
|
-
// Positive offset - subtract position
|
|
54
|
-
newAddr = addr - pos;
|
|
55
|
-
} else {
|
|
56
|
-
// Negative offset (0xFF high byte)
|
|
57
|
-
newAddr = addr + pos;
|
|
58
|
-
}
|
|
59
|
-
// Write back as little-endian
|
|
60
|
-
output[pos + 1] = newAddr & 0xff;
|
|
61
|
-
output[pos + 2] = newAddr >>> 8 & 0xff;
|
|
62
|
-
output[pos + 3] = newAddr >>> 16 & 0xff;
|
|
63
|
-
output[pos + 4] = newAddr >>> 24 & 0xff;
|
|
64
|
-
pos += 5;
|
|
65
|
-
prevMask = 0;
|
|
66
|
-
} else {
|
|
67
|
-
pos++;
|
|
68
|
-
prevMask = 0;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return output;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Create a streaming BCJ decoder Transform.
|
|
75
|
-
* Processes data chunk by chunk, buffering incomplete instructions.
|
|
76
|
-
*/ export function createBcjDecoder(_properties, _unpackSize) {
|
|
77
|
-
// State that persists across chunks
|
|
78
|
-
let globalPos = 0; // Position in the overall stream
|
|
79
|
-
let prevMask = 0;
|
|
80
|
-
let pending = null; // Bytes pending from previous chunk
|
|
81
|
-
const transform = new Transform({
|
|
82
|
-
transform: (chunk, _encoding, callback)=>{
|
|
83
|
-
// Combine pending bytes with new chunk
|
|
84
|
-
let data;
|
|
85
|
-
if (pending && pending.length > 0) {
|
|
86
|
-
data = Buffer.concat([
|
|
87
|
-
pending,
|
|
88
|
-
chunk
|
|
89
|
-
]);
|
|
90
|
-
} else {
|
|
91
|
-
data = chunk;
|
|
92
|
-
}
|
|
93
|
-
// We need at least 5 bytes to process an instruction
|
|
94
|
-
// Keep the last 4 bytes as pending in case an instruction spans chunks
|
|
95
|
-
const safeEnd = data.length - 4;
|
|
96
|
-
if (safeEnd <= 0) {
|
|
97
|
-
// Not enough data yet, keep it all pending
|
|
98
|
-
pending = data;
|
|
99
|
-
callback(null, allocBuffer(0));
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
const output = bufferFrom(data.slice(0, safeEnd)); // Copy the portion we'll process
|
|
103
|
-
pending = data.slice(safeEnd); // Keep last 4 bytes for next chunk
|
|
104
|
-
let localPos = 0;
|
|
105
|
-
while(localPos < output.length){
|
|
106
|
-
const b = output[localPos];
|
|
107
|
-
// Check for CALL (0xE8) or JMP (0xE9) opcode
|
|
108
|
-
if (b !== 0xe8 && b !== 0xe9) {
|
|
109
|
-
localPos++;
|
|
110
|
-
globalPos++;
|
|
111
|
-
prevMask = 0;
|
|
112
|
-
continue;
|
|
113
|
-
}
|
|
114
|
-
// Check if we have enough bytes for the full instruction
|
|
115
|
-
if (localPos + 5 > output.length + pending.length) {
|
|
116
|
-
break;
|
|
117
|
-
}
|
|
118
|
-
// Skip if in masked region
|
|
119
|
-
if ((prevMask & 1) !== 0) {
|
|
120
|
-
prevMask = prevMask >> 1 | 4;
|
|
121
|
-
localPos++;
|
|
122
|
-
globalPos++;
|
|
123
|
-
continue;
|
|
124
|
-
}
|
|
125
|
-
// Get the 4 address bytes (might span into pending)
|
|
126
|
-
let addr;
|
|
127
|
-
let highByte;
|
|
128
|
-
if (localPos + 5 <= output.length) {
|
|
129
|
-
addr = output[localPos + 1] | output[localPos + 2] << 8 | output[localPos + 3] << 16 | output[localPos + 4] << 24 >>> 0;
|
|
130
|
-
highByte = output[localPos + 4];
|
|
131
|
-
} else {
|
|
132
|
-
// Address spans output and pending - shouldn't happen with safeEnd
|
|
133
|
-
localPos++;
|
|
134
|
-
globalPos++;
|
|
135
|
-
prevMask = 0;
|
|
136
|
-
continue;
|
|
137
|
-
}
|
|
138
|
-
if (highByte === 0x00 || highByte === 0xff) {
|
|
139
|
-
// Convert absolute to relative
|
|
140
|
-
let newAddr;
|
|
141
|
-
if (highByte === 0x00) {
|
|
142
|
-
newAddr = addr - globalPos;
|
|
143
|
-
} else {
|
|
144
|
-
newAddr = addr + globalPos;
|
|
145
|
-
}
|
|
146
|
-
// Write back as little-endian
|
|
147
|
-
output[localPos + 1] = newAddr & 0xff;
|
|
148
|
-
output[localPos + 2] = newAddr >>> 8 & 0xff;
|
|
149
|
-
output[localPos + 3] = newAddr >>> 16 & 0xff;
|
|
150
|
-
output[localPos + 4] = newAddr >>> 24 & 0xff;
|
|
151
|
-
localPos += 5;
|
|
152
|
-
globalPos += 5;
|
|
153
|
-
prevMask = 0;
|
|
154
|
-
} else {
|
|
155
|
-
localPos++;
|
|
156
|
-
globalPos++;
|
|
157
|
-
prevMask = 0;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
callback(null, output);
|
|
161
|
-
},
|
|
162
|
-
flush: function(callback) {
|
|
163
|
-
// Output any remaining pending bytes
|
|
164
|
-
if (pending && pending.length > 0) {
|
|
165
|
-
// Process the final bytes - no need to worry about spanning
|
|
166
|
-
const output = bufferFrom(pending);
|
|
167
|
-
// Don't convert anything in the final bytes since we can't know
|
|
168
|
-
// if they're complete instructions
|
|
169
|
-
this.push(output);
|
|
170
|
-
}
|
|
171
|
-
callback(null);
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
return transform;
|
|
175
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/iterators/7z-iterator/src/sevenz/codecs/Bcj.ts"],"sourcesContent":["// BCJ (x86) filter codec - converts x86 CALL/JMP relative addresses\n// This is a simple filter that makes executables more compressible by LZMA\n//\n// BCJ transforms relative addresses in x86 CALL (0xE8) and JMP (0xE9) instructions\n// to absolute addresses, which creates more repetitive patterns for compression.\n//\n// Reference: https://github.com/jljusten/LZMA-SDK/blob/master/C/Bra86.c\n//\n// This implementation uses true streaming - processes data chunk by chunk\n// while buffering incomplete instructions across chunk boundaries.\n\nimport { allocBuffer, bufferFrom, Transform } from 'extract-base-iterator';\n\n/**\n * Decode BCJ (x86) filtered data (synchronous, for buffered use)\n * Reverses the BCJ transformation by converting absolute addresses back to relative\n *\n * @param input - BCJ filtered data\n * @param _properties - Unused for BCJ\n * @param _unpackSize - Unused for BCJ\n * @returns Unfiltered data\n */\nexport function decodeBcj(input: Buffer, _properties?: Buffer, _unpackSize?: number): Buffer {\n // BCJ filter state\n let pos = 0;\n let prevMask = 0;\n const output = bufferFrom(input); // Copy since we modify in place\n\n while (pos < output.length - 4) {\n const b = output[pos];\n\n // Check for CALL (0xE8) or JMP (0xE9) opcode\n if (b !== 0xe8 && b !== 0xe9) {\n pos++;\n prevMask = 0;\n continue;\n }\n\n // Check mask to avoid false positives in data\n const offset = pos + 5;\n if (offset > output.length) {\n break;\n }\n\n // Skip if in masked region (previous conversion affected this area)\n if ((prevMask & 1) !== 0) {\n prevMask = (prevMask >> 1) | 4;\n pos++;\n continue;\n }\n\n // Read the 32-bit address (little-endian)\n const addr = output[pos + 1] | (output[pos + 2] << 8) | (output[pos + 3] << 16) | ((output[pos + 4] << 24) >>> 0);\n\n // Check if this looks like a converted address\n // High byte should be 0x00 or 0xFF for typical code\n const highByte = output[pos + 4];\n\n if (highByte === 0x00 || highByte === 0xff) {\n // Convert absolute to relative\n let newAddr: number;\n if (highByte === 0x00) {\n // Positive offset - subtract position\n newAddr = addr - pos;\n } else {\n // Negative offset (0xFF high byte)\n newAddr = addr + pos;\n }\n\n // Write back as little-endian\n output[pos + 1] = newAddr & 0xff;\n output[pos + 2] = (newAddr >>> 8) & 0xff;\n output[pos + 3] = (newAddr >>> 16) & 0xff;\n output[pos + 4] = (newAddr >>> 24) & 0xff;\n\n pos += 5;\n prevMask = 0;\n } else {\n pos++;\n prevMask = 0;\n }\n }\n\n return output;\n}\n\n/**\n * Create a streaming BCJ decoder Transform.\n * Processes data chunk by chunk, buffering incomplete instructions.\n */\nexport function createBcjDecoder(_properties?: Buffer, _unpackSize?: number): InstanceType<typeof Transform> {\n // State that persists across chunks\n let globalPos = 0; // Position in the overall stream\n let prevMask = 0;\n let pending: Buffer | null = null; // Bytes pending from previous chunk\n\n const transform = new Transform({\n transform: (chunk: Buffer, _encoding: string, callback: (err?: Error | null, data?: Buffer) => void) => {\n // Combine pending bytes with new chunk\n let data: Buffer;\n if (pending && pending.length > 0) {\n data = Buffer.concat([pending, chunk]);\n } else {\n data = chunk;\n }\n\n // We need at least 5 bytes to process an instruction\n // Keep the last 4 bytes as pending in case an instruction spans chunks\n const safeEnd = data.length - 4;\n if (safeEnd <= 0) {\n // Not enough data yet, keep it all pending\n pending = data;\n callback(null, allocBuffer(0));\n return;\n }\n\n const output = bufferFrom(data.slice(0, safeEnd)); // Copy the portion we'll process\n pending = data.slice(safeEnd); // Keep last 4 bytes for next chunk\n\n let localPos = 0;\n while (localPos < output.length) {\n const b = output[localPos];\n\n // Check for CALL (0xE8) or JMP (0xE9) opcode\n if (b !== 0xe8 && b !== 0xe9) {\n localPos++;\n globalPos++;\n prevMask = 0;\n continue;\n }\n\n // Check if we have enough bytes for the full instruction\n if (localPos + 5 > output.length + pending.length) {\n // Not enough bytes - need to wait for more data\n // This shouldn't happen with our safeEnd calculation, but be safe\n break;\n }\n\n // Skip if in masked region\n if ((prevMask & 1) !== 0) {\n prevMask = (prevMask >> 1) | 4;\n localPos++;\n globalPos++;\n continue;\n }\n\n // Get the 4 address bytes (might span into pending)\n let addr: number;\n let highByte: number;\n if (localPos + 5 <= output.length) {\n addr = output[localPos + 1] | (output[localPos + 2] << 8) | (output[localPos + 3] << 16) | ((output[localPos + 4] << 24) >>> 0);\n highByte = output[localPos + 4];\n } else {\n // Address spans output and pending - shouldn't happen with safeEnd\n localPos++;\n globalPos++;\n prevMask = 0;\n continue;\n }\n\n if (highByte === 0x00 || highByte === 0xff) {\n // Convert absolute to relative\n let newAddr: number;\n if (highByte === 0x00) {\n newAddr = addr - globalPos;\n } else {\n newAddr = addr + globalPos;\n }\n\n // Write back as little-endian\n output[localPos + 1] = newAddr & 0xff;\n output[localPos + 2] = (newAddr >>> 8) & 0xff;\n output[localPos + 3] = (newAddr >>> 16) & 0xff;\n output[localPos + 4] = (newAddr >>> 24) & 0xff;\n\n localPos += 5;\n globalPos += 5;\n prevMask = 0;\n } else {\n localPos++;\n globalPos++;\n prevMask = 0;\n }\n }\n\n callback(null, output);\n },\n flush: function (this: InstanceType<typeof Transform>, callback: (err?: Error | null) => void) {\n // Output any remaining pending bytes\n if (pending && pending.length > 0) {\n // Process the final bytes - no need to worry about spanning\n const output = bufferFrom(pending);\n // Don't convert anything in the final bytes since we can't know\n // if they're complete instructions\n this.push(output);\n }\n callback(null);\n },\n });\n\n return transform;\n}\n"],"names":["allocBuffer","bufferFrom","Transform","decodeBcj","input","_properties","_unpackSize","pos","prevMask","output","length","b","offset","addr","highByte","newAddr","createBcjDecoder","globalPos","pending","transform","chunk","_encoding","callback","data","Buffer","concat","safeEnd","slice","localPos","flush","push"],"mappings":"AAAA,oEAAoE;AACpE,2EAA2E;AAC3E,EAAE;AACF,mFAAmF;AACnF,iFAAiF;AACjF,EAAE;A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 -1,21 +0,0 @@
|
|
|
1
|
-
import { Transform } from 'extract-base-iterator';
|
|
2
|
-
/**
|
|
3
|
-
* Decode ARM BCJ filtered data (synchronous, for buffered use)
|
|
4
|
-
* Reverses the BCJ transformation by converting absolute addresses back to relative
|
|
5
|
-
*
|
|
6
|
-
* ARM BL instruction format:
|
|
7
|
-
* - 4 bytes aligned
|
|
8
|
-
* - Byte pattern: XX XX XX EB (where EB = 0xEB opcode for BL)
|
|
9
|
-
* - Lower 24 bits are signed offset (in words, not bytes)
|
|
10
|
-
*
|
|
11
|
-
* @param input - ARM BCJ filtered data
|
|
12
|
-
* @param _properties - Unused for ARM BCJ
|
|
13
|
-
* @param _unpackSize - Unused for ARM BCJ
|
|
14
|
-
* @returns Unfiltered data
|
|
15
|
-
*/
|
|
16
|
-
export declare function decodeBcjArm(input: Buffer, _properties?: Buffer, _unpackSize?: number): Buffer;
|
|
17
|
-
/**
|
|
18
|
-
* Create a streaming ARM BCJ decoder Transform.
|
|
19
|
-
* Processes data in 4-byte aligned chunks.
|
|
20
|
-
*/
|
|
21
|
-
export declare function createBcjArmDecoder(_properties?: Buffer, _unpackSize?: number): InstanceType<typeof Transform>;
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
// BCJ (ARM 32-bit) filter codec - converts ARM branch instruction addresses
|
|
2
|
-
// This filter makes ARM executables more compressible by LZMA
|
|
3
|
-
//
|
|
4
|
-
// ARM branch instructions (BL) use relative addressing. The filter converts
|
|
5
|
-
// these to absolute addresses during compression, and back during decompression.
|
|
6
|
-
//
|
|
7
|
-
// Reference: https://github.com/kornelski/7z/blob/main/C/Bra.c
|
|
8
|
-
//
|
|
9
|
-
// This implementation uses true streaming - processes data chunk by chunk.
|
|
10
|
-
import { allocBuffer, bufferFrom, Transform } from 'extract-base-iterator';
|
|
11
|
-
/**
|
|
12
|
-
* Decode ARM BCJ filtered data (synchronous, for buffered use)
|
|
13
|
-
* Reverses the BCJ transformation by converting absolute addresses back to relative
|
|
14
|
-
*
|
|
15
|
-
* ARM BL instruction format:
|
|
16
|
-
* - 4 bytes aligned
|
|
17
|
-
* - Byte pattern: XX XX XX EB (where EB = 0xEB opcode for BL)
|
|
18
|
-
* - Lower 24 bits are signed offset (in words, not bytes)
|
|
19
|
-
*
|
|
20
|
-
* @param input - ARM BCJ filtered data
|
|
21
|
-
* @param _properties - Unused for ARM BCJ
|
|
22
|
-
* @param _unpackSize - Unused for ARM BCJ
|
|
23
|
-
* @returns Unfiltered data
|
|
24
|
-
*/ export function decodeBcjArm(input, _properties, _unpackSize) {
|
|
25
|
-
const output = bufferFrom(input); // Copy since we modify in place
|
|
26
|
-
let pos = 0;
|
|
27
|
-
// Process 4-byte aligned positions
|
|
28
|
-
while(pos + 4 <= output.length){
|
|
29
|
-
// Check for BL instruction: byte 3 is 0xEB
|
|
30
|
-
if (output[pos + 3] === 0xeb) {
|
|
31
|
-
// Read 24-bit address (little-endian in bytes 0-2)
|
|
32
|
-
let addr = output[pos] | output[pos + 1] << 8 | output[pos + 2] << 16;
|
|
33
|
-
// Sign-extend 24-bit to 32-bit
|
|
34
|
-
if (addr & 0x800000) {
|
|
35
|
-
addr |= 0xff000000;
|
|
36
|
-
}
|
|
37
|
-
// Convert absolute to relative:
|
|
38
|
-
// Subtract current position (in words, so divide by 4)
|
|
39
|
-
const relAddr = addr - (pos >>> 2);
|
|
40
|
-
// Write back lower 24 bits
|
|
41
|
-
output[pos] = relAddr & 0xff;
|
|
42
|
-
output[pos + 1] = relAddr >>> 8 & 0xff;
|
|
43
|
-
output[pos + 2] = relAddr >>> 16 & 0xff;
|
|
44
|
-
}
|
|
45
|
-
pos += 4;
|
|
46
|
-
}
|
|
47
|
-
return output;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Create a streaming ARM BCJ decoder Transform.
|
|
51
|
-
* Processes data in 4-byte aligned chunks.
|
|
52
|
-
*/ export function createBcjArmDecoder(_properties, _unpackSize) {
|
|
53
|
-
let globalPos = 0; // Position in the overall stream (in bytes)
|
|
54
|
-
let pending = null; // Incomplete 4-byte group
|
|
55
|
-
const transform = new Transform({
|
|
56
|
-
transform: (chunk, _encoding, callback)=>{
|
|
57
|
-
// Combine pending bytes with new chunk
|
|
58
|
-
let data;
|
|
59
|
-
if (pending && pending.length > 0) {
|
|
60
|
-
data = Buffer.concat([
|
|
61
|
-
pending,
|
|
62
|
-
chunk
|
|
63
|
-
]);
|
|
64
|
-
} else {
|
|
65
|
-
data = chunk;
|
|
66
|
-
}
|
|
67
|
-
// Process only complete 4-byte groups
|
|
68
|
-
const completeBytes = data.length - data.length % 4;
|
|
69
|
-
if (completeBytes === 0) {
|
|
70
|
-
pending = data;
|
|
71
|
-
callback(null, allocBuffer(0));
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
const output = bufferFrom(data.slice(0, completeBytes));
|
|
75
|
-
pending = data.length > completeBytes ? data.slice(completeBytes) : null;
|
|
76
|
-
let pos = 0;
|
|
77
|
-
while(pos + 4 <= output.length){
|
|
78
|
-
if (output[pos + 3] === 0xeb) {
|
|
79
|
-
let addr = output[pos] | output[pos + 1] << 8 | output[pos + 2] << 16;
|
|
80
|
-
if (addr & 0x800000) {
|
|
81
|
-
addr |= 0xff000000;
|
|
82
|
-
}
|
|
83
|
-
const relAddr = addr - (globalPos >>> 2);
|
|
84
|
-
output[pos] = relAddr & 0xff;
|
|
85
|
-
output[pos + 1] = relAddr >>> 8 & 0xff;
|
|
86
|
-
output[pos + 2] = relAddr >>> 16 & 0xff;
|
|
87
|
-
}
|
|
88
|
-
pos += 4;
|
|
89
|
-
globalPos += 4;
|
|
90
|
-
}
|
|
91
|
-
callback(null, output);
|
|
92
|
-
},
|
|
93
|
-
flush: function(callback) {
|
|
94
|
-
if (pending && pending.length > 0) {
|
|
95
|
-
this.push(pending);
|
|
96
|
-
}
|
|
97
|
-
callback(null);
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
return transform;
|
|
101
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/iterators/7z-iterator/src/sevenz/codecs/BcjArm.ts"],"sourcesContent":["// BCJ (ARM 32-bit) filter codec - converts ARM branch instruction addresses\n// This filter makes ARM executables more compressible by LZMA\n//\n// ARM branch instructions (BL) use relative addressing. The filter converts\n// these to absolute addresses during compression, and back during decompression.\n//\n// Reference: https://github.com/kornelski/7z/blob/main/C/Bra.c\n//\n// This implementation uses true streaming - processes data chunk by chunk.\n\nimport { allocBuffer, bufferFrom, Transform } from 'extract-base-iterator';\n\n/**\n * Decode ARM BCJ filtered data (synchronous, for buffered use)\n * Reverses the BCJ transformation by converting absolute addresses back to relative\n *\n * ARM BL instruction format:\n * - 4 bytes aligned\n * - Byte pattern: XX XX XX EB (where EB = 0xEB opcode for BL)\n * - Lower 24 bits are signed offset (in words, not bytes)\n *\n * @param input - ARM BCJ filtered data\n * @param _properties - Unused for ARM BCJ\n * @param _unpackSize - Unused for ARM BCJ\n * @returns Unfiltered data\n */\nexport function decodeBcjArm(input: Buffer, _properties?: Buffer, _unpackSize?: number): Buffer {\n const output = bufferFrom(input); // Copy since we modify in place\n let pos = 0;\n\n // Process 4-byte aligned positions\n while (pos + 4 <= output.length) {\n // Check for BL instruction: byte 3 is 0xEB\n if (output[pos + 3] === 0xeb) {\n // Read 24-bit address (little-endian in bytes 0-2)\n let addr = output[pos] | (output[pos + 1] << 8) | (output[pos + 2] << 16);\n\n // Sign-extend 24-bit to 32-bit\n if (addr & 0x800000) {\n addr |= 0xff000000;\n }\n\n // Convert absolute to relative:\n // Subtract current position (in words, so divide by 4)\n const relAddr = addr - (pos >>> 2);\n\n // Write back lower 24 bits\n output[pos] = relAddr & 0xff;\n output[pos + 1] = (relAddr >>> 8) & 0xff;\n output[pos + 2] = (relAddr >>> 16) & 0xff;\n }\n pos += 4;\n }\n\n return output;\n}\n\n/**\n * Create a streaming ARM BCJ decoder Transform.\n * Processes data in 4-byte aligned chunks.\n */\nexport function createBcjArmDecoder(_properties?: Buffer, _unpackSize?: number): InstanceType<typeof Transform> {\n let globalPos = 0; // Position in the overall stream (in bytes)\n let pending: Buffer | null = null; // Incomplete 4-byte group\n\n const transform = new Transform({\n transform: (chunk: Buffer, _encoding: string, callback: (err?: Error | null, data?: Buffer) => void) => {\n // Combine pending bytes with new chunk\n let data: Buffer;\n if (pending && pending.length > 0) {\n data = Buffer.concat([pending, chunk]);\n } else {\n data = chunk;\n }\n\n // Process only complete 4-byte groups\n const completeBytes = data.length - (data.length % 4);\n if (completeBytes === 0) {\n pending = data;\n callback(null, allocBuffer(0));\n return;\n }\n\n const output = bufferFrom(data.slice(0, completeBytes));\n pending = data.length > completeBytes ? data.slice(completeBytes) : null;\n\n let pos = 0;\n while (pos + 4 <= output.length) {\n if (output[pos + 3] === 0xeb) {\n let addr = output[pos] | (output[pos + 1] << 8) | (output[pos + 2] << 16);\n if (addr & 0x800000) {\n addr |= 0xff000000;\n }\n const relAddr = addr - (globalPos >>> 2);\n output[pos] = relAddr & 0xff;\n output[pos + 1] = (relAddr >>> 8) & 0xff;\n output[pos + 2] = (relAddr >>> 16) & 0xff;\n }\n pos += 4;\n globalPos += 4;\n }\n\n callback(null, output);\n },\n flush: function (this: InstanceType<typeof Transform>, callback: (err?: Error | null) => void) {\n if (pending && pending.length > 0) {\n this.push(pending);\n }\n callback(null);\n },\n });\n\n return transform;\n}\n"],"names":["allocBuffer","bufferFrom","Transform","decodeBcjArm","input","_properties","_unpackSize","output","pos","length","addr","relAddr","createBcjArmDecoder","globalPos","pending","transform","chunk","_encoding","callback","data","Buffer","concat","completeBytes","slice","flush","push"],"mappings":"AAAA,4EAA4E;AAC5E,8DAA8D;AAC9D,EAAE;AACF,4EAA4E;AAC5E,iFAAiF;AACjF,EAAE;AACF,+DAA+D;AAC/D,EAAE;AACF,2EAA2E;AAE3E,SAASA,WAAW,EAAEC,UAAU,EAAEC,SAAS,QAAQ,wBAAwB;AAE3E;;;;;;;;;;;;;CAaC,GACD,O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BAC3B;YACF;YAEA,MAAMO,SAASN,WAAWkB,KAAKI,KAAK,CAAC,GAAGD;YACxCR,UAAUK,KAAKV,MAAM,GAAGa,gBAAgBH,KAAKI,KAAK,CAACD,iBAAiB;YAEpE,IAAId,MAAM;YACV,MAAOA,MAAM,KAAKD,OAAOE,MAAM,CAAE;gBAC/B,IAAIF,MAAM,CAACC,MAAM,EAAE,KAAK,MAAM;oBAC5B,IAAIE,OAAOH,MAAM,CAACC,IAAI,GAAID,MAAM,CAACC,MAAM,EAAE,IAAI,IAAMD,MAAM,CAACC,MAAM,EAAE,IAAI;oBACtE,IAAIE,OAAO,UAAU;wBACnBA,QAAQ;oBACV;oBACA,MAAMC,UAAUD,OAAQG,CAAAA,cAAc,CAAA;oBACtCN,MAAM,CAACC,IAAI,GAAGG,UAAU;oBACxBJ,MAAM,CAACC,MAAM,EAAE,GAAG,AAACG,YAAY,IAAK;oBACpCJ,MAAM,CAACC,MAAM,EAAE,GAAG,AAACG,YAAY,KAAM;gBACvC;gBACAH,OAAO;gBACPK,aAAa;YACf;YAEAK,SAAS,MAAMX;QACjB;QACAiB,OAAO,SAAgDN,QAAsC;YAC3F,IAAIJ,WAAWA,QAAQL,MAAM,GAAG,GAAG;gBACjC,IAAI,CAACgB,IAAI,CAACX;YACZ;YACAI,SAAS;QACX;IACF;IAEA,OAAOH;AACT"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Transform } from 'stream';
|
|
2
|
-
/**
|
|
3
|
-
* Decode ARM64 BCJ filtered data
|
|
4
|
-
* Reverses the BCJ transformation by converting absolute addresses back to relative
|
|
5
|
-
*
|
|
6
|
-
* ARM64 B/BL instruction format (little-endian):
|
|
7
|
-
* - 4 bytes aligned
|
|
8
|
-
* - B: opcode 0x14 (000101xx)
|
|
9
|
-
* - BL: opcode 0x94 (100101xx)
|
|
10
|
-
* - Bits 0-25 are 26-bit signed offset (in words)
|
|
11
|
-
*
|
|
12
|
-
* @param input - ARM64 BCJ filtered data
|
|
13
|
-
* @param _properties - Unused for ARM64 BCJ
|
|
14
|
-
* @param _unpackSize - Unused for ARM64 BCJ
|
|
15
|
-
* @returns Unfiltered data
|
|
16
|
-
*/
|
|
17
|
-
export declare function decodeBcjArm64(input: Buffer, _properties?: Buffer, _unpackSize?: number): Buffer;
|
|
18
|
-
/**
|
|
19
|
-
* Create an ARM64 BCJ decoder Transform stream
|
|
20
|
-
*/
|
|
21
|
-
export declare function createBcjArm64Decoder(properties?: Buffer, unpackSize?: number): Transform;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// BCJ (ARM64/AArch64) filter codec - converts ARM64 branch instruction addresses
|
|
2
|
-
// This filter makes ARM64 executables more compressible by LZMA
|
|
3
|
-
//
|
|
4
|
-
// ARM64 uses 32-bit fixed-width instructions. Branch instructions use 26-bit signed offsets.
|
|
5
|
-
//
|
|
6
|
-
// Reference: https://github.com/kornelski/7z/blob/main/C/Bra.c
|
|
7
|
-
import { bufferFrom } from 'extract-base-iterator';
|
|
8
|
-
import createBufferingDecoder from './createBufferingDecoder.js';
|
|
9
|
-
/**
|
|
10
|
-
* Decode ARM64 BCJ filtered data
|
|
11
|
-
* Reverses the BCJ transformation by converting absolute addresses back to relative
|
|
12
|
-
*
|
|
13
|
-
* ARM64 B/BL instruction format (little-endian):
|
|
14
|
-
* - 4 bytes aligned
|
|
15
|
-
* - B: opcode 0x14 (000101xx)
|
|
16
|
-
* - BL: opcode 0x94 (100101xx)
|
|
17
|
-
* - Bits 0-25 are 26-bit signed offset (in words)
|
|
18
|
-
*
|
|
19
|
-
* @param input - ARM64 BCJ filtered data
|
|
20
|
-
* @param _properties - Unused for ARM64 BCJ
|
|
21
|
-
* @param _unpackSize - Unused for ARM64 BCJ
|
|
22
|
-
* @returns Unfiltered data
|
|
23
|
-
*/ export function decodeBcjArm64(input, _properties, _unpackSize) {
|
|
24
|
-
const output = bufferFrom(input); // Copy since we modify in place
|
|
25
|
-
let pos = 0;
|
|
26
|
-
// Process 4-byte aligned positions
|
|
27
|
-
while(pos + 4 <= output.length){
|
|
28
|
-
// Read 32-bit value (little-endian)
|
|
29
|
-
let instr = output[pos] | output[pos + 1] << 8 | output[pos + 2] << 16 | output[pos + 3] << 24 >>> 0;
|
|
30
|
-
// Check for B/BL instruction: (instr & 0x7C000000) === 0x14000000
|
|
31
|
-
// This matches both B (0x14000000) and BL (0x94000000)
|
|
32
|
-
if ((instr & 0x7c000000) === 0x14000000) {
|
|
33
|
-
// Extract 26-bit offset
|
|
34
|
-
let addr = instr & 0x03ffffff;
|
|
35
|
-
// Sign-extend 26-bit to 32-bit
|
|
36
|
-
if (addr & 0x02000000) {
|
|
37
|
-
addr |= 0xfc000000;
|
|
38
|
-
}
|
|
39
|
-
// Convert absolute to relative: subtract current position (in words)
|
|
40
|
-
const relAddr = addr - (pos >>> 2);
|
|
41
|
-
// Clear old offset and write new one, preserve opcode
|
|
42
|
-
instr = instr & 0xfc000000 | relAddr & 0x03ffffff;
|
|
43
|
-
// Write back (little-endian)
|
|
44
|
-
output[pos] = instr & 0xff;
|
|
45
|
-
output[pos + 1] = instr >>> 8 & 0xff;
|
|
46
|
-
output[pos + 2] = instr >>> 16 & 0xff;
|
|
47
|
-
output[pos + 3] = instr >>> 24 & 0xff;
|
|
48
|
-
}
|
|
49
|
-
pos += 4;
|
|
50
|
-
}
|
|
51
|
-
return output;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Create an ARM64 BCJ decoder Transform stream
|
|
55
|
-
*/ export function createBcjArm64Decoder(properties, unpackSize) {
|
|
56
|
-
return createBufferingDecoder(decodeBcjArm64, properties, unpackSize);
|
|
57
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/iterators/7z-iterator/src/sevenz/codecs/BcjArm64.ts"],"sourcesContent":["// BCJ (ARM64/AArch64) filter codec - converts ARM64 branch instruction addresses\n// This filter makes ARM64 executables more compressible by LZMA\n//\n// ARM64 uses 32-bit fixed-width instructions. Branch instructions use 26-bit signed offsets.\n//\n// Reference: https://github.com/kornelski/7z/blob/main/C/Bra.c\n\nimport { bufferFrom } from 'extract-base-iterator';\nimport type { Transform } from 'stream';\nimport createBufferingDecoder from './createBufferingDecoder.ts';\n\n/**\n * Decode ARM64 BCJ filtered data\n * Reverses the BCJ transformation by converting absolute addresses back to relative\n *\n * ARM64 B/BL instruction format (little-endian):\n * - 4 bytes aligned\n * - B: opcode 0x14 (000101xx)\n * - BL: opcode 0x94 (100101xx)\n * - Bits 0-25 are 26-bit signed offset (in words)\n *\n * @param input - ARM64 BCJ filtered data\n * @param _properties - Unused for ARM64 BCJ\n * @param _unpackSize - Unused for ARM64 BCJ\n * @returns Unfiltered data\n */\nexport function decodeBcjArm64(input: Buffer, _properties?: Buffer, _unpackSize?: number): Buffer {\n const output = bufferFrom(input); // Copy since we modify in place\n let pos = 0;\n\n // Process 4-byte aligned positions\n while (pos + 4 <= output.length) {\n // Read 32-bit value (little-endian)\n let instr = output[pos] | (output[pos + 1] << 8) | (output[pos + 2] << 16) | ((output[pos + 3] << 24) >>> 0);\n\n // Check for B/BL instruction: (instr & 0x7C000000) === 0x14000000\n // This matches both B (0x14000000) and BL (0x94000000)\n if ((instr & 0x7c000000) === 0x14000000) {\n // Extract 26-bit offset\n let addr = instr & 0x03ffffff;\n\n // Sign-extend 26-bit to 32-bit\n if (addr & 0x02000000) {\n addr |= 0xfc000000;\n }\n\n // Convert absolute to relative: subtract current position (in words)\n const relAddr = addr - (pos >>> 2);\n\n // Clear old offset and write new one, preserve opcode\n instr = (instr & 0xfc000000) | (relAddr & 0x03ffffff);\n\n // Write back (little-endian)\n output[pos] = instr & 0xff;\n output[pos + 1] = (instr >>> 8) & 0xff;\n output[pos + 2] = (instr >>> 16) & 0xff;\n output[pos + 3] = (instr >>> 24) & 0xff;\n }\n\n pos += 4;\n }\n\n return output;\n}\n\n/**\n * Create an ARM64 BCJ decoder Transform stream\n */\nexport function createBcjArm64Decoder(properties?: Buffer, unpackSize?: number): Transform {\n return createBufferingDecoder(decodeBcjArm64, properties, unpackSize);\n}\n"],"names":["bufferFrom","createBufferingDecoder","decodeBcjArm64","input","_properties","_unpackSize","output","pos","length","instr","addr","relAddr","createBcjArm64Decoder","properties","unpackSize"],"mappings":"AAAA,iFAAiF;AACjF,gEAAgE;AAChE,EAAE;AACF,6FAA6F;AAC7F,EAAE;AACF,+DAA+D;AAE/D,SAASA,UAAU,QAAQ,wBAAwB;AAEnD,OAAOC,4BAA4B,8BAA8B;AAEjE;;;;;;;;;;;;;;CAcC,GACD,OAAO,SAASC,eAAeC,KAAa,EAAEC,WAAoB,EAAEC,WAAoB;IACtF,MAAMC,SAASN,WAAWG,QAAQ,gCAAgC;IAClE,IAAII,MAAM;IAEV,mCAAmC;IACnC,MAAOA,MAAM,KAAKD,OAAOE,MAAM,CAAE;QAC/B,oCAAoC;QACpC,IAAIC,QAAQH,MAAM,CAACC,IAAI,GAAID,MAAM,CAACC,MAAM,EAAE,IAAI,IAAMD,MAAM,CAACC,MAAM,EAAE,IAAI,KAAO,AAACD,MAAM,CAACC,MAAM,EAAE,IAAI,OAAQ;QAE1G,kEAAkE;QAClE,uDAAuD;QACvD,IAAI,AAACE,CAAAA,QAAQ,UAAS,MAAO,YAAY;YACvC,wBAAwB;YACxB,IAAIC,OAAOD,QAAQ;YAEnB,+BAA+B;YAC/B,IAAIC,OAAO,YAAY;gBACrBA,QAAQ;YACV;YAEA,qEAAqE;YACrE,MAAMC,UAAUD,OAAQH,CAAAA,QAAQ,CAAA;YAEhC,sDAAsD;YACtDE,QAAQ,AAACA,QAAQ,aAAeE,UAAU;YAE1C,6BAA6B;YAC7BL,MAAM,CAACC,IAAI,GAAGE,QAAQ;YACtBH,MAAM,CAACC,MAAM,EAAE,GAAG,AAACE,UAAU,IAAK;YAClCH,MAAM,CAACC,MAAM,EAAE,GAAG,AAACE,UAAU,KAAM;YACnCH,MAAM,CAACC,MAAM,EAAE,GAAG,AAACE,UAAU,KAAM;QACrC;QAEAF,OAAO;IACT;IAEA,OAAOD;AACT;AAEA;;CAEC,GACD,OAAO,SAASM,sBAAsBC,UAAmB,EAAEC,UAAmB;IAC5E,OAAOb,uBAAuBC,gBAAgBW,YAAYC;AAC5D"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { Transform } from 'stream';
|
|
2
|
-
/**
|
|
3
|
-
* Decode ARM Thumb BCJ filtered data
|
|
4
|
-
* Reverses the BCJ transformation by converting absolute addresses back to relative
|
|
5
|
-
*
|
|
6
|
-
* ARM Thumb BL instruction format (2 x 16-bit):
|
|
7
|
-
* - First half-word: 1111 0xxx xxxx xxxx (high bits of offset)
|
|
8
|
-
* - Second half-word: 1111 1xxx xxxx xxxx (low bits of offset)
|
|
9
|
-
*
|
|
10
|
-
* @param input - ARM Thumb BCJ filtered data
|
|
11
|
-
* @param _properties - Unused for ARM Thumb BCJ
|
|
12
|
-
* @param _unpackSize - Unused for ARM Thumb BCJ
|
|
13
|
-
* @returns Unfiltered data
|
|
14
|
-
*/
|
|
15
|
-
export declare function decodeBcjArmt(input: Buffer, _properties?: Buffer, _unpackSize?: number): Buffer;
|
|
16
|
-
/**
|
|
17
|
-
* Create an ARM Thumb BCJ decoder Transform stream
|
|
18
|
-
*/
|
|
19
|
-
export declare function createBcjArmtDecoder(properties?: Buffer, unpackSize?: number): Transform;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
// BCJ (ARM Thumb) filter codec - converts ARM Thumb branch instruction addresses
|
|
2
|
-
// This filter makes ARM Thumb executables more compressible by LZMA
|
|
3
|
-
//
|
|
4
|
-
// ARM Thumb uses 16-bit instructions, but BL (branch with link) spans two 16-bit words.
|
|
5
|
-
// The filter converts relative addresses to absolute during compression.
|
|
6
|
-
//
|
|
7
|
-
// Reference: https://github.com/kornelski/7z/blob/main/C/Bra.c
|
|
8
|
-
import { bufferFrom } from 'extract-base-iterator';
|
|
9
|
-
import createBufferingDecoder from './createBufferingDecoder.js';
|
|
10
|
-
/**
|
|
11
|
-
* Decode ARM Thumb BCJ filtered data
|
|
12
|
-
* Reverses the BCJ transformation by converting absolute addresses back to relative
|
|
13
|
-
*
|
|
14
|
-
* ARM Thumb BL instruction format (2 x 16-bit):
|
|
15
|
-
* - First half-word: 1111 0xxx xxxx xxxx (high bits of offset)
|
|
16
|
-
* - Second half-word: 1111 1xxx xxxx xxxx (low bits of offset)
|
|
17
|
-
*
|
|
18
|
-
* @param input - ARM Thumb BCJ filtered data
|
|
19
|
-
* @param _properties - Unused for ARM Thumb BCJ
|
|
20
|
-
* @param _unpackSize - Unused for ARM Thumb BCJ
|
|
21
|
-
* @returns Unfiltered data
|
|
22
|
-
*/ export function decodeBcjArmt(input, _properties, _unpackSize) {
|
|
23
|
-
const output = bufferFrom(input); // Copy since we modify in place
|
|
24
|
-
let pos = 0;
|
|
25
|
-
// Process 2-byte aligned positions
|
|
26
|
-
while(pos + 4 <= output.length){
|
|
27
|
-
// Read two 16-bit values (little-endian)
|
|
28
|
-
const w0 = output[pos] | output[pos + 1] << 8;
|
|
29
|
-
const w1 = output[pos + 2] | output[pos + 3] << 8;
|
|
30
|
-
// Check for BL instruction pair:
|
|
31
|
-
// First word: 0xF000-0xF7FF (1111 0xxx xxxx xxxx)
|
|
32
|
-
// Second word: 0xF800-0xFFFF (1111 1xxx xxxx xxxx)
|
|
33
|
-
if ((w0 & 0xf800) === 0xf000 && (w1 & 0xf800) === 0xf800) {
|
|
34
|
-
// Extract and combine the offset parts
|
|
35
|
-
// High 11 bits from w0, low 11 bits from w1
|
|
36
|
-
const hi = w0 & 0x7ff;
|
|
37
|
-
const lo = w1 & 0x7ff;
|
|
38
|
-
// Combine into 22-bit offset (in half-words)
|
|
39
|
-
let addr = hi << 11 | lo;
|
|
40
|
-
// Sign-extend 22-bit to 32-bit
|
|
41
|
-
if (addr & 0x200000) {
|
|
42
|
-
addr |= 0xffc00000;
|
|
43
|
-
}
|
|
44
|
-
// Convert absolute to relative:
|
|
45
|
-
// Subtract current position (in half-words, so divide by 2)
|
|
46
|
-
// Thumb PC is 2 half-words (4 bytes) ahead
|
|
47
|
-
const relAddr = addr - (pos >>> 1);
|
|
48
|
-
// Write back
|
|
49
|
-
const newHi = relAddr >>> 11 & 0x7ff;
|
|
50
|
-
const newLo = relAddr & 0x7ff;
|
|
51
|
-
output[pos] = newHi & 0xff;
|
|
52
|
-
output[pos + 1] = 0xf0 | newHi >>> 8 & 0x07;
|
|
53
|
-
output[pos + 2] = newLo & 0xff;
|
|
54
|
-
output[pos + 3] = 0xf8 | newLo >>> 8 & 0x07;
|
|
55
|
-
pos += 4;
|
|
56
|
-
} else {
|
|
57
|
-
pos += 2;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return output;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Create an ARM Thumb BCJ decoder Transform stream
|
|
64
|
-
*/ export function createBcjArmtDecoder(properties, unpackSize) {
|
|
65
|
-
return createBufferingDecoder(decodeBcjArmt, properties, unpackSize);
|
|
66
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/iterators/7z-iterator/src/sevenz/codecs/BcjArmt.ts"],"sourcesContent":["// BCJ (ARM Thumb) filter codec - converts ARM Thumb branch instruction addresses\n// This filter makes ARM Thumb executables more compressible by LZMA\n//\n// ARM Thumb uses 16-bit instructions, but BL (branch with link) spans two 16-bit words.\n// The filter converts relative addresses to absolute during compression.\n//\n// Reference: https://github.com/kornelski/7z/blob/main/C/Bra.c\n\nimport { bufferFrom } from 'extract-base-iterator';\nimport type { Transform } from 'stream';\nimport createBufferingDecoder from './createBufferingDecoder.ts';\n\n/**\n * Decode ARM Thumb BCJ filtered data\n * Reverses the BCJ transformation by converting absolute addresses back to relative\n *\n * ARM Thumb BL instruction format (2 x 16-bit):\n * - First half-word: 1111 0xxx xxxx xxxx (high bits of offset)\n * - Second half-word: 1111 1xxx xxxx xxxx (low bits of offset)\n *\n * @param input - ARM Thumb BCJ filtered data\n * @param _properties - Unused for ARM Thumb BCJ\n * @param _unpackSize - Unused for ARM Thumb BCJ\n * @returns Unfiltered data\n */\nexport function decodeBcjArmt(input: Buffer, _properties?: Buffer, _unpackSize?: number): Buffer {\n const output = bufferFrom(input); // Copy since we modify in place\n let pos = 0;\n\n // Process 2-byte aligned positions\n while (pos + 4 <= output.length) {\n // Read two 16-bit values (little-endian)\n const w0 = output[pos] | (output[pos + 1] << 8);\n const w1 = output[pos + 2] | (output[pos + 3] << 8);\n\n // Check for BL instruction pair:\n // First word: 0xF000-0xF7FF (1111 0xxx xxxx xxxx)\n // Second word: 0xF800-0xFFFF (1111 1xxx xxxx xxxx)\n if ((w0 & 0xf800) === 0xf000 && (w1 & 0xf800) === 0xf800) {\n // Extract and combine the offset parts\n // High 11 bits from w0, low 11 bits from w1\n const hi = w0 & 0x7ff;\n const lo = w1 & 0x7ff;\n\n // Combine into 22-bit offset (in half-words)\n let addr = (hi << 11) | lo;\n\n // Sign-extend 22-bit to 32-bit\n if (addr & 0x200000) {\n addr |= 0xffc00000;\n }\n\n // Convert absolute to relative:\n // Subtract current position (in half-words, so divide by 2)\n // Thumb PC is 2 half-words (4 bytes) ahead\n const relAddr = addr - (pos >>> 1);\n\n // Write back\n const newHi = (relAddr >>> 11) & 0x7ff;\n const newLo = relAddr & 0x7ff;\n\n output[pos] = newHi & 0xff;\n output[pos + 1] = 0xf0 | ((newHi >>> 8) & 0x07);\n output[pos + 2] = newLo & 0xff;\n output[pos + 3] = 0xf8 | ((newLo >>> 8) & 0x07);\n\n pos += 4;\n } else {\n pos += 2;\n }\n }\n\n return output;\n}\n\n/**\n * Create an ARM Thumb BCJ decoder Transform stream\n */\nexport function createBcjArmtDecoder(properties?: Buffer, unpackSize?: number): Transform {\n return createBufferingDecoder(decodeBcjArmt, properties, unpackSize);\n}\n"],"names":["bufferFrom","createBufferingDecoder","decodeBcjArmt","input","_properties","_unpackSize","output","pos","length","w0","w1","hi","lo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,GAAGS,QAAQ;YAC1BV,MAAM,CAACC,MAAM,EAAE,GAAG,OAAQ,AAACS,UAAU,IAAK;YAE1CT,OAAO;QACT,OAAO;YACLA,OAAO;QACT;IACF;IAEA,OAAOD;AACT;AAEA;;CAEC,GACD,OAAO,SAASW,qBAAqBC,UAAmB,EAAEC,UAAmB;IAC3E,OAAOlB,uBAAuBC,eAAegB,YAAYC;AAC3D"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Transform } from 'stream';
|
|
2
|
-
/**
|
|
3
|
-
* Decode IA64 BCJ filtered data
|
|
4
|
-
* Reverses the BCJ transformation by converting absolute addresses back to relative
|
|
5
|
-
*
|
|
6
|
-
* @param input - IA64 BCJ filtered data
|
|
7
|
-
* @param _properties - Unused for IA64 BCJ
|
|
8
|
-
* @param _unpackSize - Unused for IA64 BCJ
|
|
9
|
-
* @returns Unfiltered data
|
|
10
|
-
*/
|
|
11
|
-
export declare function decodeBcjIa64(input: Buffer, _properties?: Buffer, _unpackSize?: number): Buffer;
|
|
12
|
-
/**
|
|
13
|
-
* Create an IA64 BCJ decoder Transform stream
|
|
14
|
-
*/
|
|
15
|
-
export declare function createBcjIa64Decoder(properties?: Buffer, unpackSize?: number): Transform;
|