mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-06 01:14:55 -06:00
9.09 beta
This commit is contained in:
committed by
Kornel Lesiński
parent
2fed872194
commit
1fbaf0aac5
100
Asm/arm/7zCrcOpt.asm
Executable file
100
Asm/arm/7zCrcOpt.asm
Executable file
@@ -0,0 +1,100 @@
|
||||
CODE32
|
||||
|
||||
EXPORT |CrcUpdateT4@16|
|
||||
|
||||
AREA |.text|, CODE, ARM
|
||||
|
||||
MACRO
|
||||
CRC32_STEP_1
|
||||
|
||||
ldrb r4, [r1], #1
|
||||
subs r2, r2, #1
|
||||
eor r4, r4, r0
|
||||
and r4, r4, #0xFF
|
||||
ldr r4, [r3, +r4, lsl #2]
|
||||
eor r0, r4, r0, lsr #8
|
||||
|
||||
MEND
|
||||
|
||||
|
||||
MACRO
|
||||
CRC32_STEP_4 $STREAM_WORD
|
||||
|
||||
eor r7, r7, r8
|
||||
eor r7, r7, r9
|
||||
eor r0, r0, r7
|
||||
eor r0, r0, $STREAM_WORD
|
||||
ldr $STREAM_WORD, [r1], #4
|
||||
|
||||
and r7, r0, #0xFF
|
||||
and r8, r0, #0xFF00
|
||||
and r9, r0, #0xFF0000
|
||||
and r0, r0, #0xFF000000
|
||||
|
||||
ldr r7, [r6, +r7, lsl #2]
|
||||
ldr r8, [r5, +r8, lsr #6]
|
||||
ldr r9, [r4, +r9, lsr #14]
|
||||
ldr r0, [r3, +r0, lsr #22]
|
||||
|
||||
MEND
|
||||
|
||||
|
||||
|CrcUpdateT4@16| PROC
|
||||
|
||||
stmdb sp!, {r4-r11, lr}
|
||||
cmp r2, #0
|
||||
beq |$fin|
|
||||
|
||||
|$v1|
|
||||
tst r1, #7
|
||||
beq |$v2|
|
||||
CRC32_STEP_1
|
||||
bne |$v1|
|
||||
|
||||
|$v2|
|
||||
cmp r2, #16
|
||||
blo |$v3|
|
||||
|
||||
ldr r10, [r1], #4
|
||||
ldr r11, [r1], #4
|
||||
|
||||
add r4, r3, #0x400
|
||||
add r5, r3, #0x800
|
||||
add r6, r3, #0xC00
|
||||
|
||||
mov r7, #0
|
||||
mov r8, #0
|
||||
mov r9, #0
|
||||
|
||||
sub r2, r2, #16
|
||||
|
||||
|$loop|
|
||||
; pld [r1, #0x40]
|
||||
|
||||
CRC32_STEP_4 r10
|
||||
CRC32_STEP_4 r11
|
||||
|
||||
subs r2, r2, #8
|
||||
bhs |$loop|
|
||||
|
||||
sub r1, r1, #8
|
||||
add r2, r2, #16
|
||||
|
||||
eor r7, r7, r8
|
||||
eor r7, r7, r9
|
||||
eor r0, r0, r7
|
||||
|
||||
|$v3|
|
||||
cmp r2, #0
|
||||
beq |$fin|
|
||||
|
||||
|$v4|
|
||||
CRC32_STEP_1
|
||||
bne |$v4|
|
||||
|
||||
|$fin|
|
||||
ldmia sp!, {r4-r11, pc}
|
||||
|
||||
|CrcUpdateT4@16| ENDP
|
||||
|
||||
END
|
||||
@@ -1,101 +0,0 @@
|
||||
.code
|
||||
|
||||
|
||||
|
||||
|
||||
CRC1b macro
|
||||
movzx EDX, BYTE PTR [RSI]
|
||||
inc RSI
|
||||
movzx EBX, AL
|
||||
xor EDX, EBX
|
||||
shr EAX, 8
|
||||
xor EAX, [RDI + RDX * 4]
|
||||
dec R8
|
||||
endm
|
||||
|
||||
|
||||
|
||||
|
||||
align 16
|
||||
CrcUpdateT8 PROC
|
||||
|
||||
push RBX
|
||||
push RSI
|
||||
push RDI
|
||||
push RBP
|
||||
|
||||
mov EAX, ECX
|
||||
mov RSI, RDX
|
||||
mov RDI, R9
|
||||
|
||||
|
||||
test R8, R8
|
||||
jz sl_end
|
||||
sl:
|
||||
test RSI, 7
|
||||
jz sl_end
|
||||
CRC1b
|
||||
jnz sl
|
||||
sl_end:
|
||||
|
||||
cmp R8, 16
|
||||
jb crc_end
|
||||
mov R9, R8
|
||||
and R8, 7
|
||||
add R8, 8
|
||||
sub R9, R8
|
||||
|
||||
add R9, RSI
|
||||
xor EAX, [RSI]
|
||||
mov EBX, [RSI + 4]
|
||||
movzx ECX, BL
|
||||
align 16
|
||||
main_loop:
|
||||
mov EDX, [RDI + RCX*4 + 0C00h]
|
||||
movzx EBP, BH
|
||||
xor EDX, [RDI + RBP*4 + 0800h]
|
||||
shr EBX, 16
|
||||
movzx ECX, BL
|
||||
xor EDX, [RSI + 8]
|
||||
xor EDX, [RDI + RCX*4 + 0400h]
|
||||
movzx ECX, AL
|
||||
movzx EBP, BH
|
||||
xor EDX, [RDI + RBP*4 + 0000h]
|
||||
|
||||
mov EBX, [RSI + 12]
|
||||
|
||||
xor EDX, [RDI + RCX*4 + 01C00h]
|
||||
movzx EBP, AH
|
||||
shr EAX, 16
|
||||
movzx ECX, AL
|
||||
xor EDX, [RDI + RBP*4 + 01800h]
|
||||
movzx EBP, AH
|
||||
mov EAX, [RDI + RCX*4 + 01400h]
|
||||
add RSI, 8
|
||||
xor EAX, [RDI + RBP*4 + 01000h]
|
||||
movzx ECX, BL
|
||||
xor EAX,EDX
|
||||
|
||||
cmp RSI, R9
|
||||
jne main_loop
|
||||
xor EAX, [RSI]
|
||||
|
||||
|
||||
|
||||
crc_end:
|
||||
|
||||
test R8, R8
|
||||
jz fl_end
|
||||
fl:
|
||||
CRC1b
|
||||
jnz fl
|
||||
fl_end:
|
||||
|
||||
pop RBP
|
||||
pop RDI
|
||||
pop RSI
|
||||
pop RBX
|
||||
ret
|
||||
CrcUpdateT8 ENDP
|
||||
|
||||
end
|
||||
93
Asm/x86/7zAsm.asm
Executable file
93
Asm/x86/7zAsm.asm
Executable file
@@ -0,0 +1,93 @@
|
||||
; 7zAsm.asm -- ASM macros
|
||||
; 2009-12-12 : Igor Pavlov : Public domain
|
||||
|
||||
MY_ASM_START macro
|
||||
ifdef x64
|
||||
.code
|
||||
else
|
||||
.386
|
||||
.model flat
|
||||
_TEXT$00 SEGMENT PARA PUBLIC 'CODE'
|
||||
endif
|
||||
endm
|
||||
|
||||
MY_PROC macro name:req, numParams:req
|
||||
align 16
|
||||
proc_numParams equ numParams
|
||||
ifdef x64
|
||||
proc_name equ name
|
||||
name PROC
|
||||
else
|
||||
proc_fastcall_name equ @CatStr(@,name,@, %numParams * 4)
|
||||
public proc_fastcall_name
|
||||
proc_fastcall_name:
|
||||
endif
|
||||
endm
|
||||
|
||||
MY_ENDP macro
|
||||
ifdef x64
|
||||
ret
|
||||
proc_name ENDP
|
||||
else
|
||||
ret (proc_numParams - 2) * 4
|
||||
endif
|
||||
endm
|
||||
|
||||
ifdef x64
|
||||
REG_SIZE equ 8
|
||||
else
|
||||
REG_SIZE equ 4
|
||||
endif
|
||||
|
||||
x0 equ EAX
|
||||
x1 equ ECX
|
||||
x2 equ EDX
|
||||
x3 equ EBX
|
||||
x4 equ ESP
|
||||
x5 equ EBP
|
||||
x6 equ ESI
|
||||
x7 equ EDI
|
||||
|
||||
x0_L equ AL
|
||||
x1_L equ CL
|
||||
x2_L equ DL
|
||||
x3_L equ BL
|
||||
|
||||
x0_H equ AH
|
||||
x1_H equ CH
|
||||
x2_H equ DH
|
||||
x3_H equ BH
|
||||
|
||||
ifdef x64
|
||||
r0 equ RAX
|
||||
r1 equ RCX
|
||||
r2 equ RDX
|
||||
r3 equ RBX
|
||||
r4 equ RSP
|
||||
r5 equ RBP
|
||||
r6 equ RSI
|
||||
r7 equ RDI
|
||||
else
|
||||
r0 equ x0
|
||||
r1 equ x1
|
||||
r2 equ x2
|
||||
r3 equ x3
|
||||
r4 equ x4
|
||||
r5 equ x5
|
||||
r6 equ x6
|
||||
r7 equ x7
|
||||
endif
|
||||
|
||||
MY_PUSH_4_REGS macro
|
||||
push r3
|
||||
push r5
|
||||
push r6
|
||||
push r7
|
||||
endm
|
||||
|
||||
MY_POP_4_REGS macro
|
||||
pop r7
|
||||
pop r6
|
||||
pop r5
|
||||
pop r3
|
||||
endm
|
||||
147
Asm/x86/7zCrcOpt.asm
Executable file
147
Asm/x86/7zCrcOpt.asm
Executable file
@@ -0,0 +1,147 @@
|
||||
; 7zCrcOpt.asm -- CRC32 calculation : optimized version
|
||||
; 2009-12-12 : Igor Pavlov : Public domain
|
||||
|
||||
include 7zAsm.asm
|
||||
|
||||
MY_ASM_START
|
||||
|
||||
rD equ r2
|
||||
rN equ r7
|
||||
|
||||
ifdef x64
|
||||
num_VAR equ r8
|
||||
table_VAR equ r9
|
||||
else
|
||||
data_size equ (REG_SIZE * 5)
|
||||
crc_table equ (REG_SIZE + data_size)
|
||||
num_VAR equ [r4 + data_size]
|
||||
table_VAR equ [r4 + crc_table]
|
||||
endif
|
||||
|
||||
SRCDAT equ rN + rD + 4 *
|
||||
|
||||
CRC macro op:req, dest:req, src:req, t:req
|
||||
op dest, DWORD PTR [r5 + src * 4 + 0400h * t]
|
||||
endm
|
||||
|
||||
CRC_XOR macro dest:req, src:req, t:req
|
||||
CRC xor, dest, src, t
|
||||
endm
|
||||
|
||||
CRC_MOV macro dest:req, src:req, t:req
|
||||
CRC mov, dest, src, t
|
||||
endm
|
||||
|
||||
CRC1b macro
|
||||
movzx x6, BYTE PTR [rD]
|
||||
inc rD
|
||||
movzx x3, x0_L
|
||||
xor x6, x3
|
||||
shr x0, 8
|
||||
CRC xor, x0, r6, 0
|
||||
dec rN
|
||||
endm
|
||||
|
||||
MY_PROLOG macro crc_end:req
|
||||
MY_PUSH_4_REGS
|
||||
|
||||
mov x0, x1
|
||||
mov rN, num_VAR
|
||||
mov r5, table_VAR
|
||||
test rN, rN
|
||||
jz crc_end
|
||||
@@:
|
||||
test rD, 7
|
||||
jz @F
|
||||
CRC1b
|
||||
jnz @B
|
||||
@@:
|
||||
cmp rN, 16
|
||||
jb crc_end
|
||||
add rN, rD
|
||||
mov num_VAR, rN
|
||||
sub rN, 8
|
||||
and rN, NOT 7
|
||||
sub rD, rN
|
||||
xor x0, [SRCDAT 0]
|
||||
endm
|
||||
|
||||
MY_EPILOG macro crc_end:req
|
||||
xor x0, [SRCDAT 0]
|
||||
mov rD, rN
|
||||
mov rN, num_VAR
|
||||
sub rN, rD
|
||||
crc_end:
|
||||
test rN, rN
|
||||
jz @F
|
||||
CRC1b
|
||||
jmp crc_end
|
||||
@@:
|
||||
MY_POP_4_REGS
|
||||
endm
|
||||
|
||||
MY_PROC CrcUpdateT8, 4
|
||||
MY_PROLOG crc_end_8
|
||||
mov x1, [SRCDAT 1]
|
||||
align 16
|
||||
main_loop_8:
|
||||
mov x6, [SRCDAT 2]
|
||||
movzx x3, x1_L
|
||||
CRC_XOR x6, r3, 3
|
||||
movzx x3, x1_H
|
||||
CRC_XOR x6, r3, 2
|
||||
shr x1, 16
|
||||
movzx x3, x1_L
|
||||
movzx x1, x1_H
|
||||
CRC_XOR x6, r3, 1
|
||||
movzx x3, x0_L
|
||||
CRC_XOR x6, r1, 0
|
||||
|
||||
mov x1, [SRCDAT 3]
|
||||
CRC_XOR x6, r3, 7
|
||||
movzx x3, x0_H
|
||||
shr x0, 16
|
||||
CRC_XOR x6, r3, 6
|
||||
movzx x3, x0_L
|
||||
CRC_XOR x6, r3, 5
|
||||
movzx x3, x0_H
|
||||
CRC_MOV x0, r3, 4
|
||||
xor x0, x6
|
||||
add rD, 8
|
||||
jnz main_loop_8
|
||||
|
||||
MY_EPILOG crc_end_8
|
||||
MY_ENDP
|
||||
|
||||
MY_PROC CrcUpdateT4, 4
|
||||
MY_PROLOG crc_end_4
|
||||
align 16
|
||||
main_loop_4:
|
||||
movzx x1, x0_L
|
||||
movzx x3, x0_H
|
||||
shr x0, 16
|
||||
movzx x6, x0_H
|
||||
and x0, 0FFh
|
||||
CRC_MOV x1, r1, 3
|
||||
xor x1, [SRCDAT 1]
|
||||
CRC_XOR x1, r3, 2
|
||||
CRC_XOR x1, r6, 0
|
||||
CRC_XOR x1, r0, 1
|
||||
|
||||
movzx x0, x1_L
|
||||
movzx x3, x1_H
|
||||
shr x1, 16
|
||||
movzx x6, x1_H
|
||||
and x1, 0FFh
|
||||
CRC_MOV x0, r0, 3
|
||||
xor x0, [SRCDAT 2]
|
||||
CRC_XOR x0, r3, 2
|
||||
CRC_XOR x0, r6, 0
|
||||
CRC_XOR x0, r1, 1
|
||||
add rD, 8
|
||||
jnz main_loop_4
|
||||
|
||||
MY_EPILOG crc_end_4
|
||||
MY_ENDP
|
||||
|
||||
end
|
||||
@@ -1,101 +0,0 @@
|
||||
.386
|
||||
.model flat
|
||||
|
||||
_TEXT$00 SEGMENT PARA PUBLIC 'CODE'
|
||||
|
||||
CRC1b macro
|
||||
movzx EDX, BYTE PTR [ESI]
|
||||
inc ESI
|
||||
movzx EBX, AL
|
||||
xor EDX, EBX
|
||||
shr EAX, 8
|
||||
xor EAX, [EBP + EDX * 4]
|
||||
dec EDI
|
||||
endm
|
||||
|
||||
data_size equ (4 + 4*4)
|
||||
crc_table equ (data_size + 4)
|
||||
|
||||
align 16
|
||||
public @CrcUpdateT8@16
|
||||
@CrcUpdateT8@16:
|
||||
push EBX
|
||||
push ESI
|
||||
push EDI
|
||||
push EBP
|
||||
|
||||
mov EAX, ECX
|
||||
mov ESI, EDX
|
||||
mov EDI, [ESP + data_size]
|
||||
mov EBP, [ESP + crc_table]
|
||||
|
||||
test EDI, EDI
|
||||
jz sl_end
|
||||
sl:
|
||||
test ESI, 7
|
||||
jz sl_end
|
||||
CRC1b
|
||||
jnz sl
|
||||
sl_end:
|
||||
|
||||
cmp EDI, 16
|
||||
jb crc_end
|
||||
mov [ESP + data_size], EDI
|
||||
sub EDI, 8
|
||||
and EDI, NOT 7
|
||||
sub [ESP + data_size], EDI
|
||||
|
||||
add EDI, ESI
|
||||
xor EAX, [ESI]
|
||||
mov EBX, [ESI + 4]
|
||||
movzx ECX, BL
|
||||
align 16
|
||||
main_loop:
|
||||
mov EDX, [EBP + ECX*4 + 0C00h]
|
||||
movzx ECX, BH
|
||||
xor EDX, [EBP + ECX*4 + 0800h]
|
||||
shr EBX, 16
|
||||
movzx ECX, BL
|
||||
xor EDX, [EBP + ECX*4 + 0400h]
|
||||
xor EDX, [ESI + 8]
|
||||
movzx ECX, AL
|
||||
movzx EBX, BH
|
||||
xor EDX, [EBP + EBX*4 + 0000h]
|
||||
|
||||
mov EBX, [ESI + 12]
|
||||
|
||||
xor EDX, [EBP + ECX*4 + 01C00h]
|
||||
movzx ECX, AH
|
||||
add ESI, 8
|
||||
shr EAX, 16
|
||||
xor EDX, [EBP + ECX*4 + 01800h]
|
||||
movzx ECX, AL
|
||||
xor EDX, [EBP + ECX*4 + 01400h]
|
||||
movzx ECX, AH
|
||||
mov EAX, [EBP + ECX*4 + 01000h]
|
||||
movzx ECX, BL
|
||||
xor EAX,EDX
|
||||
|
||||
cmp ESI, EDI
|
||||
jne main_loop
|
||||
xor EAX, [ESI]
|
||||
|
||||
mov EDI, [ESP + data_size]
|
||||
|
||||
crc_end:
|
||||
|
||||
test EDI, EDI
|
||||
jz fl_end
|
||||
fl:
|
||||
CRC1b
|
||||
jnz fl
|
||||
fl_end:
|
||||
|
||||
pop EBP
|
||||
pop EDI
|
||||
pop ESI
|
||||
pop EBX
|
||||
ret 8
|
||||
|
||||
|
||||
end
|
||||
237
Asm/x86/AesOpt.asm
Executable file
237
Asm/x86/AesOpt.asm
Executable file
@@ -0,0 +1,237 @@
|
||||
; AesOpt.asm -- Intel's AES.
|
||||
; 2009-12-12 : Igor Pavlov : Public domain
|
||||
|
||||
include 7zAsm.asm
|
||||
|
||||
MY_ASM_START
|
||||
|
||||
ifndef x64
|
||||
.xmm
|
||||
endif
|
||||
|
||||
ifdef x64
|
||||
num equ r8
|
||||
else
|
||||
num equ [r4 + REG_SIZE * 4]
|
||||
endif
|
||||
|
||||
rD equ r2
|
||||
rN equ r0
|
||||
|
||||
MY_PROLOG macro reg:req
|
||||
ifdef x64
|
||||
movdqa [r4 + 8], xmm6
|
||||
movdqa [r4 + 8 + 16], xmm7
|
||||
endif
|
||||
|
||||
push r3
|
||||
push r5
|
||||
push r6
|
||||
|
||||
mov rN, num
|
||||
mov x6, [r1 + 16]
|
||||
shl x6, 5
|
||||
|
||||
movdqa reg, [r1]
|
||||
add r1, 32
|
||||
endm
|
||||
|
||||
MY_EPILOG macro
|
||||
pop r6
|
||||
pop r5
|
||||
pop r3
|
||||
|
||||
ifdef x64
|
||||
movdqa xmm6, [r4 + 8]
|
||||
movdqa xmm7, [r4 + 8 + 16]
|
||||
endif
|
||||
|
||||
MY_ENDP
|
||||
endm
|
||||
|
||||
ways equ 4
|
||||
ways16 equ (ways * 16)
|
||||
|
||||
OP_W macro op, op2
|
||||
i = 0
|
||||
rept ways
|
||||
op @CatStr(xmm,%i), op2
|
||||
i = i + 1
|
||||
endm
|
||||
endm
|
||||
|
||||
LOAD_OP macro op:req, offs:req
|
||||
op xmm0, [r1 + r3 offs]
|
||||
endm
|
||||
|
||||
LOAD_OP_W macro op:req, offs:req
|
||||
movdqa xmm7, [r1 + r3 offs]
|
||||
OP_W op, xmm7
|
||||
endm
|
||||
|
||||
|
||||
; ---------- AES-CBC Decode ----------
|
||||
|
||||
CBC_DEC_UPDATE macro reg, offs
|
||||
pxor reg, xmm6
|
||||
movdqa xmm6, [rD + offs]
|
||||
movdqa [rD + offs], reg
|
||||
endm
|
||||
|
||||
DECODE macro op:req
|
||||
op aesdec, +16
|
||||
@@:
|
||||
op aesdec, +0
|
||||
op aesdec, -16
|
||||
sub x3, 32
|
||||
jnz @B
|
||||
op aesdeclast, +0
|
||||
endm
|
||||
|
||||
MY_PROC AesCbc_Decode_Intel, 3
|
||||
MY_PROLOG xmm6
|
||||
|
||||
sub x6, 32
|
||||
|
||||
jmp check2
|
||||
|
||||
align 16
|
||||
nextBlocks2:
|
||||
mov x3, x6
|
||||
OP_W movdqa, [rD + i * 16]
|
||||
LOAD_OP_W pxor, +32
|
||||
DECODE LOAD_OP_W
|
||||
OP_W CBC_DEC_UPDATE, i * 16
|
||||
add rD, ways16
|
||||
check2:
|
||||
sub rN, ways
|
||||
jnc nextBlocks2
|
||||
|
||||
add rN, ways
|
||||
jmp check
|
||||
|
||||
nextBlock:
|
||||
mov x3, x6
|
||||
movdqa xmm1, [rD]
|
||||
LOAD_OP movdqa, +32
|
||||
pxor xmm0, xmm1
|
||||
DECODE LOAD_OP
|
||||
pxor xmm0, xmm6
|
||||
movdqa [rD], xmm0
|
||||
movdqa xmm6, xmm1
|
||||
add rD, 16
|
||||
check:
|
||||
sub rN, 1
|
||||
jnc nextBlock
|
||||
|
||||
movdqa [r1 - 32], xmm6
|
||||
MY_EPILOG
|
||||
|
||||
|
||||
; ---------- AES-CBC Encode ----------
|
||||
|
||||
ENCODE macro op:req
|
||||
op aesenc, -16
|
||||
@@:
|
||||
op aesenc, +0
|
||||
op aesenc, +16
|
||||
add r3, 32
|
||||
jnz @B
|
||||
op aesenclast, +0
|
||||
endm
|
||||
|
||||
MY_PROC AesCbc_Encode_Intel, 3
|
||||
MY_PROLOG xmm0
|
||||
|
||||
add r1, r6
|
||||
neg r6
|
||||
add r6, 32
|
||||
|
||||
jmp check_e
|
||||
|
||||
align 16
|
||||
nextBlock_e:
|
||||
mov r3, r6
|
||||
pxor xmm0, [rD]
|
||||
pxor xmm0, [r1 + r3 - 32]
|
||||
ENCODE LOAD_OP
|
||||
movdqa [rD], xmm0
|
||||
add rD, 16
|
||||
check_e:
|
||||
sub rN, 1
|
||||
jnc nextBlock_e
|
||||
|
||||
movdqa [r1 + r6 - 64], xmm0
|
||||
MY_EPILOG
|
||||
|
||||
|
||||
; ---------- AES-CTR ----------
|
||||
|
||||
XOR_UPD_1 macro reg, offs
|
||||
pxor reg, [rD + offs]
|
||||
endm
|
||||
|
||||
XOR_UPD_2 macro reg, offs
|
||||
movdqa [rD + offs], reg
|
||||
endm
|
||||
|
||||
MY_PROC AesCtr_Code_Intel, 3
|
||||
MY_PROLOG xmm6
|
||||
|
||||
mov r5, r4
|
||||
shr r5, 4
|
||||
dec r5
|
||||
shl r5, 4
|
||||
|
||||
mov DWORD PTR [r5], 1
|
||||
mov DWORD PTR [r5 + 4], 0
|
||||
mov DWORD PTR [r5 + 8], 0
|
||||
mov DWORD PTR [r5 + 12], 0
|
||||
|
||||
add r1, r6
|
||||
neg r6
|
||||
add r6, 32
|
||||
|
||||
jmp check2_c
|
||||
|
||||
align 16
|
||||
nextBlocks2_c:
|
||||
movdqa xmm7, [r5]
|
||||
|
||||
i = 0
|
||||
rept ways
|
||||
paddq xmm6, xmm7
|
||||
movdqa @CatStr(xmm,%i), xmm6
|
||||
i = i + 1
|
||||
endm
|
||||
|
||||
mov r3, r6
|
||||
LOAD_OP_W pxor, -32
|
||||
ENCODE LOAD_OP_W
|
||||
OP_W XOR_UPD_1, i * 16
|
||||
OP_W XOR_UPD_2, i * 16
|
||||
add rD, ways16
|
||||
check2_c:
|
||||
sub rN, ways
|
||||
jnc nextBlocks2_c
|
||||
|
||||
add rN, ways
|
||||
jmp check_c
|
||||
|
||||
nextBlock_c:
|
||||
paddq xmm6, [r5]
|
||||
mov r3, r6
|
||||
movdqa xmm0, [r1 + r3 - 32]
|
||||
pxor xmm0, xmm6
|
||||
ENCODE LOAD_OP
|
||||
XOR_UPD_1 xmm0, 0
|
||||
XOR_UPD_2 xmm0, 0
|
||||
add rD, 16
|
||||
check_c:
|
||||
sub rN, 1
|
||||
jnc nextBlock_c
|
||||
|
||||
movdqa [r1 + r6 - 64], xmm6
|
||||
MY_EPILOG
|
||||
|
||||
end
|
||||
77
C/7zCrc.c
77
C/7zCrc.c
@@ -1,35 +1,74 @@
|
||||
/* 7zCrc.c -- CRC32 calculation
|
||||
2008-08-05
|
||||
Igor Pavlov
|
||||
Public domain */
|
||||
2009-11-23 : Igor Pavlov : Public domain */
|
||||
|
||||
#include "7zCrc.h"
|
||||
#include "CpuArch.h"
|
||||
|
||||
#define kCrcPoly 0xEDB88320
|
||||
UInt32 g_CrcTable[256];
|
||||
|
||||
void MY_FAST_CALL CrcGenerateTable(void)
|
||||
#ifdef MY_CPU_LE
|
||||
#define CRC_NUM_TABLES 8
|
||||
#else
|
||||
#define CRC_NUM_TABLES 1
|
||||
#endif
|
||||
|
||||
typedef UInt32 (MY_FAST_CALL *CRC_FUNC)(UInt32 v, const void *data, size_t size, const UInt32 *table);
|
||||
|
||||
static CRC_FUNC g_CrcUpdate;
|
||||
UInt32 g_CrcTable[256 * CRC_NUM_TABLES];
|
||||
|
||||
#if CRC_NUM_TABLES == 1
|
||||
|
||||
#define CRC_UPDATE_BYTE_2(crc, b) (table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
|
||||
|
||||
static UInt32 MY_FAST_CALL CrcUpdateT1(UInt32 v, const void *data, size_t size, const UInt32 *table)
|
||||
{
|
||||
const Byte *p = (const Byte *)data;
|
||||
for (; size > 0; size--, p++)
|
||||
v = CRC_UPDATE_BYTE_2(v, *p);
|
||||
return v;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
UInt32 MY_FAST_CALL CrcUpdateT4(UInt32 v, const void *data, size_t size, const UInt32 *table);
|
||||
UInt32 MY_FAST_CALL CrcUpdateT8(UInt32 v, const void *data, size_t size, const UInt32 *table);
|
||||
|
||||
#endif
|
||||
|
||||
UInt32 MY_FAST_CALL CrcUpdate(UInt32 v, const void *data, size_t size)
|
||||
{
|
||||
return g_CrcUpdate(v, data, size, g_CrcTable);
|
||||
}
|
||||
|
||||
UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size)
|
||||
{
|
||||
return g_CrcUpdate(CRC_INIT_VAL, data, size, g_CrcTable) ^ CRC_INIT_VAL;
|
||||
}
|
||||
|
||||
void MY_FAST_CALL CrcGenerateTable()
|
||||
{
|
||||
UInt32 i;
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
UInt32 r = i;
|
||||
int j;
|
||||
unsigned j;
|
||||
for (j = 0; j < 8; j++)
|
||||
r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1));
|
||||
g_CrcTable[i] = r;
|
||||
}
|
||||
}
|
||||
|
||||
UInt32 MY_FAST_CALL CrcUpdate(UInt32 v, const void *data, size_t size)
|
||||
{
|
||||
const Byte *p = (const Byte *)data;
|
||||
for (; size > 0 ; size--, p++)
|
||||
v = CRC_UPDATE_BYTE(v, *p);
|
||||
return v;
|
||||
}
|
||||
|
||||
UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size)
|
||||
{
|
||||
return CrcUpdate(CRC_INIT_VAL, data, size) ^ 0xFFFFFFFF;
|
||||
#if CRC_NUM_TABLES == 1
|
||||
g_CrcUpdate = CrcUpdateT1;
|
||||
#else
|
||||
for (; i < 256 * CRC_NUM_TABLES; i++)
|
||||
{
|
||||
UInt32 r = g_CrcTable[i - 256];
|
||||
g_CrcTable[i] = g_CrcTable[r & 0xFF] ^ (r >> 8);
|
||||
}
|
||||
g_CrcUpdate = CrcUpdateT4;
|
||||
#ifdef MY_CPU_X86_OR_AMD64
|
||||
if (!CPU_Is_InOrder())
|
||||
g_CrcUpdate = CrcUpdateT8;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
15
C/7zCrc.h
15
C/7zCrc.h
@@ -1,30 +1,25 @@
|
||||
/* 7zCrc.h -- CRC32 calculation
|
||||
2009-02-07 : Igor Pavlov : Public domain */
|
||||
2009-11-21 : Igor Pavlov : Public domain */
|
||||
|
||||
#ifndef __7Z_CRC_H
|
||||
#define __7Z_CRC_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "Types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
EXTERN_C_BEGIN
|
||||
|
||||
extern UInt32 g_CrcTable[];
|
||||
|
||||
/* Call CrcGenerateTable one time before other CRC functions */
|
||||
void MY_FAST_CALL CrcGenerateTable(void);
|
||||
|
||||
#define CRC_INIT_VAL 0xFFFFFFFF
|
||||
#define CRC_GET_DIGEST(crc) ((crc) ^ 0xFFFFFFFF)
|
||||
#define CRC_GET_DIGEST(crc) ((crc) ^ CRC_INIT_VAL)
|
||||
#define CRC_UPDATE_BYTE(crc, b) (g_CrcTable[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
|
||||
|
||||
UInt32 MY_FAST_CALL CrcUpdate(UInt32 crc, const void *data, size_t size);
|
||||
UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
EXTERN_C_END
|
||||
|
||||
#endif
|
||||
|
||||
34
C/7zCrcOpt.c
Executable file
34
C/7zCrcOpt.c
Executable file
@@ -0,0 +1,34 @@
|
||||
/* 7zCrcOpt.c -- CRC32 calculation : optimized version
|
||||
2009-11-23 : Igor Pavlov : Public domain */
|
||||
|
||||
#include "CpuArch.h"
|
||||
|
||||
#ifdef MY_CPU_LE
|
||||
|
||||
#define CRC_UPDATE_BYTE_2(crc, b) (table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
|
||||
|
||||
UInt32 MY_FAST_CALL CrcUpdateT4(UInt32 v, const void *data, size_t size, const UInt32 *table)
|
||||
{
|
||||
const Byte *p = (const Byte *)data;
|
||||
for (; size > 0 && ((unsigned)(ptrdiff_t)p & 3) != 0; size--, p++)
|
||||
v = CRC_UPDATE_BYTE_2(v, *p);
|
||||
for (; size >= 4; size -= 4, p += 4)
|
||||
{
|
||||
v ^= *(const UInt32 *)p;
|
||||
v =
|
||||
table[0x300 + (v & 0xFF)] ^
|
||||
table[0x200 + ((v >> 8) & 0xFF)] ^
|
||||
table[0x100 + ((v >> 16) & 0xFF)] ^
|
||||
table[0x000 + ((v >> 24))];
|
||||
}
|
||||
for (; size > 0; size--, p++)
|
||||
v = CRC_UPDATE_BYTE_2(v, *p);
|
||||
return v;
|
||||
}
|
||||
|
||||
UInt32 MY_FAST_CALL CrcUpdateT8(UInt32 v, const void *data, size_t size, const UInt32 *table)
|
||||
{
|
||||
return CrcUpdateT4(v, data, size, table);
|
||||
}
|
||||
|
||||
#endif
|
||||
43
C/7zCrcT8.c
43
C/7zCrcT8.c
@@ -1,43 +0,0 @@
|
||||
/* 7zCrcT8.c -- CRC32 calculation with 8 tables
|
||||
2008-03-19
|
||||
Igor Pavlov
|
||||
Public domain */
|
||||
|
||||
#include "7zCrc.h"
|
||||
|
||||
#define kCrcPoly 0xEDB88320
|
||||
#define CRC_NUM_TABLES 8
|
||||
|
||||
UInt32 g_CrcTable[256 * CRC_NUM_TABLES];
|
||||
|
||||
void MY_FAST_CALL CrcGenerateTable()
|
||||
{
|
||||
UInt32 i;
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
UInt32 r = i;
|
||||
int j;
|
||||
for (j = 0; j < 8; j++)
|
||||
r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1));
|
||||
g_CrcTable[i] = r;
|
||||
}
|
||||
#if CRC_NUM_TABLES > 1
|
||||
for (; i < 256 * CRC_NUM_TABLES; i++)
|
||||
{
|
||||
UInt32 r = g_CrcTable[i - 256];
|
||||
g_CrcTable[i] = g_CrcTable[r & 0xFF] ^ (r >> 8);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
UInt32 MY_FAST_CALL CrcUpdateT8(UInt32 v, const void *data, size_t size, const UInt32 *table);
|
||||
|
||||
UInt32 MY_FAST_CALL CrcUpdate(UInt32 v, const void *data, size_t size)
|
||||
{
|
||||
return CrcUpdateT8(v, data, size, g_CrcTable);
|
||||
}
|
||||
|
||||
UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size)
|
||||
{
|
||||
return CrcUpdateT8(CRC_INIT_VAL, data, size, g_CrcTable) ^ 0xFFFFFFFF;
|
||||
}
|
||||
15
C/7zFile.c
15
C/7zFile.c
@@ -1,15 +1,15 @@
|
||||
/* 7zFile.c -- File IO
|
||||
2009-08-16 : Igor Pavlov : Public domain */
|
||||
2009-11-24 : Igor Pavlov : Public domain */
|
||||
|
||||
#include "7zFile.h"
|
||||
|
||||
#ifndef USE_WINDOWS_FILE
|
||||
|
||||
#ifndef UNDER_CE
|
||||
#include <errno.h>
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef USE_WINDOWS_FILE
|
||||
#else
|
||||
|
||||
/*
|
||||
ReadFile and WriteFile functions in Windows have BUG:
|
||||
@@ -34,6 +34,7 @@ void File_Construct(CSzFile *p)
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined(UNDER_CE) || !defined(USE_WINDOWS_FILE)
|
||||
static WRes File_Open(CSzFile *p, const char *name, int writeMode)
|
||||
{
|
||||
#ifdef USE_WINDOWS_FILE
|
||||
@@ -45,12 +46,18 @@ static WRes File_Open(CSzFile *p, const char *name, int writeMode)
|
||||
return (p->handle != INVALID_HANDLE_VALUE) ? 0 : GetLastError();
|
||||
#else
|
||||
p->file = fopen(name, writeMode ? "wb+" : "rb");
|
||||
return (p->file != 0) ? 0 : errno;
|
||||
return (p->file != 0) ? 0 :
|
||||
#ifdef UNDER_CE
|
||||
2; /* ENOENT */
|
||||
#else
|
||||
errno;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
WRes InFile_Open(CSzFile *p, const char *name) { return File_Open(p, name, 0); }
|
||||
WRes OutFile_Open(CSzFile *p, const char *name) { return File_Open(p, name, 1); }
|
||||
#endif
|
||||
|
||||
#ifdef USE_WINDOWS_FILE
|
||||
static WRes File_OpenW(CSzFile *p, const WCHAR *name, int writeMode)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* 7zFile.h -- File IO
|
||||
2009-08-16 : Igor Pavlov : Public domain */
|
||||
2009-11-24 : Igor Pavlov : Public domain */
|
||||
|
||||
#ifndef __7Z_FILE_H
|
||||
#define __7Z_FILE_H
|
||||
@@ -30,8 +30,10 @@ typedef struct
|
||||
} CSzFile;
|
||||
|
||||
void File_Construct(CSzFile *p);
|
||||
#if !defined(UNDER_CE) || !defined(USE_WINDOWS_FILE)
|
||||
WRes InFile_Open(CSzFile *p, const char *name);
|
||||
WRes OutFile_Open(CSzFile *p, const char *name);
|
||||
#endif
|
||||
#ifdef USE_WINDOWS_FILE
|
||||
WRes InFile_OpenW(CSzFile *p, const WCHAR *name);
|
||||
WRes OutFile_OpenW(CSzFile *p, const WCHAR *name);
|
||||
|
||||
3
C/7zIn.c
3
C/7zIn.c
@@ -1,5 +1,5 @@
|
||||
/* 7zIn.c -- 7z Input functions
|
||||
2009-08-17 : Igor Pavlov : Public domain */
|
||||
2009-11-24 : Igor Pavlov : Public domain */
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@@ -1021,6 +1021,7 @@ static SRes SzReadHeader2(
|
||||
MY_ALLOC(size_t, p->FileNameOffsets, numFiles + 1, allocMain);
|
||||
memcpy(p->FileNames.data, sd->Data, namesSize);
|
||||
RINOK(SzReadFileNames(sd->Data, namesSize >> 1, numFiles, p->FileNameOffsets))
|
||||
RINOK(SzSkeepDataSize(sd, namesSize));
|
||||
break;
|
||||
}
|
||||
case k7zIdEmptyStream:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#define MY_VER_MAJOR 9
|
||||
#define MY_VER_MINOR 07
|
||||
#define MY_VER_MINOR 9
|
||||
#define MY_VER_BUILD 0
|
||||
#define MY_VERSION "9.07 beta"
|
||||
#define MY_DATE "2009-08-29"
|
||||
#define MY_VERSION "9.09 beta"
|
||||
#define MY_DATE "2009-12-12"
|
||||
#define MY_COPYRIGHT ": Igor Pavlov : Public domain"
|
||||
#define MY_VERSION_COPYRIGHT_DATE MY_VERSION " " MY_COPYRIGHT " : " MY_DATE
|
||||
|
||||
152
C/Aes.c
152
C/Aes.c
@@ -1,5 +1,5 @@
|
||||
/* Aes.c -- AES encryption / decryption
|
||||
2009-06-10 : Igor Pavlov : Public domain */
|
||||
2009-11-23 : Igor Pavlov : Public domain */
|
||||
|
||||
#include "Aes.h"
|
||||
#include "CpuArch.h"
|
||||
@@ -23,6 +23,18 @@ static Byte Sbox[256] = {
|
||||
0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf,
|
||||
0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16};
|
||||
|
||||
void MY_FAST_CALL AesCbc_Encode(UInt32 *ivAes, Byte *data, size_t numBlocks);
|
||||
void MY_FAST_CALL AesCbc_Decode(UInt32 *ivAes, Byte *data, size_t numBlocks);
|
||||
void MY_FAST_CALL AesCtr_Code(UInt32 *ivAes, Byte *data, size_t numBlocks);
|
||||
|
||||
void MY_FAST_CALL AesCbc_Encode_Intel(UInt32 *ivAes, Byte *data, size_t numBlocks);
|
||||
void MY_FAST_CALL AesCbc_Decode_Intel(UInt32 *ivAes, Byte *data, size_t numBlocks);
|
||||
void MY_FAST_CALL AesCtr_Code_Intel(UInt32 *ivAes, Byte *data, size_t numBlocks);
|
||||
|
||||
AES_CODE_FUNC g_AesCbc_Encode;
|
||||
AES_CODE_FUNC g_AesCbc_Decode;
|
||||
AES_CODE_FUNC g_AesCtr_Code;
|
||||
|
||||
static UInt32 D[256 * 4];
|
||||
static Byte InvS[256];
|
||||
|
||||
@@ -68,6 +80,17 @@ void AesGenTables(void)
|
||||
D[0x300 + i] = Ui32(a9, aD, aB, aE);
|
||||
}
|
||||
}
|
||||
g_AesCbc_Encode = AesCbc_Encode;
|
||||
g_AesCbc_Decode = AesCbc_Decode;
|
||||
g_AesCtr_Code = AesCtr_Code;
|
||||
#ifdef MY_CPU_X86_OR_AMD64
|
||||
if (CPU_Is_Aes_Supported())
|
||||
{
|
||||
g_AesCbc_Encode = AesCbc_Encode_Intel;
|
||||
g_AesCbc_Decode = AesCbc_Decode_Intel;
|
||||
g_AesCtr_Code = AesCtr_Code_Intel;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#define HT(i, x, s) (T + (x << 8))[gb ## x(s[(i + x) & 3])]
|
||||
@@ -102,15 +125,13 @@ void AesGenTables(void)
|
||||
#define FD(i, x) InvS[gb ## x(m[(i - x) & 3])]
|
||||
#define FD4(i) dest[i] = Ui32(FD(i, 0), FD(i, 1), FD(i, 2), FD(i, 3)) ^ w[i];
|
||||
|
||||
void Aes_SetKeyEncode(CAes *p, const Byte *key, unsigned keySize)
|
||||
void MY_FAST_CALL Aes_SetKey_Enc(UInt32 *w, const Byte *key, unsigned keySize)
|
||||
{
|
||||
unsigned i, wSize;
|
||||
UInt32 *w;
|
||||
wSize = keySize + 28;
|
||||
keySize /= 4;
|
||||
p->numRounds2 = keySize / 2 + 3;
|
||||
|
||||
wSize = (p->numRounds2 * 2 + 1) * 4;
|
||||
w = p->rkey;
|
||||
w[0] = ((UInt32)keySize / 2) + 3;
|
||||
w += 4;
|
||||
|
||||
for (i = 0; i < keySize; i++, key += 4)
|
||||
w[i] = GetUi32(key);
|
||||
@@ -127,13 +148,12 @@ void Aes_SetKeyEncode(CAes *p, const Byte *key, unsigned keySize)
|
||||
}
|
||||
}
|
||||
|
||||
void Aes_SetKeyDecode(CAes *p, const Byte *key, unsigned keySize)
|
||||
void MY_FAST_CALL Aes_SetKey_Dec(UInt32 *w, const Byte *key, unsigned keySize)
|
||||
{
|
||||
unsigned i, num;
|
||||
UInt32 *w;
|
||||
Aes_SetKeyEncode(p, key, keySize);
|
||||
num = p->numRounds2 * 8 - 4;
|
||||
w = p->rkey + 4;
|
||||
Aes_SetKey_Enc(w, key, keySize);
|
||||
num = keySize + 20;
|
||||
w += 8;
|
||||
for (i = 0; i < num; i++)
|
||||
{
|
||||
UInt32 r = w[i];
|
||||
@@ -145,10 +165,16 @@ void Aes_SetKeyDecode(CAes *p, const Byte *key, unsigned keySize)
|
||||
}
|
||||
}
|
||||
|
||||
static void AesEncode32(UInt32 *dest, const UInt32 *src, const UInt32 *w, unsigned numRounds2)
|
||||
/* Aes_Encode and Aes_Decode functions work with little-endian words.
|
||||
src and dest are pointers to 4 UInt32 words.
|
||||
arc and dest can point to same block */
|
||||
|
||||
static void Aes_Encode(const UInt32 *w, UInt32 *dest, const UInt32 *src)
|
||||
{
|
||||
UInt32 s[4];
|
||||
UInt32 m[4];
|
||||
UInt32 numRounds2 = w[0];
|
||||
w += 4;
|
||||
s[0] = src[0] ^ w[0];
|
||||
s[1] = src[1] ^ w[1];
|
||||
s[2] = src[2] ^ w[2];
|
||||
@@ -166,11 +192,12 @@ static void AesEncode32(UInt32 *dest, const UInt32 *src, const UInt32 *w, unsign
|
||||
FT4(0); FT4(1); FT4(2); FT4(3);
|
||||
}
|
||||
|
||||
static void AesDecode32(UInt32 *dest, const UInt32 *src, const UInt32 *w, unsigned numRounds2)
|
||||
static void Aes_Decode(const UInt32 *w, UInt32 *dest, const UInt32 *src)
|
||||
{
|
||||
UInt32 s[4];
|
||||
UInt32 m[4];
|
||||
w += numRounds2 * 8;
|
||||
UInt32 numRounds2 = w[0];
|
||||
w += 4 + numRounds2 * 8;
|
||||
s[0] = src[0] ^ w[0];
|
||||
s[1] = src[1] ^ w[1];
|
||||
s[2] = src[2] ^ w[2];
|
||||
@@ -186,75 +213,70 @@ static void AesDecode32(UInt32 *dest, const UInt32 *src, const UInt32 *w, unsign
|
||||
FD4(0); FD4(1); FD4(2); FD4(3);
|
||||
}
|
||||
|
||||
void Aes_Encode32(const CAes *p, UInt32 *dest, const UInt32 *src)
|
||||
{
|
||||
AesEncode32(dest, src, p->rkey, p->numRounds2);
|
||||
}
|
||||
|
||||
void Aes_Decode32(const CAes *p, UInt32 *dest, const UInt32 *src)
|
||||
{
|
||||
AesDecode32(dest, src, p->rkey, p->numRounds2);
|
||||
}
|
||||
|
||||
void AesCbc_Init(CAesCbc *p, const Byte *iv)
|
||||
void AesCbc_Init(UInt32 *p, const Byte *iv)
|
||||
{
|
||||
unsigned i;
|
||||
for (i = 0; i < 4; i++)
|
||||
p->prev[i] = GetUi32(iv + i * 4);
|
||||
p[i] = GetUi32(iv + i * 4);
|
||||
}
|
||||
|
||||
SizeT AesCbc_Encode(CAesCbc *p, Byte *data, SizeT size)
|
||||
void MY_FAST_CALL AesCbc_Encode(UInt32 *p, Byte *data, size_t numBlocks)
|
||||
{
|
||||
SizeT i;
|
||||
if (size == 0)
|
||||
return 0;
|
||||
if (size < AES_BLOCK_SIZE)
|
||||
return AES_BLOCK_SIZE;
|
||||
size -= AES_BLOCK_SIZE;
|
||||
for (i = 0; i <= size; i += AES_BLOCK_SIZE, data += AES_BLOCK_SIZE)
|
||||
for (; numBlocks != 0; numBlocks--, data += AES_BLOCK_SIZE)
|
||||
{
|
||||
p->prev[0] ^= GetUi32(data);
|
||||
p->prev[1] ^= GetUi32(data + 4);
|
||||
p->prev[2] ^= GetUi32(data + 8);
|
||||
p->prev[3] ^= GetUi32(data + 12);
|
||||
p[0] ^= GetUi32(data);
|
||||
p[1] ^= GetUi32(data + 4);
|
||||
p[2] ^= GetUi32(data + 8);
|
||||
p[3] ^= GetUi32(data + 12);
|
||||
|
||||
AesEncode32(p->prev, p->prev, p->aes.rkey, p->aes.numRounds2);
|
||||
Aes_Encode(p + 4, p, p);
|
||||
|
||||
SetUi32(data, p->prev[0]);
|
||||
SetUi32(data + 4, p->prev[1]);
|
||||
SetUi32(data + 8, p->prev[2]);
|
||||
SetUi32(data + 12, p->prev[3]);
|
||||
SetUi32(data, p[0]);
|
||||
SetUi32(data + 4, p[1]);
|
||||
SetUi32(data + 8, p[2]);
|
||||
SetUi32(data + 12, p[3]);
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
SizeT AesCbc_Decode(CAesCbc *p, Byte *data, SizeT size)
|
||||
void MY_FAST_CALL AesCbc_Decode(UInt32 *p, Byte *data, size_t numBlocks)
|
||||
{
|
||||
SizeT i;
|
||||
UInt32 in[4], out[4];
|
||||
if (size == 0)
|
||||
return 0;
|
||||
if (size < AES_BLOCK_SIZE)
|
||||
return AES_BLOCK_SIZE;
|
||||
size -= AES_BLOCK_SIZE;
|
||||
for (i = 0; i <= size; i += AES_BLOCK_SIZE, data += AES_BLOCK_SIZE)
|
||||
for (; numBlocks != 0; numBlocks--, data += AES_BLOCK_SIZE)
|
||||
{
|
||||
in[0] = GetUi32(data);
|
||||
in[1] = GetUi32(data + 4);
|
||||
in[2] = GetUi32(data + 8);
|
||||
in[3] = GetUi32(data + 12);
|
||||
|
||||
Aes_Decode(p + 4, out, in);
|
||||
|
||||
SetUi32(data, p[0] ^ out[0]);
|
||||
SetUi32(data + 4, p[1] ^ out[1]);
|
||||
SetUi32(data + 8, p[2] ^ out[2]);
|
||||
SetUi32(data + 12, p[3] ^ out[3]);
|
||||
|
||||
AesDecode32(out, in, p->aes.rkey, p->aes.numRounds2);
|
||||
|
||||
SetUi32(data, p->prev[0] ^ out[0]);
|
||||
SetUi32(data + 4, p->prev[1] ^ out[1]);
|
||||
SetUi32(data + 8, p->prev[2] ^ out[2]);
|
||||
SetUi32(data + 12, p->prev[3] ^ out[3]);
|
||||
|
||||
p->prev[0] = in[0];
|
||||
p->prev[1] = in[1];
|
||||
p->prev[2] = in[2];
|
||||
p->prev[3] = in[3];
|
||||
p[0] = in[0];
|
||||
p[1] = in[1];
|
||||
p[2] = in[2];
|
||||
p[3] = in[3];
|
||||
}
|
||||
}
|
||||
|
||||
void MY_FAST_CALL AesCtr_Code(UInt32 *p, Byte *data, size_t numBlocks)
|
||||
{
|
||||
for (; numBlocks != 0; numBlocks--)
|
||||
{
|
||||
UInt32 temp[4];
|
||||
Byte buf[16];
|
||||
int i;
|
||||
if (++p[0] == 0)
|
||||
p[1]++;
|
||||
Aes_Encode(p + 4, temp, p);
|
||||
SetUi32(buf, temp[0]);
|
||||
SetUi32(buf + 4, temp[1]);
|
||||
SetUi32(buf + 8, temp[2]);
|
||||
SetUi32(buf + 12, temp[3]);
|
||||
for (i = 0; i < 16; i++)
|
||||
*data++ ^= buf[i];
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
56
C/Aes.h
56
C/Aes.h
@@ -1,54 +1,38 @@
|
||||
/* Aes.h -- AES encryption / decryption
|
||||
2009-02-07 : Igor Pavlov : Public domain */
|
||||
2009-11-23 : Igor Pavlov : Public domain */
|
||||
|
||||
#ifndef __AES_H
|
||||
#define __AES_H
|
||||
|
||||
#include "Types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
EXTERN_C_BEGIN
|
||||
|
||||
#define AES_BLOCK_SIZE 16
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned numRounds2; /* = numRounds / 2 */
|
||||
UInt32 rkey[(14 + 1) * 4];
|
||||
} CAes;
|
||||
|
||||
/* Call AesGenTables one time before other AES functions */
|
||||
void AesGenTables(void);
|
||||
|
||||
/* UInt32 pointers must be 16-byte aligned */
|
||||
|
||||
/* 16-byte (4 * 32-bit words) blocks: 1 (IV) + 1 (keyMode) + 15 (AES-256 roundKeys) */
|
||||
#define AES_NUM_IVMRK_WORDS ((1 + 1 + 15) * 4)
|
||||
|
||||
/* aes - 16-byte aligned pointer to keyMode+roundKeys sequence */
|
||||
/* keySize = 16 or 24 or 32 (bytes) */
|
||||
void Aes_SetKeyEncode(CAes *p, const Byte *key, unsigned keySize);
|
||||
void Aes_SetKeyDecode(CAes *p, const Byte *key, unsigned keySize);
|
||||
typedef void (MY_FAST_CALL *AES_SET_KEY_FUNC)(UInt32 *aes, const Byte *key, unsigned keySize);
|
||||
void MY_FAST_CALL Aes_SetKey_Enc(UInt32 *aes, const Byte *key, unsigned keySize);
|
||||
void MY_FAST_CALL Aes_SetKey_Dec(UInt32 *aes, const Byte *key, unsigned keySize);
|
||||
|
||||
/* Aes_Encode32 and Aes_Decode32 functions work with little-endian words.
|
||||
src and dest are pointers to 4 UInt32 words.
|
||||
arc and dest can point to same block */
|
||||
void Aes_Encode32(const CAes *p, UInt32 *dest, const UInt32 *src);
|
||||
void Aes_Decode32(const CAes *p, UInt32 *dest, const UInt32 *src);
|
||||
/* ivAes - 16-byte aligned pointer to iv+keyMode+roundKeys sequence: UInt32[AES_NUM_IVMRK_WORDS] */
|
||||
void AesCbc_Init(UInt32 *ivAes, const Byte *iv); /* iv size is AES_BLOCK_SIZE */
|
||||
/* data - 16-byte aligned pointer to data */
|
||||
/* numBlocks - the number of 16-byte blocks in data array */
|
||||
typedef void (MY_FAST_CALL *AES_CODE_FUNC)(UInt32 *ivAes, Byte *data, size_t numBlocks);
|
||||
extern AES_CODE_FUNC g_AesCbc_Encode;
|
||||
extern AES_CODE_FUNC g_AesCbc_Decode;
|
||||
extern AES_CODE_FUNC g_AesCtr_Code;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UInt32 prev[4];
|
||||
CAes aes;
|
||||
} CAesCbc;
|
||||
|
||||
void AesCbc_Init(CAesCbc *p, const Byte *iv); /* iv size is AES_BLOCK_SIZE */
|
||||
|
||||
/* AesCbc_Encode and AesCbc_Decode:
|
||||
if (res <= size): Filter have converted res bytes
|
||||
if (res > size): Filter have not converted anything. And it needs at
|
||||
least res = AES_BLOCK_SIZE bytes to convert one block */
|
||||
|
||||
SizeT AesCbc_Encode(CAesCbc *p, Byte *data, SizeT size);
|
||||
SizeT AesCbc_Decode(CAesCbc *p, Byte *data, SizeT size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
EXTERN_C_END
|
||||
|
||||
#endif
|
||||
|
||||
182
C/AesOpt.c
Executable file
182
C/AesOpt.c
Executable file
@@ -0,0 +1,182 @@
|
||||
/* AesOpt.c -- Intel's AES
|
||||
2009-11-23 : Igor Pavlov : Public domain */
|
||||
|
||||
#include "CpuArch.h"
|
||||
|
||||
#ifdef MY_CPU_X86_OR_AMD64
|
||||
#if _MSC_VER >= 1500
|
||||
#define USE_INTEL_AES
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef USE_INTEL_AES
|
||||
|
||||
#include <wmmintrin.h>
|
||||
|
||||
void MY_FAST_CALL AesCbc_Encode_Intel(__m128i *p, __m128i *data, size_t numBlocks)
|
||||
{
|
||||
__m128i m = *p;
|
||||
for (; numBlocks != 0; numBlocks--, data++)
|
||||
{
|
||||
UInt32 numRounds2 = *(const UInt32 *)(p + 1) - 1;
|
||||
const __m128i *w = p + 3;
|
||||
m = _mm_xor_si128(m, *data);
|
||||
m = _mm_xor_si128(m, p[2]);
|
||||
do
|
||||
{
|
||||
m = _mm_aesenc_si128(m, w[0]);
|
||||
m = _mm_aesenc_si128(m, w[1]);
|
||||
w += 2;
|
||||
}
|
||||
while (--numRounds2 != 0);
|
||||
m = _mm_aesenc_si128(m, w[0]);
|
||||
m = _mm_aesenclast_si128(m, w[1]);
|
||||
*data = m;
|
||||
}
|
||||
*p = m;
|
||||
}
|
||||
|
||||
#define NUM_WAYS 3
|
||||
|
||||
#define AES_OP_W(op, n) { \
|
||||
const __m128i t = w[n]; \
|
||||
m0 = op(m0, t); \
|
||||
m1 = op(m1, t); \
|
||||
m2 = op(m2, t); \
|
||||
}
|
||||
|
||||
#define AES_DEC(n) AES_OP_W(_mm_aesdec_si128, n)
|
||||
#define AES_DEC_LAST(n) AES_OP_W(_mm_aesdeclast_si128, n)
|
||||
#define AES_ENC(n) AES_OP_W(_mm_aesenc_si128, n)
|
||||
#define AES_ENC_LAST(n) AES_OP_W(_mm_aesenclast_si128, n)
|
||||
|
||||
void MY_FAST_CALL AesCbc_Decode_Intel(__m128i *p, __m128i *data, size_t numBlocks)
|
||||
{
|
||||
__m128i iv = *p;
|
||||
for (; numBlocks >= NUM_WAYS; numBlocks -= NUM_WAYS, data += NUM_WAYS)
|
||||
{
|
||||
UInt32 numRounds2 = *(const UInt32 *)(p + 1);
|
||||
const __m128i *w = p + numRounds2 * 2;
|
||||
__m128i m0, m1, m2;
|
||||
{
|
||||
const __m128i t = w[2];
|
||||
m0 = _mm_xor_si128(t, data[0]);
|
||||
m1 = _mm_xor_si128(t, data[1]);
|
||||
m2 = _mm_xor_si128(t, data[2]);
|
||||
}
|
||||
numRounds2--;
|
||||
do
|
||||
{
|
||||
AES_DEC(1)
|
||||
AES_DEC(0)
|
||||
w -= 2;
|
||||
}
|
||||
while (--numRounds2 != 0);
|
||||
AES_DEC(1)
|
||||
AES_DEC_LAST(0)
|
||||
|
||||
{
|
||||
__m128i t;
|
||||
t = _mm_xor_si128(m0, iv); iv = data[0]; data[0] = t;
|
||||
t = _mm_xor_si128(m1, iv); iv = data[1]; data[1] = t;
|
||||
t = _mm_xor_si128(m2, iv); iv = data[2]; data[2] = t;
|
||||
}
|
||||
}
|
||||
for (; numBlocks != 0; numBlocks--, data++)
|
||||
{
|
||||
UInt32 numRounds2 = *(const UInt32 *)(p + 1);
|
||||
const __m128i *w = p + numRounds2 * 2;
|
||||
__m128i m = _mm_xor_si128(w[2], *data);
|
||||
numRounds2--;
|
||||
do
|
||||
{
|
||||
m = _mm_aesdec_si128(m, w[1]);
|
||||
m = _mm_aesdec_si128(m, w[0]);
|
||||
w -= 2;
|
||||
}
|
||||
while (--numRounds2 != 0);
|
||||
m = _mm_aesdec_si128(m, w[1]);
|
||||
m = _mm_aesdeclast_si128(m, w[0]);
|
||||
|
||||
m = _mm_xor_si128(m, iv);
|
||||
iv = *data;
|
||||
*data = m;
|
||||
}
|
||||
*p = iv;
|
||||
}
|
||||
|
||||
void MY_FAST_CALL AesCtr_Code_Intel(__m128i *p, __m128i *data, size_t numBlocks)
|
||||
{
|
||||
__m128i ctr = *p;
|
||||
__m128i one;
|
||||
one.m128i_u64[0] = 1;
|
||||
one.m128i_u64[1] = 0;
|
||||
for (; numBlocks >= NUM_WAYS; numBlocks -= NUM_WAYS, data += NUM_WAYS)
|
||||
{
|
||||
UInt32 numRounds2 = *(const UInt32 *)(p + 1) - 1;
|
||||
const __m128i *w = p;
|
||||
__m128i m0, m1, m2;
|
||||
{
|
||||
const __m128i t = w[2];
|
||||
ctr = _mm_add_epi64(ctr, one); m0 = _mm_xor_si128(ctr, t);
|
||||
ctr = _mm_add_epi64(ctr, one); m1 = _mm_xor_si128(ctr, t);
|
||||
ctr = _mm_add_epi64(ctr, one); m2 = _mm_xor_si128(ctr, t);
|
||||
}
|
||||
w += 3;
|
||||
do
|
||||
{
|
||||
AES_ENC(0)
|
||||
AES_ENC(1)
|
||||
w += 2;
|
||||
}
|
||||
while (--numRounds2 != 0);
|
||||
AES_ENC(0)
|
||||
AES_ENC_LAST(1)
|
||||
data[0] = _mm_xor_si128(data[0], m0);
|
||||
data[1] = _mm_xor_si128(data[1], m1);
|
||||
data[2] = _mm_xor_si128(data[2], m2);
|
||||
}
|
||||
for (; numBlocks != 0; numBlocks--, data++)
|
||||
{
|
||||
UInt32 numRounds2 = *(const UInt32 *)(p + 1) - 1;
|
||||
const __m128i *w = p;
|
||||
__m128i m;
|
||||
ctr = _mm_add_epi64(ctr, one);
|
||||
m = _mm_xor_si128(ctr, p[2]);
|
||||
w += 3;
|
||||
do
|
||||
{
|
||||
m = _mm_aesenc_si128(m, w[0]);
|
||||
m = _mm_aesenc_si128(m, w[1]);
|
||||
w += 2;
|
||||
}
|
||||
while (--numRounds2 != 0);
|
||||
m = _mm_aesenc_si128(m, w[0]);
|
||||
m = _mm_aesenclast_si128(m, w[1]);
|
||||
*data = _mm_xor_si128(*data, m);
|
||||
}
|
||||
*p = ctr;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void MY_FAST_CALL AesCbc_Encode(UInt32 *ivAes, Byte *data, size_t numBlocks);
|
||||
void MY_FAST_CALL AesCbc_Decode(UInt32 *ivAes, Byte *data, size_t numBlocks);
|
||||
void MY_FAST_CALL AesCtr_Code(UInt32 *ivAes, Byte *data, size_t numBlocks);
|
||||
|
||||
void MY_FAST_CALL AesCbc_Encode_Intel(UInt32 *p, Byte *data, size_t numBlocks)
|
||||
{
|
||||
AesCbc_Encode(p, data, numBlocks);
|
||||
}
|
||||
|
||||
void MY_FAST_CALL AesCbc_Decode_Intel(UInt32 *p, Byte *data, size_t numBlocks)
|
||||
{
|
||||
AesCbc_Decode(p, data, numBlocks);
|
||||
}
|
||||
|
||||
void MY_FAST_CALL AesCtr_Code_Intel(UInt32 *p, Byte *data, size_t numBlocks)
|
||||
{
|
||||
AesCtr_Code(p, data, numBlocks);
|
||||
}
|
||||
|
||||
#endif
|
||||
168
C/CpuArch.c
Executable file
168
C/CpuArch.c
Executable file
@@ -0,0 +1,168 @@
|
||||
/* CpuArch.c -- CPU specific code
|
||||
2009-12-12: Igor Pavlov : Public domain */
|
||||
|
||||
#include "CpuArch.h"
|
||||
|
||||
#ifdef MY_CPU_X86_OR_AMD64
|
||||
|
||||
#if (defined(_MSC_VER) && !defined(MY_CPU_AMD64)) || defined(__GNUC__)
|
||||
#define USE_ASM
|
||||
#endif
|
||||
|
||||
#if defined(USE_ASM) && !defined(MY_CPU_AMD64)
|
||||
static UInt32 CheckFlag(UInt32 flag)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
__asm pushfd;
|
||||
__asm pop EAX;
|
||||
__asm mov EDX, EAX;
|
||||
__asm xor EAX, flag;
|
||||
__asm push EAX;
|
||||
__asm popfd;
|
||||
__asm pushfd;
|
||||
__asm pop EAX;
|
||||
__asm xor EAX, EDX;
|
||||
__asm push EDX;
|
||||
__asm popfd;
|
||||
__asm and flag, EAX;
|
||||
#else
|
||||
__asm__ __volatile__ (
|
||||
"pushf\n\t"
|
||||
"pop %%EAX\n\t"
|
||||
"movl %%EAX,%%EDX\n\t"
|
||||
"xorl %0,%%EAX\n\t"
|
||||
"push %%EAX\n\t"
|
||||
"popf\n\t"
|
||||
"pushf\n\t"
|
||||
"pop %%EAX\n\t"
|
||||
"xorl %%EDX,%%EAX\n\t"
|
||||
"push %%EDX\n\t"
|
||||
"popf\n\t"
|
||||
"andl %%EAX, %0\n\t":
|
||||
"=c" (flag) : "c" (flag));
|
||||
#endif
|
||||
return flag;
|
||||
}
|
||||
#define CHECK_CPUID_IS_SUPPORTED if (CheckFlag(1 << 18) == 0 || CheckFlag(1 << 21) == 0) return False;
|
||||
#else
|
||||
#define CHECK_CPUID_IS_SUPPORTED
|
||||
#endif
|
||||
|
||||
static void MyCPUID(UInt32 function, UInt32 *a, UInt32 *b, UInt32 *c, UInt32 *d)
|
||||
{
|
||||
#ifdef USE_ASM
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
UInt32 a2, b2, c2, d2;
|
||||
__asm xor EBX, EBX;
|
||||
__asm xor ECX, ECX;
|
||||
__asm xor EDX, EDX;
|
||||
__asm mov EAX, function;
|
||||
__asm cpuid;
|
||||
__asm mov a2, EAX;
|
||||
__asm mov b2, EBX;
|
||||
__asm mov c2, ECX;
|
||||
__asm mov d2, EDX;
|
||||
|
||||
*a = a2;
|
||||
*b = b2;
|
||||
*c = c2;
|
||||
*d = d2;
|
||||
|
||||
#else
|
||||
|
||||
__asm__ __volatile__ (
|
||||
"cpuid"
|
||||
: "=a" (*a) ,
|
||||
"=b" (*b) ,
|
||||
"=c" (*c) ,
|
||||
"=d" (*d)
|
||||
: "0" (function)) ;
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
int CPUInfo[4];
|
||||
__cpuid(CPUInfo, function);
|
||||
*a = CPUInfo[0];
|
||||
*b = CPUInfo[1];
|
||||
*c = CPUInfo[2];
|
||||
*d = CPUInfo[3];
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
Bool x86cpuid_CheckAndRead(Cx86cpuid *p)
|
||||
{
|
||||
CHECK_CPUID_IS_SUPPORTED
|
||||
MyCPUID(0, &p->maxFunc, &p->vendor[0], &p->vendor[2], &p->vendor[1]);
|
||||
MyCPUID(1, &p->ver, &p->b, &p->c, &p->d);
|
||||
return True;
|
||||
}
|
||||
|
||||
static UInt32 kVendors[][3] =
|
||||
{
|
||||
{ 0x756E6547, 0x49656E69, 0x6C65746E},
|
||||
{ 0x68747541, 0x69746E65, 0x444D4163},
|
||||
{ 0x746E6543, 0x48727561, 0x736C7561}
|
||||
};
|
||||
|
||||
int x86cpuid_GetFirm(const Cx86cpuid *p)
|
||||
{
|
||||
unsigned i;
|
||||
for (i = 0; i < sizeof(kVendors) / sizeof(kVendors[i]); i++)
|
||||
{
|
||||
const UInt32 *v = kVendors[i];
|
||||
if (v[0] == p->vendor[0] &&
|
||||
v[1] == p->vendor[1] &&
|
||||
v[2] == p->vendor[2])
|
||||
return (int)i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
Bool CPU_Is_InOrder()
|
||||
{
|
||||
Cx86cpuid p;
|
||||
int firm;
|
||||
UInt32 family, model;
|
||||
if (!x86cpuid_CheckAndRead(&p))
|
||||
return True;
|
||||
family = x86cpuid_GetFamily(&p);
|
||||
model = x86cpuid_GetModel(&p);
|
||||
firm = x86cpuid_GetFirm(&p);
|
||||
switch (firm)
|
||||
{
|
||||
case CPU_FIRM_INTEL: return (family < 6 || (family == 6 && model == 0x100C));
|
||||
case CPU_FIRM_AMD: return (family < 5 || (family == 5 && (model < 6 || model == 0xA)));
|
||||
case CPU_FIRM_VIA: return (family < 6 || (family == 6 && model < 0xF));
|
||||
}
|
||||
return True;
|
||||
}
|
||||
|
||||
#if !defined(MY_CPU_AMD64) && defined(_WIN32)
|
||||
static Bool CPU_Sys_Is_SSE_Supported()
|
||||
{
|
||||
OSVERSIONINFO vi;
|
||||
vi.dwOSVersionInfoSize = sizeof(vi);
|
||||
if (!GetVersionEx(&vi))
|
||||
return False;
|
||||
return (vi.dwMajorVersion >= 5);
|
||||
}
|
||||
#define CHECK_SYS_SSE_SUPPORT if (!CPU_Sys_Is_SSE_Supported()) return False;
|
||||
#else
|
||||
#define CHECK_SYS_SSE_SUPPORT
|
||||
#endif
|
||||
|
||||
Bool CPU_Is_Aes_Supported()
|
||||
{
|
||||
Cx86cpuid p;
|
||||
CHECK_SYS_SSE_SUPPORT
|
||||
if (!x86cpuid_CheckAndRead(&p))
|
||||
return False;
|
||||
return (p.c >> 25) & 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
72
C/CpuArch.h
72
C/CpuArch.h
@@ -1,19 +1,19 @@
|
||||
/* CpuArch.h
|
||||
2009-08-11 : Igor Pavlov : Public domain */
|
||||
/* CpuArch.h -- CPU specific code
|
||||
2009-11-25: Igor Pavlov : Public domain */
|
||||
|
||||
#ifndef __CPU_ARCH_H
|
||||
#define __CPU_ARCH_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include "Types.h"
|
||||
|
||||
EXTERN_C_BEGIN
|
||||
|
||||
/*
|
||||
LITTLE_ENDIAN_UNALIGN means:
|
||||
1) CPU is LITTLE_ENDIAN
|
||||
2) it's allowed to make unaligned memory accesses
|
||||
if LITTLE_ENDIAN_UNALIGN is not defined, it means that we don't know
|
||||
about these properties of platform.
|
||||
MY_CPU_LE means that CPU is LITTLE ENDIAN.
|
||||
If MY_CPU_LE is not defined, we don't know about that property of platform (it can be LITTLE ENDIAN).
|
||||
|
||||
MY_CPU_LE_UNALIGN means that CPU is LITTLE ENDIAN and CPU supports unaligned memory accesses.
|
||||
If MY_CPU_LE_UNALIGN is not defined, we don't know about these properties of platform.
|
||||
*/
|
||||
|
||||
#if defined(_M_X64) || defined(_M_AMD64) || defined(__x86_64__)
|
||||
@@ -28,11 +28,19 @@ about these properties of platform.
|
||||
#define MY_CPU_X86_OR_AMD64
|
||||
#endif
|
||||
|
||||
#if defined(MY_CPU_X86_OR_AMD64)
|
||||
#define LITTLE_ENDIAN_UNALIGN
|
||||
#if defined(_WIN32) && defined(_M_ARM)
|
||||
#define MY_CPU_ARM_LE
|
||||
#endif
|
||||
|
||||
#ifdef LITTLE_ENDIAN_UNALIGN
|
||||
#if defined(MY_CPU_X86_OR_AMD64)
|
||||
#define MY_CPU_LE_UNALIGN
|
||||
#endif
|
||||
|
||||
#if defined(MY_CPU_X86_OR_AMD64) || defined(MY_CPU_ARM_LE)
|
||||
#define MY_CPU_LE
|
||||
#endif
|
||||
|
||||
#ifdef MY_CPU_LE_UNALIGN
|
||||
|
||||
#define GetUi16(p) (*(const UInt16 *)(p))
|
||||
#define GetUi32(p) (*(const UInt32 *)(p))
|
||||
@@ -64,7 +72,7 @@ about these properties of platform.
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(LITTLE_ENDIAN_UNALIGN) && defined(_WIN64) && (_MSC_VER >= 1300)
|
||||
#if defined(MY_CPU_LE_UNALIGN) && defined(_WIN64) && (_MSC_VER >= 1300)
|
||||
|
||||
#pragma intrinsic(_byteswap_ulong)
|
||||
#pragma intrinsic(_byteswap_uint64)
|
||||
@@ -85,8 +93,38 @@ about these properties of platform.
|
||||
|
||||
#define GetBe16(p) (((UInt16)((const Byte *)(p))[0] << 8) | ((const Byte *)(p))[1])
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MY_CPU_X86_OR_AMD64
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UInt32 maxFunc;
|
||||
UInt32 vendor[3];
|
||||
UInt32 ver;
|
||||
UInt32 b;
|
||||
UInt32 c;
|
||||
UInt32 d;
|
||||
} Cx86cpuid;
|
||||
|
||||
enum
|
||||
{
|
||||
CPU_FIRM_INTEL,
|
||||
CPU_FIRM_AMD,
|
||||
CPU_FIRM_VIA
|
||||
};
|
||||
|
||||
Bool x86cpuid_CheckAndRead(Cx86cpuid *p);
|
||||
int x86cpuid_GetFirm(const Cx86cpuid *p);
|
||||
|
||||
#define x86cpuid_GetFamily(p) (((p)->ver >> 8) & 0xFF00F)
|
||||
#define x86cpuid_GetModel(p) (((p)->ver >> 4) & 0xF00F)
|
||||
#define x86cpuid_GetStepping(p) ((p)->ver & 0xF)
|
||||
|
||||
Bool CPU_Is_InOrder();
|
||||
Bool CPU_Is_Aes_Supported();
|
||||
|
||||
#endif
|
||||
|
||||
EXTERN_C_END
|
||||
|
||||
#endif
|
||||
|
||||
10
C/HuffEnc.c
10
C/HuffEnc.c
@@ -1,7 +1,5 @@
|
||||
/* HuffEnc.c -- functions for Huffman encoding
|
||||
2008-08-05
|
||||
Igor Pavlov
|
||||
Public domain */
|
||||
2009-09-02 : Igor Pavlov : Public domain */
|
||||
|
||||
#include "HuffEnc.h"
|
||||
#include "Sort.h"
|
||||
@@ -67,11 +65,11 @@ void Huffman_Generate(const UInt32 *freqs, UInt32 *p, Byte *lens, UInt32 numSymb
|
||||
|
||||
if (num < 2)
|
||||
{
|
||||
int minCode = 0;
|
||||
int maxCode = 1;
|
||||
unsigned minCode = 0;
|
||||
unsigned maxCode = 1;
|
||||
if (num == 1)
|
||||
{
|
||||
maxCode = (int)(p[0] & MASK);
|
||||
maxCode = (unsigned)p[0] & MASK;
|
||||
if (maxCode == 0)
|
||||
maxCode++;
|
||||
}
|
||||
|
||||
24
C/LzFindMt.c
24
C/LzFindMt.c
@@ -1,5 +1,5 @@
|
||||
/* LzFindMt.c -- multithreaded Match finder for LZ algorithms
|
||||
2009-05-26 : Igor Pavlov : Public domain */
|
||||
2009-09-20 : Igor Pavlov : Public domain */
|
||||
|
||||
#include "LzHash.h"
|
||||
|
||||
@@ -711,47 +711,47 @@ UInt32 MatchFinderMt_GetMatches(CMatchFinderMt *p, UInt32 *distances)
|
||||
return len;
|
||||
}
|
||||
|
||||
#define SKIP_HEADER2 do { GET_NEXT_BLOCK_IF_REQUIRED
|
||||
#define SKIP_HEADER(n) SKIP_HEADER2 if (p->btNumAvailBytes-- >= (n)) { const Byte *cur = p->pointerToCurPos; UInt32 *hash = p->hash;
|
||||
#define SKIP_FOOTER } INCREASE_LZ_POS p->btBufPos += p->btBuf[p->btBufPos] + 1; } while (--num != 0);
|
||||
#define SKIP_HEADER2_MT do { GET_NEXT_BLOCK_IF_REQUIRED
|
||||
#define SKIP_HEADER_MT(n) SKIP_HEADER2_MT if (p->btNumAvailBytes-- >= (n)) { const Byte *cur = p->pointerToCurPos; UInt32 *hash = p->hash;
|
||||
#define SKIP_FOOTER_MT } INCREASE_LZ_POS p->btBufPos += p->btBuf[p->btBufPos] + 1; } while (--num != 0);
|
||||
|
||||
void MatchFinderMt0_Skip(CMatchFinderMt *p, UInt32 num)
|
||||
{
|
||||
SKIP_HEADER2 { p->btNumAvailBytes--;
|
||||
SKIP_FOOTER
|
||||
SKIP_HEADER2_MT { p->btNumAvailBytes--;
|
||||
SKIP_FOOTER_MT
|
||||
}
|
||||
|
||||
void MatchFinderMt2_Skip(CMatchFinderMt *p, UInt32 num)
|
||||
{
|
||||
SKIP_HEADER(2)
|
||||
SKIP_HEADER_MT(2)
|
||||
UInt32 hash2Value;
|
||||
MT_HASH2_CALC
|
||||
hash[hash2Value] = p->lzPos;
|
||||
SKIP_FOOTER
|
||||
SKIP_FOOTER_MT
|
||||
}
|
||||
|
||||
void MatchFinderMt3_Skip(CMatchFinderMt *p, UInt32 num)
|
||||
{
|
||||
SKIP_HEADER(3)
|
||||
SKIP_HEADER_MT(3)
|
||||
UInt32 hash2Value, hash3Value;
|
||||
MT_HASH3_CALC
|
||||
hash[kFix3HashSize + hash3Value] =
|
||||
hash[ hash2Value] =
|
||||
p->lzPos;
|
||||
SKIP_FOOTER
|
||||
SKIP_FOOTER_MT
|
||||
}
|
||||
|
||||
/*
|
||||
void MatchFinderMt4_Skip(CMatchFinderMt *p, UInt32 num)
|
||||
{
|
||||
SKIP_HEADER(4)
|
||||
SKIP_HEADER_MT(4)
|
||||
UInt32 hash2Value, hash3Value, hash4Value;
|
||||
MT_HASH4_CALC
|
||||
hash[kFix4HashSize + hash4Value] =
|
||||
hash[kFix3HashSize + hash3Value] =
|
||||
hash[ hash2Value] =
|
||||
p->lzPos;
|
||||
SKIP_FOOTER
|
||||
SKIP_FOOTER_MT
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
22
C/Lzma2Enc.c
22
C/Lzma2Enc.c
@@ -1,14 +1,14 @@
|
||||
/* Lzma2Enc.c -- LZMA2 Encoder
|
||||
2009-05-26 : Igor Pavlov : Public domain */
|
||||
2009-11-24 : Igor Pavlov : Public domain */
|
||||
|
||||
/* #include <stdio.h> */
|
||||
#include <string.h>
|
||||
|
||||
/* #define _7ZIP_ST */
|
||||
|
||||
#include "Lzma2Enc.h"
|
||||
|
||||
/* #define COMPRESS_MT */
|
||||
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
#include "MtCoder.h"
|
||||
#else
|
||||
#define NUM_MT_CODER_THREADS_MAX 1
|
||||
@@ -195,7 +195,7 @@ typedef struct _CLzma2Enc
|
||||
|
||||
CLzma2EncInt coders[NUM_MT_CODER_THREADS_MAX];
|
||||
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
CMtCoder mtCoder;
|
||||
#endif
|
||||
|
||||
@@ -242,7 +242,7 @@ static SRes Lzma2Enc_EncodeMt1(CLzma2EncInt *p, CLzma2Enc *mainEncoder,
|
||||
return res;
|
||||
}
|
||||
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -322,7 +322,7 @@ CLzma2EncHandle Lzma2Enc_Create(ISzAlloc *alloc, ISzAlloc *allocBig)
|
||||
for (i = 0; i < NUM_MT_CODER_THREADS_MAX; i++)
|
||||
p->coders[i].enc = 0;
|
||||
}
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
MtCoder_Construct(&p->mtCoder);
|
||||
#endif
|
||||
|
||||
@@ -343,7 +343,7 @@ void Lzma2Enc_Destroy(CLzma2EncHandle pp)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
MtCoder_Destruct(&p->mtCoder);
|
||||
#endif
|
||||
|
||||
@@ -363,7 +363,7 @@ void Lzma2EncProps_Normalize(CLzma2EncProps *p)
|
||||
t2 = p->numBlockThreads;
|
||||
t3 = p->numTotalThreads;
|
||||
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
if (t2 > NUM_MT_CODER_THREADS_MAX)
|
||||
t2 = NUM_MT_CODER_THREADS_MAX;
|
||||
#else
|
||||
@@ -455,12 +455,12 @@ SRes Lzma2Enc_Encode(CLzma2EncHandle pp,
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
if (p->props.numBlockThreads <= 1)
|
||||
#endif
|
||||
return Lzma2Enc_EncodeMt1(&p->coders[0], p, outStream, inStream, progress);
|
||||
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
|
||||
{
|
||||
CMtCallbackImp mtCallback;
|
||||
|
||||
14
C/LzmaDec.c
14
C/LzmaDec.c
@@ -1,5 +1,5 @@
|
||||
/* LzmaDec.c -- LZMA Decoder
|
||||
2008-11-06 : Igor Pavlov : Public domain */
|
||||
2009-09-20 : Igor Pavlov : Public domain */
|
||||
|
||||
#include "LzmaDec.h"
|
||||
|
||||
@@ -113,12 +113,6 @@
|
||||
StopCompilingDueBUG
|
||||
#endif
|
||||
|
||||
static const Byte kLiteralNextStates[kNumStates * 2] =
|
||||
{
|
||||
0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5,
|
||||
7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10
|
||||
};
|
||||
|
||||
#define LZMA_DIC_MIN (1 << 12)
|
||||
|
||||
/* First LZMA-symbol is always decoded.
|
||||
@@ -175,6 +169,7 @@ static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte
|
||||
|
||||
if (state < kNumLitStates)
|
||||
{
|
||||
state -= (state < 4) ? state : 3;
|
||||
symbol = 1;
|
||||
do { GET_BIT(prob + symbol, symbol) } while (symbol < 0x100);
|
||||
}
|
||||
@@ -182,6 +177,7 @@ static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte
|
||||
{
|
||||
unsigned matchByte = p->dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)];
|
||||
unsigned offs = 0x100;
|
||||
state -= (state < 10) ? 3 : 6;
|
||||
symbol = 1;
|
||||
do
|
||||
{
|
||||
@@ -196,9 +192,6 @@ static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte
|
||||
}
|
||||
dic[dicPos++] = (Byte)symbol;
|
||||
processedPos++;
|
||||
|
||||
state = kLiteralNextStates[state];
|
||||
/* if (state < 4) state = 0; else if (state < 10) state -= 3; else state -= 6; */
|
||||
continue;
|
||||
}
|
||||
else
|
||||
@@ -378,7 +371,6 @@ static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte
|
||||
else if (distance >= checkDicSize)
|
||||
return SZ_ERROR_DATA;
|
||||
state = (state < kNumStates + kNumLitStates) ? kNumLitStates : kNumLitStates + 3;
|
||||
/* state = kLiteralNextStates[state]; */
|
||||
}
|
||||
|
||||
len += kMatchMinLen;
|
||||
|
||||
26
C/LzmaEnc.c
26
C/LzmaEnc.c
@@ -1,5 +1,5 @@
|
||||
/* LzmaEnc.c -- LZMA Encoder
|
||||
2009-04-22 : Igor Pavlov : Public domain */
|
||||
2009-11-24 : Igor Pavlov : Public domain */
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "LzmaEnc.h"
|
||||
|
||||
#include "LzFind.h"
|
||||
#ifdef COMPRESS_MF_MT
|
||||
#ifndef _7ZIP_ST
|
||||
#include "LzFindMt.h"
|
||||
#endif
|
||||
|
||||
@@ -66,7 +66,7 @@ void LzmaEncProps_Normalize(CLzmaEncProps *p)
|
||||
if (p->mc == 0) p->mc = (16 + (p->fb >> 1)) >> (p->btMode ? 0 : 1);
|
||||
if (p->numThreads < 0)
|
||||
p->numThreads =
|
||||
#ifdef COMPRESS_MF_MT
|
||||
#ifndef _7ZIP_ST
|
||||
((p->btMode && p->algo) ? 2 : 1);
|
||||
#else
|
||||
1;
|
||||
@@ -172,7 +172,7 @@ typedef struct
|
||||
#define kEndPosModelIndex 14
|
||||
#define kNumPosModels (kEndPosModelIndex - kStartPosModelIndex)
|
||||
|
||||
#define kNumFullDistances (1 << (kEndPosModelIndex / 2))
|
||||
#define kNumFullDistances (1 << (kEndPosModelIndex >> 1))
|
||||
|
||||
#ifdef _LZMA_PROB32
|
||||
#define CLzmaProb UInt32
|
||||
@@ -259,14 +259,14 @@ typedef struct
|
||||
IMatchFinder matchFinder;
|
||||
void *matchFinderObj;
|
||||
|
||||
#ifdef COMPRESS_MF_MT
|
||||
#ifndef _7ZIP_ST
|
||||
Bool mtMode;
|
||||
CMatchFinderMt matchFinderMt;
|
||||
#endif
|
||||
|
||||
CMatchFinder matchFinderBase;
|
||||
|
||||
#ifdef COMPRESS_MF_MT
|
||||
#ifndef _7ZIP_ST
|
||||
Byte pad[128];
|
||||
#endif
|
||||
|
||||
@@ -428,7 +428,7 @@ SRes LzmaEnc_SetProps(CLzmaEncHandle pp, const CLzmaEncProps *props2)
|
||||
|
||||
p->writeEndMark = props.writeEndMark;
|
||||
|
||||
#ifdef COMPRESS_MF_MT
|
||||
#ifndef _7ZIP_ST
|
||||
/*
|
||||
if (newMultiThread != _multiThread)
|
||||
{
|
||||
@@ -1677,7 +1677,7 @@ void LzmaEnc_Construct(CLzmaEnc *p)
|
||||
{
|
||||
RangeEnc_Construct(&p->rc);
|
||||
MatchFinder_Construct(&p->matchFinderBase);
|
||||
#ifdef COMPRESS_MF_MT
|
||||
#ifndef _7ZIP_ST
|
||||
MatchFinderMt_Construct(&p->matchFinderMt);
|
||||
p->matchFinderMt.MatchFinder = &p->matchFinderBase;
|
||||
#endif
|
||||
@@ -1716,7 +1716,7 @@ void LzmaEnc_FreeLits(CLzmaEnc *p, ISzAlloc *alloc)
|
||||
|
||||
void LzmaEnc_Destruct(CLzmaEnc *p, ISzAlloc *alloc, ISzAlloc *allocBig)
|
||||
{
|
||||
#ifdef COMPRESS_MF_MT
|
||||
#ifndef _7ZIP_ST
|
||||
MatchFinderMt_Destruct(&p->matchFinderMt, allocBig);
|
||||
#endif
|
||||
MatchFinder_Free(&p->matchFinderBase, allocBig);
|
||||
@@ -1901,7 +1901,7 @@ static SRes LzmaEnc_Alloc(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, I
|
||||
if (!RangeEnc_Alloc(&p->rc, alloc))
|
||||
return SZ_ERROR_MEM;
|
||||
btMode = (p->matchFinderBase.btMode != 0);
|
||||
#ifdef COMPRESS_MF_MT
|
||||
#ifndef _7ZIP_ST
|
||||
p->mtMode = (p->multiThread && !p->fastMode && btMode);
|
||||
#endif
|
||||
|
||||
@@ -1926,7 +1926,7 @@ static SRes LzmaEnc_Alloc(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, I
|
||||
if (beforeSize + p->dictSize < keepWindowSize)
|
||||
beforeSize = keepWindowSize - p->dictSize;
|
||||
|
||||
#ifdef COMPRESS_MF_MT
|
||||
#ifndef _7ZIP_ST
|
||||
if (p->mtMode)
|
||||
{
|
||||
RINOK(MatchFinderMt_Create(&p->matchFinderMt, p->dictSize, beforeSize, p->numFastBytes, LZMA_MATCH_LEN_MAX, allocBig));
|
||||
@@ -2073,7 +2073,7 @@ SRes LzmaEnc_MemPrepare(CLzmaEncHandle pp, const Byte *src, SizeT srcLen,
|
||||
|
||||
void LzmaEnc_Finish(CLzmaEncHandle pp)
|
||||
{
|
||||
#ifdef COMPRESS_MF_MT
|
||||
#ifndef _7ZIP_ST
|
||||
CLzmaEnc *p = (CLzmaEnc *)pp;
|
||||
if (p->mtMode)
|
||||
MatchFinderMt_ReleaseStream(&p->matchFinderMt);
|
||||
@@ -2155,7 +2155,7 @@ static SRes LzmaEnc_Encode2(CLzmaEnc *p, ICompressProgress *progress)
|
||||
{
|
||||
SRes res = SZ_OK;
|
||||
|
||||
#ifdef COMPRESS_MF_MT
|
||||
#ifndef _7ZIP_ST
|
||||
Byte allocaDummy[0x300];
|
||||
int i = 0;
|
||||
for (i = 0; i < 16; i++)
|
||||
|
||||
12
C/MtCoder.h
12
C/MtCoder.h
@@ -1,14 +1,12 @@
|
||||
/* MtCoder.h -- Multi-thread Coder
|
||||
2009-03-26 : Igor Pavlov : Public domain */
|
||||
2009-11-19 : Igor Pavlov : Public domain */
|
||||
|
||||
#ifndef __MT_CODER_H
|
||||
#define __MT_CODER_H
|
||||
|
||||
#include "Threads.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
EXTERN_C_BEGIN
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -29,7 +27,7 @@ WRes LoopThread_StopAndWait(CLoopThread *p);
|
||||
WRes LoopThread_StartSubThread(CLoopThread *p);
|
||||
WRes LoopThread_WaitSubThread(CLoopThread *p);
|
||||
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
#define NUM_MT_CODER_THREADS_MAX 32
|
||||
#else
|
||||
#define NUM_MT_CODER_THREADS_MAX 1
|
||||
@@ -95,8 +93,6 @@ void MtCoder_Construct(CMtCoder* p);
|
||||
void MtCoder_Destruct(CMtCoder* p);
|
||||
SRes MtCoder_Code(CMtCoder *p);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
EXTERN_C_END
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Threads.c -- multithreading library
|
||||
2009-07-20 : Igor Pavlov : Public domain */
|
||||
2009-09-20 : Igor Pavlov : Public domain */
|
||||
|
||||
#ifndef _WIN32_WCE
|
||||
#include <process.h>
|
||||
@@ -70,11 +70,15 @@ WRes Semaphore_Release1(CSemaphore *p) { return Semaphore_ReleaseN(p, 1); }
|
||||
WRes CriticalSection_Init(CCriticalSection *p)
|
||||
{
|
||||
/* InitializeCriticalSection can raise only STATUS_NO_MEMORY exception */
|
||||
#ifdef _MSC_VER
|
||||
__try
|
||||
#endif
|
||||
{
|
||||
InitializeCriticalSection(p);
|
||||
/* InitializeCriticalSectionAndSpinCount(p, 0); */
|
||||
}
|
||||
#ifdef _MSC_VER
|
||||
__except (EXCEPTION_EXECUTE_HANDLER) { return 1; }
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
12
C/Types.h
12
C/Types.h
@@ -1,5 +1,5 @@
|
||||
/* Types.h -- Basic types
|
||||
2009-08-14 : Igor Pavlov : Public domain */
|
||||
2009-11-23 : Igor Pavlov : Public domain */
|
||||
|
||||
#ifndef __7Z_TYPES_H
|
||||
#define __7Z_TYPES_H
|
||||
@@ -95,6 +95,12 @@ typedef int Bool;
|
||||
#define False 0
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
#define MY_STD_CALL __stdcall
|
||||
#else
|
||||
#define MY_STD_CALL
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
#if _MSC_VER >= 1300
|
||||
@@ -104,13 +110,11 @@ typedef int Bool;
|
||||
#endif
|
||||
|
||||
#define MY_CDECL __cdecl
|
||||
#define MY_STD_CALL __stdcall
|
||||
#define MY_FAST_CALL MY_NO_INLINE __fastcall
|
||||
#define MY_FAST_CALL __fastcall
|
||||
|
||||
#else
|
||||
|
||||
#define MY_CDECL
|
||||
#define MY_STD_CALL
|
||||
#define MY_FAST_CALL
|
||||
|
||||
#endif
|
||||
|
||||
@@ -88,6 +88,10 @@ LINK32=link.exe
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\7z.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\7zBuf.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -104,6 +108,14 @@ SOURCE=..\..\7zCrc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\7zCrcOpt.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\7zDec.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\7zFile.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -112,6 +124,10 @@ SOURCE=..\..\7zFile.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\7zIn.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\7zStream.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -132,6 +148,10 @@ SOURCE=..\..\Bra86.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\CpuArch.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\CpuArch.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -157,10 +177,6 @@ SOURCE=..\..\Types.h
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\7z.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\7zAlloc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -169,14 +185,6 @@ SOURCE=.\7zAlloc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\7zDec.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\7zIn.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\7zMain.c
|
||||
# End Source File
|
||||
# End Target
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/* 7zMain.c - Test application for 7z Decoder
|
||||
2009-08-17 : Igor Pavlov : Public domain */
|
||||
2009-11-24 : Igor Pavlov : Public domain */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -70,7 +69,7 @@ static Bool Utf16_To_Utf8(Byte *dest, size_t *destLen, const UInt16 *src, size_t
|
||||
c2 = src[srcPos++];
|
||||
if (c2 < 0xDC00 || c2 >= 0xE000)
|
||||
break;
|
||||
value = ((value - 0xD800) << 10) | (c2 - 0xDC00);
|
||||
value = (((value - 0xD800) << 10) | (c2 - 0xDC00)) + 0x10000;
|
||||
}
|
||||
for (numAdds = 1; numAdds < 5; numAdds++)
|
||||
if (value < (((UInt32)1) << (numAdds * 5 + 6)))
|
||||
|
||||
@@ -6,12 +6,14 @@ C_OBJS = \
|
||||
$O\7zBuf.obj \
|
||||
$O\7zBuf2.obj \
|
||||
$O\7zCrc.obj \
|
||||
$O\7zCrcOpt.obj \
|
||||
$O\7zFile.obj \
|
||||
$O\7zDec.obj \
|
||||
$O\7zIn.obj \
|
||||
$O\7zStream.obj \
|
||||
$O\Bcj2.obj \
|
||||
$O\Bra86.obj \
|
||||
$O\CpuArch.obj \
|
||||
$O\Lzma2Dec.obj \
|
||||
$O\LzmaDec.obj \
|
||||
|
||||
|
||||
@@ -4,13 +4,16 @@ LIB =
|
||||
RM = rm -f
|
||||
CFLAGS = -c -O2 -Wall
|
||||
|
||||
OBJS = 7zAlloc.o 7zBuf.o 7zBuf2.o 7zCrc.o 7zDec.o 7zIn.o 7zMain.o LzmaDec.o Lzma2Dec.o Bra86.o Bcj2.o 7zFile.o 7zStream.o
|
||||
OBJS = 7zMain.o 7zAlloc.o 7zBuf.o 7zBuf2.o 7zCrc.o 7zCrcOpt.o 7zDec.o 7zIn.o CpuArch.o LzmaDec.o Lzma2Dec.o Bra86.o Bcj2.o 7zFile.o 7zStream.o
|
||||
|
||||
all: $(PROG)
|
||||
|
||||
$(PROG): $(OBJS)
|
||||
$(CXX) -o $(PROG) $(LDFLAGS) $(OBJS) $(LIB)
|
||||
|
||||
7zMain.o: 7zMain.c
|
||||
$(CXX) $(CFLAGS) 7zMain.c
|
||||
|
||||
7zAlloc.o: 7zAlloc.c
|
||||
$(CXX) $(CFLAGS) 7zAlloc.c
|
||||
|
||||
@@ -23,14 +26,17 @@ $(PROG): $(OBJS)
|
||||
7zCrc.o: ../../7zCrc.c
|
||||
$(CXX) $(CFLAGS) ../../7zCrc.c
|
||||
|
||||
7zCrcOpt.o: ../../7zCrc.c
|
||||
$(CXX) $(CFLAGS) ../../7zCrcOpt.c
|
||||
|
||||
7zDec.o: ../../7zDec.c
|
||||
$(CXX) $(CFLAGS) ../../7zDec.c
|
||||
|
||||
7zIn.o: ../../7zIn.c
|
||||
$(CXX) $(CFLAGS) ../../7zIn.c
|
||||
|
||||
7zMain.o: 7zMain.c
|
||||
$(CXX) $(CFLAGS) 7zMain.c
|
||||
CpuArch.o: ../../CpuArch.c
|
||||
$(CXX) $(CFLAGS) ../../CpuArch.c
|
||||
|
||||
LzmaDec.o: ../../LzmaDec.c
|
||||
$(CXX) $(CFLAGS) ../../LzmaDec.c
|
||||
|
||||
@@ -2,7 +2,6 @@ MY_STATIC_LINK=1
|
||||
PROG = LZMAc.exe
|
||||
|
||||
CFLAGS = $(CFLAGS) \
|
||||
-DCOMPRESS_MF_MT \
|
||||
|
||||
LIB_OBJS = \
|
||||
$O\LzmaUtil.obj \
|
||||
|
||||
@@ -2,7 +2,7 @@ PROG = lzma
|
||||
CXX = g++
|
||||
LIB =
|
||||
RM = rm -f
|
||||
CFLAGS = -c -O2 -Wall
|
||||
CFLAGS = -c -O2 -Wall -D_7ZIP_ST
|
||||
|
||||
OBJS = \
|
||||
LzmaUtil.o \
|
||||
|
||||
@@ -43,7 +43,7 @@ RSC=rc.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LZMALIB_EXPORTS" /YX /FD /c
|
||||
# ADD CPP /nologo /Gr /MT /W3 /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LZMALIB_EXPORTS" /D "COMPRESS_MF_MT" /FD /c
|
||||
# ADD CPP /nologo /Gr /MT /W3 /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LZMALIB_EXPORTS" /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
|
||||
@@ -5,7 +5,6 @@ SLIBPATH = $O\$(SLIB)
|
||||
|
||||
DEF_FILE = LzmaLib.def
|
||||
CFLAGS = $(CFLAGS) \
|
||||
-DCOMPRESS_MF_MT \
|
||||
|
||||
LIB_OBJS = \
|
||||
$O\LzmaLibExports.obj \
|
||||
|
||||
7
CPP/7zip/Aes.mak
Executable file
7
CPP/7zip/Aes.mak
Executable file
@@ -0,0 +1,7 @@
|
||||
C_OBJS = $(C_OBJS) \
|
||||
$O\Aes.obj
|
||||
|
||||
!IF "$(CPU)" != "IA64" && "$(CPU)" != "MIPS" && "$(CPU)" != "ARM"
|
||||
ASM_OBJS = $(ASM_OBJS) \
|
||||
$O\AesOpt.obj
|
||||
!ENDIF
|
||||
@@ -43,7 +43,7 @@ RSC=rc.exe
|
||||
# PROP Ignore_Export_Lib 1
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MY7Z_EXPORTS" /YX /FD /c
|
||||
# ADD CPP /nologo /Gz /MD /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MY7Z_EXPORTS" /D "COMPRESS_MT" /D "EXTERNAL_CODECS" /Yu"StdAfx.h" /FD /c
|
||||
# ADD CPP /nologo /Gz /MD /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MY7Z_EXPORTS" /D "EXTERNAL_CODECS" /Yu"StdAfx.h" /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x419 /d "NDEBUG"
|
||||
@@ -70,7 +70,7 @@ LINK32=link.exe
|
||||
# PROP Ignore_Export_Lib 1
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MY7Z_EXPORTS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /Gz /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\\" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MY7Z_EXPORTS" /D "COMPRESS_MT" /D "EXTERNAL_CODECS" /Yu"StdAfx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /Gz /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\\" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MY7Z_EXPORTS" /D "EXTERNAL_CODECS" /Yu"StdAfx.h" /FD /GZ /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x419 /d "_DEBUG"
|
||||
@@ -619,6 +619,11 @@ SOURCE=..\..\..\..\C\7zCrc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\7zCrcOpt.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\Alloc.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
@@ -628,6 +633,11 @@ SOURCE=..\..\..\..\C\Alloc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\CpuArch.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\Threads.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
|
||||
@@ -31,7 +31,7 @@ struct CCompressionMethodMode
|
||||
{
|
||||
CObjectVector<CMethodFull> Methods;
|
||||
CRecordVector<CBind> Binds;
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
UInt32 NumThreads;
|
||||
#endif
|
||||
bool PasswordIsDefined;
|
||||
@@ -39,7 +39,7 @@ struct CCompressionMethodMode
|
||||
|
||||
bool IsEmpty() const { return (Methods.IsEmpty() && !PasswordIsDefined); }
|
||||
CCompressionMethodMode(): PasswordIsDefined(false)
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
, NumThreads(1)
|
||||
#endif
|
||||
{}
|
||||
|
||||
@@ -97,7 +97,7 @@ HRESULT CDecoder::Decode(
|
||||
#ifndef _NO_CRYPTO
|
||||
, ICryptoGetTextPassword *getTextPassword, bool &passwordIsDefined
|
||||
#endif
|
||||
#ifdef COMPRESS_MT
|
||||
#if !defined(_7ZIP_ST) && !defined(_SFX)
|
||||
, bool mtMode, UInt32 numThreads
|
||||
#endif
|
||||
)
|
||||
@@ -239,7 +239,7 @@ HRESULT CDecoder::Decode(
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef COMPRESS_MT
|
||||
#if !defined(_7ZIP_ST) && !defined(_SFX)
|
||||
if (mtMode)
|
||||
{
|
||||
CMyComPtr<ICompressSetCoderMt> setCoderMt;
|
||||
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
#ifndef _NO_CRYPTO
|
||||
, ICryptoGetTextPassword *getTextPasswordSpec, bool &passwordIsDefined
|
||||
#endif
|
||||
#ifdef COMPRESS_MT
|
||||
#if !defined(_7ZIP_ST) && !defined(_SFX)
|
||||
, bool mtMode, UInt32 numThreads
|
||||
#endif
|
||||
);
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
static const UInt64 k_Delta = 0x03;
|
||||
static const UInt64 k_BCJ = 0x03030103;
|
||||
static const UInt64 k_BCJ2 = 0x0303011B;
|
||||
static const UInt64 k_AES = 0x06F10701;
|
||||
|
||||
namespace NArchive {
|
||||
namespace N7z {
|
||||
@@ -76,7 +75,7 @@ HRESULT CEncoder::CreateMixerCoder(
|
||||
|
||||
CMyComPtr<IUnknown> encoderCommon = encoder ? (IUnknown *)encoder : (IUnknown *)encoder2;
|
||||
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
{
|
||||
CMyComPtr<ICompressSetCoderMt> setCoderMt;
|
||||
encoderCommon.QueryInterface(IID_ICompressSetCoderMt, &setCoderMt);
|
||||
|
||||
@@ -237,7 +237,7 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
|
||||
#ifndef _NO_CRYPTO
|
||||
, getTextPassword, passwordIsDefined
|
||||
#endif
|
||||
#ifdef COMPRESS_MT
|
||||
#if !defined(_7ZIP_ST) && !defined(_SFX)
|
||||
, true, _numThreads
|
||||
#endif
|
||||
);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "../../../Common/ComTry.h"
|
||||
#include "../../../Common/IntToString.h"
|
||||
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef __7Z_SET_PROPERTIES
|
||||
#include "../../../Windows/System.h"
|
||||
#endif
|
||||
|
||||
@@ -38,7 +38,7 @@ CHandler::CHandler()
|
||||
#endif
|
||||
|
||||
#ifdef EXTRACT_ONLY
|
||||
#ifdef COMPRESS_MT
|
||||
#ifdef __7Z_SET_PROPERTIES
|
||||
_numThreads = NSystem::GetNumberOfProcessors();
|
||||
#endif
|
||||
#else
|
||||
@@ -190,18 +190,11 @@ static inline void AddHexToString(UString &res, Byte value)
|
||||
|
||||
#endif
|
||||
|
||||
static const UInt64 k_AES = 0x06F10701;
|
||||
|
||||
bool CHandler::IsEncrypted(UInt32 index2) const
|
||||
{
|
||||
CNum folderIndex = _db.FileIndexToFolderIndexMap[index2];
|
||||
if (folderIndex != kNumNoIndex)
|
||||
{
|
||||
const CFolder &folderInfo = _db.Folders[folderIndex];
|
||||
for (int i = folderInfo.Coders.Size() - 1; i >= 0; i--)
|
||||
if (folderInfo.Coders[i].MethodID == k_AES)
|
||||
return true;
|
||||
}
|
||||
return _db.Folders[folderIndex].IsEncrypted();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -454,10 +447,8 @@ STDMETHODIMP CHandler::Close()
|
||||
STDMETHODIMP CHandler::SetProperties(const wchar_t **names, const PROPVARIANT *values, Int32 numProperties)
|
||||
{
|
||||
COM_TRY_BEGIN
|
||||
#ifdef COMPRESS_MT
|
||||
const UInt32 numProcessors = NSystem::GetNumberOfProcessors();
|
||||
_numThreads = numProcessors;
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < numProperties; i++)
|
||||
{
|
||||
@@ -472,9 +463,7 @@ STDMETHODIMP CHandler::SetProperties(const wchar_t **names, const PROPVARIANT *v
|
||||
{
|
||||
if(name.Left(2).CompareNoCase(L"MT") == 0)
|
||||
{
|
||||
#ifdef COMPRESS_MT
|
||||
RINOK(ParseMtProp(name.Mid(2), value, numProcessors, _numThreads));
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace N7z {
|
||||
#ifndef __7Z_SET_PROPERTIES
|
||||
|
||||
#ifdef EXTRACT_ONLY
|
||||
#ifdef COMPRESS_MT
|
||||
#if !defined(_7ZIP_ST) && !defined(_SFX)
|
||||
#define __7Z_SET_PROPERTIES
|
||||
#endif
|
||||
#else
|
||||
@@ -80,7 +80,7 @@ private:
|
||||
|
||||
#ifdef EXTRACT_ONLY
|
||||
|
||||
#ifdef COMPRESS_MT
|
||||
#ifdef __7Z_SET_PROPERTIES
|
||||
UInt32 _numThreads;
|
||||
#endif
|
||||
|
||||
@@ -92,7 +92,7 @@ private:
|
||||
|
||||
HRESULT SetCompressionMethod(CCompressionMethodMode &method,
|
||||
CObjectVector<COneMethodInfo> &methodsInfo
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
, UInt32 numThreads
|
||||
#endif
|
||||
);
|
||||
|
||||
@@ -51,7 +51,7 @@ HRESULT CHandler::SetCompressionMethod(
|
||||
CCompressionMethodMode &headerMethod)
|
||||
{
|
||||
HRESULT res = SetCompressionMethod(methodMode, _methods
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
, _numThreads
|
||||
#endif
|
||||
);
|
||||
@@ -91,8 +91,8 @@ HRESULT CHandler::SetCompressionMethod(
|
||||
}
|
||||
headerMethodInfoVector.Add(oneMethodInfo);
|
||||
HRESULT res = SetCompressionMethod(headerMethod, headerMethodInfoVector
|
||||
#ifdef COMPRESS_MT
|
||||
,1
|
||||
#ifndef _7ZIP_ST
|
||||
, 1
|
||||
#endif
|
||||
);
|
||||
RINOK(res);
|
||||
@@ -103,7 +103,7 @@ HRESULT CHandler::SetCompressionMethod(
|
||||
HRESULT CHandler::SetCompressionMethod(
|
||||
CCompressionMethodMode &methodMode,
|
||||
CObjectVector<COneMethodInfo> &methodsInfo
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
, UInt32 numThreads
|
||||
#endif
|
||||
)
|
||||
@@ -122,7 +122,7 @@ HRESULT CHandler::SetCompressionMethod(
|
||||
{
|
||||
COneMethodInfo &oneMethodInfo = methodsInfo[i];
|
||||
SetCompressionMethod2(oneMethodInfo
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
, numThreads
|
||||
#endif
|
||||
);
|
||||
@@ -327,7 +327,7 @@ STDMETHODIMP CHandler::UpdateItems(ISequentialOutStream *outStream, UInt32 numIt
|
||||
|
||||
CCompressionMethodMode methodMode, headerMethod;
|
||||
RINOK(SetCompressionMethod(methodMode, headerMethod));
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
methodMode.NumThreads = _numThreads;
|
||||
headerMethod.NumThreads = 1;
|
||||
#endif
|
||||
|
||||
@@ -823,7 +823,7 @@ HRESULT CInArchive::ReadAndDecodePackedStreams(
|
||||
#ifndef _NO_CRYPTO
|
||||
, getTextPassword, passwordIsDefined
|
||||
#endif
|
||||
#ifdef COMPRESS_MT
|
||||
#if !defined(_7ZIP_ST) && !defined(_SFX)
|
||||
, false, 1
|
||||
#endif
|
||||
);
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
namespace NArchive {
|
||||
namespace N7z {
|
||||
|
||||
const UInt64 k_AES = 0x06F10701;
|
||||
|
||||
typedef UInt32 CNum;
|
||||
const CNum kNumMax = 0x7FFFFFFF;
|
||||
const CNum kNumNoIndex = 0xFFFFFFFF;
|
||||
@@ -83,6 +85,14 @@ struct CFolder
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool IsEncrypted() const
|
||||
{
|
||||
for (int i = Coders.Size() - 1; i >= 0; i--)
|
||||
if (Coders[i].MethodID == k_AES)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CheckStructure() const;
|
||||
};
|
||||
|
||||
|
||||
@@ -502,9 +502,11 @@ void COutArchive::SkipAlign(unsigned pos, unsigned alignSize)
|
||||
}
|
||||
*/
|
||||
|
||||
static inline unsigned Bv_GetSizeInBytes(const CBoolVector &v) { return ((unsigned)v.Size() + 7) / 8; }
|
||||
|
||||
void COutArchive::WriteAlignedBoolHeader(const CBoolVector &v, int numDefined, Byte type, unsigned itemSize)
|
||||
{
|
||||
const UInt64 bvSize = (numDefined == v.Size()) ? 0 : (v.Size() + 7) / 8;
|
||||
const unsigned bvSize = (numDefined == v.Size()) ? 0 : Bv_GetSizeInBytes(v);
|
||||
const UInt64 dataSize = (UInt64)numDefined * itemSize + bvSize + 2;
|
||||
SkipAlign(3 + (unsigned)bvSize + (unsigned)GetBigNumberSize(dataSize), itemSize);
|
||||
|
||||
@@ -631,7 +633,7 @@ void COutArchive::WriteHeader(
|
||||
if (numEmptyStreams > 0)
|
||||
{
|
||||
WriteByte(NID::kEmptyStream);
|
||||
WriteNumber((emptyStreamVector.Size() + 7) / 8);
|
||||
WriteNumber(Bv_GetSizeInBytes(emptyStreamVector));
|
||||
WriteBoolVector(emptyStreamVector);
|
||||
|
||||
CBoolVector emptyFileVector, antiVector;
|
||||
@@ -656,14 +658,14 @@ void COutArchive::WriteHeader(
|
||||
if (numEmptyFiles > 0)
|
||||
{
|
||||
WriteByte(NID::kEmptyFile);
|
||||
WriteNumber((emptyFileVector.Size() + 7) / 8);
|
||||
WriteNumber(Bv_GetSizeInBytes(emptyFileVector));
|
||||
WriteBoolVector(emptyFileVector);
|
||||
}
|
||||
|
||||
if (numAntiItems > 0)
|
||||
{
|
||||
WriteByte(NID::kAnti);
|
||||
WriteNumber((antiVector.Size() + 7) / 8);
|
||||
WriteNumber(Bv_GetSizeInBytes(antiVector));
|
||||
WriteBoolVector(antiVector);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,4 +15,4 @@ static IOutArchive *CreateArcOut() { return new NArchive::N7z::CHandler; }
|
||||
static CArcInfo g_ArcInfo =
|
||||
{ L"7z", L"7z", 0, 7, {'7', 'z', 0xBC, 0xAF, 0x27, 0x1C}, 6, false, CreateArc, CreateArcOut };
|
||||
|
||||
REGISTER_ARC_DEC_SIG(7z)
|
||||
REGISTER_ARC(7z)
|
||||
|
||||
@@ -27,7 +27,6 @@ namespace N7z {
|
||||
static const UInt64 k_LZMA = 0x030101;
|
||||
static const UInt64 k_BCJ = 0x03030103;
|
||||
static const UInt64 k_BCJ2 = 0x0303011B;
|
||||
static const UInt64 k_AES = 0x06F10701;
|
||||
|
||||
static const wchar_t *kMatchFinderForBCJ2_LZMA = L"BT2";
|
||||
static const UInt32 kDictionaryForBCJ2_LZMA = 1 << 20;
|
||||
@@ -580,7 +579,7 @@ public:
|
||||
DECL_EXTERNAL_CODECS_VARS
|
||||
CDecoder Decoder;
|
||||
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
bool MtMode;
|
||||
UInt32 NumThreads;
|
||||
#endif
|
||||
@@ -588,7 +587,7 @@ public:
|
||||
CThreadDecoder():
|
||||
Decoder(true)
|
||||
{
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
MtMode = false;
|
||||
NumThreads = 1;
|
||||
#endif
|
||||
@@ -617,7 +616,7 @@ void CThreadDecoder::Execute()
|
||||
#ifndef _NO_CRYPTO
|
||||
, GetTextPassword, passwordIsDefined
|
||||
#endif
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
, MtMode, NumThreads
|
||||
#endif
|
||||
);
|
||||
@@ -642,17 +641,6 @@ bool static Is86FilteredFolder(const CFolder &f)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool static IsEncryptedFolder(const CFolder &f)
|
||||
{
|
||||
for (int i = 0; i < f.Coders.Size(); i++)
|
||||
{
|
||||
CMethodId m = f.Coders[i].MethodID;
|
||||
if (m == k_AES)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifndef _NO_CRYPTO
|
||||
|
||||
class CCryptoGetTextPassword:
|
||||
@@ -760,7 +748,7 @@ HRESULT Update(
|
||||
rep.FolderIndex = i;
|
||||
rep.NumCopyFiles = numCopyItems;
|
||||
const CFolder &f = db->Folders[i];
|
||||
bool isEncrypted = IsEncryptedFolder(f);
|
||||
bool isEncrypted = f.IsEncrypted();
|
||||
rep.Group = GetGroupIndex(isEncrypted, Is86FilteredFolder(f));
|
||||
folderRefs.Add(rep);
|
||||
if (numCopyItems == numUnpackStreams)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
PROG = 7z.dll
|
||||
DEF_FILE = ../Archive.def
|
||||
CFLAGS = $(CFLAGS) -I ../../../ \
|
||||
-DCOMPRESS_MT \
|
||||
-DEXTERNAL_CODECS \
|
||||
|
||||
AR_OBJS = \
|
||||
@@ -71,9 +70,10 @@ AR_COMMON_OBJS = \
|
||||
|
||||
C_OBJS = \
|
||||
$O\Alloc.obj \
|
||||
$O\CpuArch.obj \
|
||||
$O\Threads.obj \
|
||||
|
||||
!include "../../Crc2.mak"
|
||||
!include "../../Crc.mak"
|
||||
|
||||
OBJS = \
|
||||
$O\StdAfx.obj \
|
||||
@@ -85,7 +85,7 @@ OBJS = \
|
||||
$(AR_COMMON_OBJS) \
|
||||
$O\CopyCoder.obj \
|
||||
$(C_OBJS) \
|
||||
$(CRC_OBJS) \
|
||||
$(ASM_OBJS) \
|
||||
$O\resource.res
|
||||
|
||||
!include "../../../Build.mak"
|
||||
@@ -106,4 +106,5 @@ $O\CopyCoder.obj: ../../Compress/$(*B).cpp
|
||||
$(COMPL)
|
||||
$(C_OBJS): ../../../../C/$(*B).c
|
||||
$(COMPL_O2)
|
||||
!include "../../Crc.mak"
|
||||
|
||||
!include "../../Asm.mak"
|
||||
|
||||
356
CPP/7zip/Archive/ApmHandler.cpp
Executable file
356
CPP/7zip/Archive/ApmHandler.cpp
Executable file
@@ -0,0 +1,356 @@
|
||||
// ApmHandler.cpp
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "../../../C/CpuArch.h"
|
||||
|
||||
#include "Common/ComTry.h"
|
||||
#include "Common/IntToString.h"
|
||||
#include "Common/MyString.h"
|
||||
|
||||
#include "Windows/PropVariant.h"
|
||||
|
||||
#include "../Common/LimitedStreams.h"
|
||||
#include "../Common/ProgressUtils.h"
|
||||
#include "../Common/RegisterArc.h"
|
||||
#include "../Common/StreamUtils.h"
|
||||
|
||||
#include "../Compress/CopyCoder.h"
|
||||
|
||||
#define Get16(p) GetBe16(p)
|
||||
#define Get32(p) GetBe32(p)
|
||||
|
||||
using namespace NWindows;
|
||||
|
||||
namespace NArchive {
|
||||
namespace NApm {
|
||||
|
||||
struct CItem
|
||||
{
|
||||
UInt32 StartBlock;
|
||||
UInt32 NumBlocks;
|
||||
char Name[32];
|
||||
char Type[32];
|
||||
/*
|
||||
UInt32 DataStartBlock;
|
||||
UInt32 NumDataBlocks;
|
||||
UInt32 Status;
|
||||
UInt32 BootStartBlock;
|
||||
UInt32 BootSize;
|
||||
UInt32 BootAddr;
|
||||
UInt32 BootEntry;
|
||||
UInt32 BootChecksum;
|
||||
char Processor[16];
|
||||
*/
|
||||
|
||||
bool Parse(const Byte *p, UInt32 &numBlocksInMap)
|
||||
{
|
||||
if (p[0] != 0x50 || p[1] != 0x4D || p[2] != 0 || p[3] != 0)
|
||||
return false;
|
||||
numBlocksInMap = Get32(p + 4);
|
||||
StartBlock = Get32(p + 8);
|
||||
NumBlocks = Get32(p + 0xC);
|
||||
memcpy(Name, p + 0x10, 32);
|
||||
memcpy(Type, p + 0x30, 32);
|
||||
/*
|
||||
DataStartBlock = Get32(p + 0x50);
|
||||
NumDataBlocks = Get32(p + 0x54);
|
||||
Status = Get32(p + 0x58);
|
||||
BootStartBlock = Get32(p + 0x5C);
|
||||
BootSize = Get32(p + 0x60);
|
||||
BootAddr = Get32(p + 0x64);
|
||||
if (Get32(p + 0x68) != 0)
|
||||
return false;
|
||||
BootEntry = Get32(p + 0x6C);
|
||||
if (Get32(p + 0x70) != 0)
|
||||
return false;
|
||||
BootChecksum = Get32(p + 0x74);
|
||||
memcpy(Processor, p + 0x78, 16);
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class CHandler:
|
||||
public IInArchive,
|
||||
public IInArchiveGetStream,
|
||||
public CMyUnknownImp
|
||||
{
|
||||
CMyComPtr<IInStream> _stream;
|
||||
CRecordVector<CItem> _items;
|
||||
|
||||
int _blockSizeLog;
|
||||
UInt32 _numBlocks;
|
||||
|
||||
HRESULT ReadTables(IInStream *stream);
|
||||
UInt64 BlocksToBytes(UInt32 i) const { return (UInt64)i << _blockSizeLog; }
|
||||
UInt64 GetItemSize(const CItem &item) { return BlocksToBytes(item.NumBlocks); }
|
||||
public:
|
||||
MY_UNKNOWN_IMP2(IInArchive, IInArchiveGetStream)
|
||||
INTERFACE_IInArchive(;)
|
||||
STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **stream);
|
||||
};
|
||||
|
||||
static inline int GetLog(UInt32 num)
|
||||
{
|
||||
for (int i = 0; i < 31; i++)
|
||||
if (((UInt32)1 << i) == num)
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
HRESULT CHandler::ReadTables(IInStream *stream)
|
||||
{
|
||||
const UInt32 kSectorSize = 512;
|
||||
Byte buf[kSectorSize];
|
||||
{
|
||||
RINOK(ReadStream_FALSE(stream, buf, kSectorSize));
|
||||
if (buf[0] != 0x45 || buf[1] != 0x52)
|
||||
return S_FALSE;
|
||||
_blockSizeLog = GetLog(Get16(buf + 2));
|
||||
if (_blockSizeLog < 9 || _blockSizeLog > 14)
|
||||
return S_FALSE;
|
||||
_numBlocks = Get32(buf + 4);
|
||||
for (int i = 8; i < 16; i++)
|
||||
if (buf[i] != 0)
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
unsigned numSkips = (unsigned)1 << (_blockSizeLog - 9);
|
||||
for (unsigned j = 1; j < numSkips; j++)
|
||||
{
|
||||
RINOK(ReadStream_FALSE(stream, buf, kSectorSize));
|
||||
}
|
||||
|
||||
UInt32 numBlocksInMap = 0;
|
||||
for (unsigned i = 0;;)
|
||||
{
|
||||
RINOK(ReadStream_FALSE(stream, buf, kSectorSize));
|
||||
|
||||
CItem item;
|
||||
|
||||
UInt32 numBlocksInMap2;
|
||||
if (!item.Parse(buf, numBlocksInMap2))
|
||||
return S_FALSE;
|
||||
if (i == 0)
|
||||
{
|
||||
numBlocksInMap = numBlocksInMap2;
|
||||
if (numBlocksInMap > (1 << 8))
|
||||
return S_FALSE;
|
||||
}
|
||||
else if (numBlocksInMap2 != numBlocksInMap)
|
||||
return S_FALSE;
|
||||
|
||||
UInt32 finish = item.StartBlock + item.NumBlocks;
|
||||
if (finish < item.StartBlock)
|
||||
return S_FALSE;
|
||||
_numBlocks = MyMax(_numBlocks, finish);
|
||||
|
||||
_items.Add(item);
|
||||
for (unsigned j = 1; j < numSkips; j++)
|
||||
{
|
||||
RINOK(ReadStream_FALSE(stream, buf, kSectorSize));
|
||||
}
|
||||
if (++i == numBlocksInMap)
|
||||
break;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CHandler::Open(IInStream *stream,
|
||||
const UInt64 * /* maxCheckStartPosition */,
|
||||
IArchiveOpenCallback * /* openArchiveCallback */)
|
||||
{
|
||||
COM_TRY_BEGIN
|
||||
Close();
|
||||
RINOK(ReadTables(stream));
|
||||
_stream = stream;
|
||||
return S_OK;
|
||||
COM_TRY_END
|
||||
}
|
||||
|
||||
STDMETHODIMP CHandler::Close()
|
||||
{
|
||||
_items.Clear();
|
||||
_stream.Release();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STATPROPSTG kProps[] =
|
||||
{
|
||||
{ NULL, kpidPath, VT_BSTR},
|
||||
{ NULL, kpidSize, VT_UI8},
|
||||
{ NULL, kpidOffset, VT_UI8}
|
||||
};
|
||||
|
||||
STATPROPSTG kArcProps[] =
|
||||
{
|
||||
{ NULL, kpidClusterSize, VT_UI4},
|
||||
{ NULL, kpidPhySize, VT_UI8}
|
||||
};
|
||||
|
||||
IMP_IInArchive_Props
|
||||
IMP_IInArchive_ArcProps
|
||||
|
||||
static AString GetString(const char *s)
|
||||
{
|
||||
AString res;
|
||||
for (int i = 0; i < 32 && s[i] != 0; i++)
|
||||
res += s[i];
|
||||
return res;
|
||||
}
|
||||
|
||||
STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value)
|
||||
{
|
||||
COM_TRY_BEGIN
|
||||
NCOM::CPropVariant prop;
|
||||
switch(propID)
|
||||
{
|
||||
case kpidMainSubfile:
|
||||
{
|
||||
int mainIndex = -1;
|
||||
for (int i = 0; i < _items.Size(); i++)
|
||||
{
|
||||
AString s = GetString(_items[i].Type);
|
||||
if (s != "Apple_Free" &&
|
||||
s != "Apple_partition_map")
|
||||
{
|
||||
if (mainIndex >= 0)
|
||||
{
|
||||
mainIndex = -1;
|
||||
break;
|
||||
}
|
||||
mainIndex = i;
|
||||
}
|
||||
}
|
||||
if (mainIndex >= 0)
|
||||
prop = (UInt32)mainIndex;
|
||||
break;
|
||||
}
|
||||
case kpidClusterSize: prop = (UInt32)1 << _blockSizeLog; break;
|
||||
case kpidPhySize: prop = BlocksToBytes(_numBlocks); break;
|
||||
}
|
||||
prop.Detach(value);
|
||||
return S_OK;
|
||||
COM_TRY_END
|
||||
}
|
||||
|
||||
STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems)
|
||||
{
|
||||
*numItems = _items.Size();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value)
|
||||
{
|
||||
COM_TRY_BEGIN
|
||||
NCOM::CPropVariant prop;
|
||||
const CItem &item = _items[index];
|
||||
switch(propID)
|
||||
{
|
||||
case kpidPath:
|
||||
{
|
||||
AString s = GetString(item.Name);
|
||||
if (s.IsEmpty())
|
||||
{
|
||||
char s2[32];
|
||||
ConvertUInt32ToString(index, s2);
|
||||
s = s2;
|
||||
}
|
||||
AString type = GetString(item.Type);
|
||||
if (type == "Apple_HFS")
|
||||
type = "hfs";
|
||||
if (!type.IsEmpty())
|
||||
{
|
||||
s += '.';
|
||||
s += type;
|
||||
}
|
||||
prop = s;
|
||||
break;
|
||||
}
|
||||
case kpidSize:
|
||||
case kpidPackSize:
|
||||
prop = GetItemSize(item);
|
||||
break;
|
||||
case kpidOffset: prop = BlocksToBytes(item.StartBlock); break;
|
||||
}
|
||||
prop.Detach(value);
|
||||
return S_OK;
|
||||
COM_TRY_END
|
||||
}
|
||||
|
||||
STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
|
||||
Int32 testMode, IArchiveExtractCallback *extractCallback)
|
||||
{
|
||||
COM_TRY_BEGIN
|
||||
bool allFilesMode = (numItems == (UInt32)-1);
|
||||
if (allFilesMode)
|
||||
numItems = _items.Size();
|
||||
if (numItems == 0)
|
||||
return S_OK;
|
||||
UInt64 totalSize = 0;
|
||||
UInt32 i;
|
||||
for (i = 0; i < numItems; i++)
|
||||
totalSize += GetItemSize(_items[allFilesMode ? i : indices[i]]);
|
||||
extractCallback->SetTotal(totalSize);
|
||||
|
||||
totalSize = 0;
|
||||
|
||||
NCompress::CCopyCoder *copyCoderSpec = new NCompress::CCopyCoder();
|
||||
CMyComPtr<ICompressCoder> copyCoder = copyCoderSpec;
|
||||
|
||||
CLocalProgress *lps = new CLocalProgress;
|
||||
CMyComPtr<ICompressProgressInfo> progress = lps;
|
||||
lps->Init(extractCallback, false);
|
||||
|
||||
CLimitedSequentialInStream *streamSpec = new CLimitedSequentialInStream;
|
||||
CMyComPtr<ISequentialInStream> inStream(streamSpec);
|
||||
streamSpec->SetStream(_stream);
|
||||
|
||||
for (i = 0; i < numItems; i++)
|
||||
{
|
||||
lps->InSize = totalSize;
|
||||
lps->OutSize = totalSize;
|
||||
RINOK(lps->SetCur());
|
||||
CMyComPtr<ISequentialOutStream> outStream;
|
||||
Int32 askMode = testMode ?
|
||||
NExtract::NAskMode::kTest :
|
||||
NExtract::NAskMode::kExtract;
|
||||
Int32 index = allFilesMode ? i : indices[i];
|
||||
const CItem &item = _items[index];
|
||||
|
||||
RINOK(extractCallback->GetStream(index, &outStream, askMode));
|
||||
UInt64 size = GetItemSize(item);
|
||||
totalSize += size;
|
||||
if (!testMode && !outStream)
|
||||
continue;
|
||||
RINOK(extractCallback->PrepareOperation(askMode));
|
||||
|
||||
RINOK(_stream->Seek(BlocksToBytes(item.StartBlock), STREAM_SEEK_SET, NULL));
|
||||
streamSpec->Init(size);
|
||||
RINOK(copyCoder->Code(inStream, outStream, NULL, NULL, progress));
|
||||
outStream.Release();
|
||||
RINOK(extractCallback->SetOperationResult(copyCoderSpec->TotalSize == size ?
|
||||
NExtract::NOperationResult::kOK:
|
||||
NExtract::NOperationResult::kDataError));
|
||||
}
|
||||
return S_OK;
|
||||
COM_TRY_END
|
||||
}
|
||||
|
||||
STDMETHODIMP CHandler::GetStream(UInt32 index, ISequentialInStream **stream)
|
||||
{
|
||||
COM_TRY_BEGIN
|
||||
const CItem &item = _items[index];
|
||||
return CreateLimitedInStream(_stream, BlocksToBytes(item.StartBlock), GetItemSize(item), stream);
|
||||
COM_TRY_END
|
||||
}
|
||||
|
||||
static IInArchive *CreateArc() { return new CHandler; }
|
||||
|
||||
static CArcInfo g_ArcInfo =
|
||||
{ L"APM", L"", 0, 0xD4, { 0x50, 0x4D, 0, 0, 0, 0, 0 }, 7, false, CreateArc, 0 };
|
||||
|
||||
REGISTER_ARC(Apm)
|
||||
|
||||
}}
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "Windows/PropVariant.h"
|
||||
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
#include "../../Windows/System.h"
|
||||
#endif
|
||||
|
||||
@@ -51,7 +51,7 @@ class CHandler:
|
||||
UInt32 _level;
|
||||
UInt32 _dicSize;
|
||||
UInt32 _numPasses;
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
UInt32 _numThreads;
|
||||
#endif
|
||||
|
||||
@@ -60,7 +60,7 @@ class CHandler:
|
||||
_level = 5;
|
||||
_dicSize =
|
||||
_numPasses = 0xFFFFFFFF;
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
_numThreads = NWindows::NSystem::GetNumberOfProcessors();;
|
||||
#endif
|
||||
}
|
||||
@@ -187,7 +187,7 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
|
||||
|
||||
decoderSpec->SetInStream(_seqStream);
|
||||
|
||||
#if defined( COMPRESS_MT) && defined( COMPRESS_BZIP2_MT)
|
||||
#ifndef _7ZIP_ST
|
||||
RINOK(decoderSpec->SetNumberOfThreads(_numThreads));
|
||||
#endif
|
||||
|
||||
@@ -249,7 +249,7 @@ static HRESULT UpdateArchive(
|
||||
int indexInClient,
|
||||
UInt32 dictionary,
|
||||
UInt32 numPasses,
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
UInt32 numThreads,
|
||||
#endif
|
||||
IArchiveUpdateCallback *updateCallback)
|
||||
@@ -273,7 +273,7 @@ static HRESULT UpdateArchive(
|
||||
{
|
||||
dictionary,
|
||||
numPasses
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
, numThreads
|
||||
#endif
|
||||
};
|
||||
@@ -281,7 +281,7 @@ static HRESULT UpdateArchive(
|
||||
{
|
||||
NCoderPropID::kDictionarySize,
|
||||
NCoderPropID::kNumPasses
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
, NCoderPropID::kNumThreads
|
||||
#endif
|
||||
};
|
||||
@@ -351,7 +351,7 @@ STDMETHODIMP CHandler::UpdateItems(ISequentialOutStream *outStream, UInt32 numIt
|
||||
|
||||
return UpdateArchive(
|
||||
size, outStream, 0, dicSize, numPasses,
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
_numThreads,
|
||||
#endif
|
||||
updateCallback);
|
||||
@@ -366,7 +366,7 @@ STDMETHODIMP CHandler::UpdateItems(ISequentialOutStream *outStream, UInt32 numIt
|
||||
STDMETHODIMP CHandler::SetProperties(const wchar_t **names, const PROPVARIANT *values, Int32 numProps)
|
||||
{
|
||||
InitMethodProperties();
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
const UInt32 numProcessors = NSystem::GetNumberOfProcessors();
|
||||
_numThreads = numProcessors;
|
||||
#endif
|
||||
@@ -398,7 +398,7 @@ STDMETHODIMP CHandler::SetProperties(const wchar_t **names, const PROPVARIANT *v
|
||||
}
|
||||
else if (name.Left(2) == L"MT")
|
||||
{
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
RINOK(ParseMtProp(name.Mid(2), prop, numProcessors, _numThreads));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -233,17 +233,14 @@ STDMETHODIMP CHandler::Open(IInStream *inStream,
|
||||
HRESULT res = S_FALSE;
|
||||
CInArchive archive;
|
||||
CMyComPtr<IArchiveOpenVolumeCallback> openVolumeCallback;
|
||||
{
|
||||
CMyComPtr<IArchiveOpenCallback> openArchiveCallbackWrap = callback;
|
||||
openArchiveCallbackWrap.QueryInterface(IID_IArchiveOpenVolumeCallback, &openVolumeCallback);
|
||||
}
|
||||
|
||||
callback->QueryInterface(IID_IArchiveOpenVolumeCallback, (void **)&openVolumeCallback);
|
||||
|
||||
CMyComPtr<IInStream> nextStream = inStream;
|
||||
bool prevChecked = false;
|
||||
UInt64 numItems = 0;
|
||||
try
|
||||
{
|
||||
while(nextStream != 0)
|
||||
while (nextStream != 0)
|
||||
{
|
||||
CDatabaseEx db;
|
||||
db.Stream = nextStream;
|
||||
@@ -296,6 +293,9 @@ STDMETHODIMP CHandler::Open(IInStream *inStream,
|
||||
if (!otherArchive)
|
||||
break;
|
||||
const UString fullName = MultiByteToUnicodeString(otherArchive->FileName, CP_ACP);
|
||||
if (!openVolumeCallback)
|
||||
break;
|
||||
|
||||
HRESULT result = openVolumeCallback->GetStream(fullName, &nextStream);
|
||||
if (result == S_OK)
|
||||
break;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "../../../Windows/PropVariant.h"
|
||||
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
#include "../../../Windows/System.h"
|
||||
#endif
|
||||
|
||||
@@ -190,7 +190,7 @@ static void SetMethodProp(COneMethodInfo &m, PROPID propID, const NCOM::CPropVar
|
||||
}
|
||||
|
||||
void COutHandler::SetCompressionMethod2(COneMethodInfo &oneMethodInfo
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
, UInt32 numThreads
|
||||
#endif
|
||||
)
|
||||
@@ -224,7 +224,7 @@ void COutHandler::SetCompressionMethod2(COneMethodInfo &oneMethodInfo
|
||||
SetMethodProp(oneMethodInfo, NCoderPropID::kAlgorithm, algo);
|
||||
SetMethodProp(oneMethodInfo, NCoderPropID::kNumFastBytes, fastBytes);
|
||||
SetMethodProp(oneMethodInfo, NCoderPropID::kMatchFinder, matchFinder);
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
SetMethodProp(oneMethodInfo, NCoderPropID::kNumThreads, numThreads);
|
||||
#endif
|
||||
}
|
||||
@@ -262,7 +262,7 @@ void COutHandler::SetCompressionMethod2(COneMethodInfo &oneMethodInfo
|
||||
|
||||
SetMethodProp(oneMethodInfo, NCoderPropID::kNumPasses, numPasses);
|
||||
SetMethodProp(oneMethodInfo, NCoderPropID::kDictionarySize, dicSize);
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
SetMethodProp(oneMethodInfo, NCoderPropID::kNumThreads, numThreads);
|
||||
#endif
|
||||
}
|
||||
@@ -476,7 +476,7 @@ void COutHandler::Init()
|
||||
WriteATime = false;
|
||||
WriteMTime = true;
|
||||
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
_numThreads = NSystem::GetNumberOfProcessors();
|
||||
#endif
|
||||
|
||||
@@ -490,7 +490,7 @@ void COutHandler::Init()
|
||||
void COutHandler::BeforeSetProperty()
|
||||
{
|
||||
Init();
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
numProcessors = NSystem::GetNumberOfProcessors();
|
||||
#endif
|
||||
|
||||
@@ -538,7 +538,7 @@ HRESULT COutHandler::SetProperty(const wchar_t *nameSpec, const PROPVARIANT &val
|
||||
{
|
||||
if(name.Left(2).CompareNoCase(L"MT") == 0)
|
||||
{
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
RINOK(ParseMtProp(name.Mid(2), value, numProcessors, _numThreads));
|
||||
#endif
|
||||
return S_OK;
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
HRESULT SetSolidSettings(const UString &s);
|
||||
HRESULT SetSolidSettings(const PROPVARIANT &value);
|
||||
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
UInt32 _numThreads;
|
||||
#endif
|
||||
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
HRESULT SetParams(COneMethodInfo &oneMethodInfo, const UString &srcString);
|
||||
|
||||
void SetCompressionMethod2(COneMethodInfo &oneMethodInfo
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
, UInt32 numThreads
|
||||
#endif
|
||||
);
|
||||
|
||||
@@ -188,8 +188,7 @@ class CHandler:
|
||||
DECL_ISetCompressCodecsInfo
|
||||
|
||||
public:
|
||||
MY_QUERYINTERFACE_BEGIN
|
||||
MY_QUERYINTERFACE_ENTRY(IInArchive)
|
||||
MY_QUERYINTERFACE_BEGIN2(IInArchive)
|
||||
MY_QUERYINTERFACE_ENTRY(IArchiveOpenSeq)
|
||||
QUERY_ENTRY_ISetCompressCodecsInfo
|
||||
MY_QUERYINTERFACE_END
|
||||
|
||||
@@ -70,7 +70,7 @@ bool CInArchive::ReadBytesAndTestSize(void *data, UInt32 size)
|
||||
{
|
||||
if (m_CryptoMode)
|
||||
{
|
||||
const Byte *bufData = (const Byte *)m_DecryptedData;
|
||||
const Byte *bufData = m_DecryptedDataAligned;
|
||||
UInt32 bufSize = m_DecryptedDataSize;
|
||||
UInt32 i;
|
||||
for (i = 0; i < size && m_CryptoPos < bufSize; i++)
|
||||
@@ -423,13 +423,15 @@ HRESULT CInArchive::GetNextItem(CItemEx &item, ICryptoGetTextPassword *getTextPa
|
||||
const UInt32 kDecryptedBufferSize = (1 << 12);
|
||||
if (m_DecryptedData.GetCapacity() == 0)
|
||||
{
|
||||
m_DecryptedData.SetCapacity(kDecryptedBufferSize);
|
||||
const UInt32 kAlign = 16;
|
||||
m_DecryptedData.SetCapacity(kDecryptedBufferSize + kAlign);
|
||||
m_DecryptedDataAligned = (Byte *)((ptrdiff_t)((Byte *)m_DecryptedData + kAlign - 1) & ~(ptrdiff_t)(kAlign - 1));
|
||||
}
|
||||
RINOK(m_RarAES->Init());
|
||||
size_t decryptedDataSizeT = kDecryptedBufferSize;
|
||||
RINOK(ReadStream(m_Stream, (Byte *)m_DecryptedData, &decryptedDataSizeT));
|
||||
RINOK(ReadStream(m_Stream, m_DecryptedDataAligned, &decryptedDataSizeT));
|
||||
m_DecryptedDataSize = (UInt32)decryptedDataSizeT;
|
||||
m_DecryptedDataSize = m_RarAES->Filter((Byte *)m_DecryptedData, m_DecryptedDataSize);
|
||||
m_DecryptedDataSize = m_RarAES->Filter(m_DecryptedDataAligned, m_DecryptedDataSize);
|
||||
|
||||
m_CryptoMode = true;
|
||||
m_CryptoPos = 0;
|
||||
|
||||
@@ -76,8 +76,6 @@ class CInArchive
|
||||
|
||||
void AddToSeekValue(UInt64 addValue);
|
||||
|
||||
protected:
|
||||
|
||||
CDynamicBuffer<Byte> m_FileHeaderData;
|
||||
|
||||
NHeader::NBlock::CBlock m_BlockHeader;
|
||||
@@ -94,6 +92,7 @@ protected:
|
||||
void ReadTime(Byte mask, CRarTime &rarTime);
|
||||
|
||||
CBuffer<Byte> m_DecryptedData;
|
||||
Byte *m_DecryptedDataAligned;
|
||||
UInt32 m_DecryptedDataSize;
|
||||
|
||||
bool m_CryptoMode;
|
||||
|
||||
@@ -107,6 +107,8 @@ STDMETHODIMP CHandler::UpdateItems(ISequentialOutStream *outStream, UInt32 numIt
|
||||
if (prop.vt != VT_UI8)
|
||||
return E_INVALIDARG;
|
||||
ui.Size = prop.uhVal.QuadPart;
|
||||
if (ui.Size >= ((UInt64)1 << 33))
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
updateItems.Add(ui);
|
||||
}
|
||||
|
||||
@@ -220,7 +220,6 @@ class CHandler:
|
||||
HRESULT ReadPhy(UInt64 offset, void *data, UInt32 size);
|
||||
|
||||
bool NeedParent() const { return Footer.Type == kDiskType_Diff; }
|
||||
UInt64 GetSize() const { return Footer.CurrentSize; }
|
||||
UInt64 GetPackSize() const
|
||||
{ return Footer.ThereIsDynamic() ? ((UInt64)NumUsedBlocks << Dyn.BlockSizeLog) : Footer.CurrentSize; }
|
||||
|
||||
@@ -317,7 +316,12 @@ HRESULT CHandler::Open3()
|
||||
|
||||
if (Dyn.NumBlocks >= (UInt32)1 << 31)
|
||||
return S_FALSE;
|
||||
if (GetSize() != ((UInt64)Dyn.NumBlocks << Dyn.BlockSizeLog))
|
||||
if (Footer.CurrentSize == 0)
|
||||
{
|
||||
if (Dyn.NumBlocks != 0)
|
||||
return S_FALSE;
|
||||
}
|
||||
else if (((Footer.CurrentSize - 1) >> Dyn.BlockSizeLog) + 1 != Dyn.NumBlocks)
|
||||
return S_FALSE;
|
||||
|
||||
Bat.Reserve(Dyn.NumBlocks);
|
||||
@@ -341,8 +345,11 @@ STDMETHODIMP CHandler::Read(void *data, UInt32 size, UInt32 *processedSize)
|
||||
{
|
||||
if (processedSize != NULL)
|
||||
*processedSize = 0;
|
||||
if (_virtPos >= GetSize())
|
||||
return (GetSize() == _virtPos) ? S_OK: E_FAIL;
|
||||
if (_virtPos >= Footer.CurrentSize)
|
||||
return (Footer.CurrentSize == _virtPos) ? S_OK: E_FAIL;
|
||||
UInt64 rem = Footer.CurrentSize - _virtPos;
|
||||
if (size > rem)
|
||||
size = (UInt32)rem;
|
||||
if (size == 0)
|
||||
return S_OK;
|
||||
UInt32 blockIndex = (UInt32)(_virtPos >> Dyn.BlockSizeLog);
|
||||
@@ -406,7 +413,7 @@ STDMETHODIMP CHandler::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition
|
||||
{
|
||||
case STREAM_SEEK_SET: _virtPos = offset; break;
|
||||
case STREAM_SEEK_CUR: _virtPos += offset; break;
|
||||
case STREAM_SEEK_END: _virtPos = GetSize() + offset; break;
|
||||
case STREAM_SEEK_END: _virtPos = Footer.CurrentSize + offset; break;
|
||||
default: return STG_E_INVALIDFUNCTION;
|
||||
}
|
||||
if (newPosition)
|
||||
@@ -627,7 +634,7 @@ STDMETHODIMP CHandler::GetProperty(UInt32 /* index */, PROPID propID, PROPVARIAN
|
||||
|
||||
switch(propID)
|
||||
{
|
||||
case kpidSize: prop = GetSize(); break;
|
||||
case kpidSize: prop = Footer.CurrentSize; break;
|
||||
case kpidPackSize: prop = GetPackSize(); break;
|
||||
case kpidCTime: VhdTimeToFileTime(Footer.CTime, prop); break;
|
||||
/*
|
||||
@@ -650,7 +657,7 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
|
||||
if (numItems != (UInt32)-1 && (numItems != 1 || indices[0] != 0))
|
||||
return E_INVALIDARG;
|
||||
|
||||
RINOK(extractCallback->SetTotal(GetSize()));
|
||||
RINOK(extractCallback->SetTotal(Footer.CurrentSize));
|
||||
CMyComPtr<ISequentialOutStream> outStream;
|
||||
Int32 askMode = testMode ?
|
||||
NExtract::NAskMode::kTest :
|
||||
@@ -678,7 +685,7 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
|
||||
HRESULT hres = copyCoder->Code(inStream, outStream, NULL, NULL, progress);
|
||||
if (hres == S_OK)
|
||||
{
|
||||
if (copyCoderSpec->TotalSize == GetSize())
|
||||
if (copyCoderSpec->TotalSize == Footer.CurrentSize)
|
||||
res = NExtract::NOperationResult::kOK;
|
||||
}
|
||||
else
|
||||
@@ -703,7 +710,7 @@ STDMETHODIMP CHandler::GetStream(UInt32 /* index */, ISequentialInStream **strea
|
||||
CLimitedInStream *streamSpec = new CLimitedInStream;
|
||||
CMyComPtr<ISequentialInStream> streamTemp = streamSpec;
|
||||
streamSpec->SetStream(Stream);
|
||||
streamSpec->InitAndSeek(0, GetSize());
|
||||
streamSpec->InitAndSeek(0, Footer.CurrentSize);
|
||||
RINOK(streamSpec->SeekToStart());
|
||||
*stream = streamTemp.Detach();
|
||||
return S_OK;
|
||||
|
||||
@@ -198,25 +198,28 @@ static bool AddItem(const CXmlItem &item, CObjectVector<CFile> &files, int paren
|
||||
file.Sha1IsDefined = ParseSha1(dataItem, "extracted-checksum", file.Sha1);
|
||||
// file.packSha1IsDefined = ParseSha1(dataItem, "archived-checksum", file.packSha1);
|
||||
int encodingIndex = dataItem.FindSubTag("encoding");
|
||||
const CXmlItem &encodingItem = dataItem.SubItems[encodingIndex];
|
||||
if (encodingItem.IsTag)
|
||||
if (encodingIndex >= 0)
|
||||
{
|
||||
AString s = encodingItem.GetPropertyValue("style");
|
||||
if (s.Length() >= 0)
|
||||
const CXmlItem &encodingItem = dataItem.SubItems[encodingIndex];
|
||||
if (encodingItem.IsTag)
|
||||
{
|
||||
AString appl = "application/";
|
||||
if (s.Left(appl.Length()) == appl)
|
||||
AString s = encodingItem.GetPropertyValue("style");
|
||||
if (s.Length() >= 0)
|
||||
{
|
||||
s = s.Mid(appl.Length());
|
||||
AString xx = "x-";
|
||||
if (s.Left(xx.Length()) == xx)
|
||||
AString appl = "application/";
|
||||
if (s.Left(appl.Length()) == appl)
|
||||
{
|
||||
s = s.Mid(xx.Length());
|
||||
if (s == "gzip")
|
||||
s = METHOD_NAME_ZLIB;
|
||||
s = s.Mid(appl.Length());
|
||||
AString xx = "x-";
|
||||
if (s.Left(xx.Length()) == xx)
|
||||
{
|
||||
s = s.Mid(xx.Length());
|
||||
if (s == "gzip")
|
||||
s = METHOD_NAME_ZLIB;
|
||||
}
|
||||
}
|
||||
file.Method = s;
|
||||
}
|
||||
file.Method = s;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -359,7 +362,7 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val
|
||||
case kpidMethod:
|
||||
{
|
||||
UString name;
|
||||
if (ConvertUTF8ToUnicode(item.Method, name))
|
||||
if (!item.Method.IsEmpty() && ConvertUTF8ToUnicode(item.Method, name))
|
||||
prop = name;
|
||||
break;
|
||||
}
|
||||
@@ -521,7 +524,7 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
|
||||
HRESULT res = S_OK;
|
||||
|
||||
ICompressCoder *coder = NULL;
|
||||
if (item.Method == "octet-stream")
|
||||
if (item.Method.IsEmpty() || item.Method == "octet-stream")
|
||||
if (item.PackSize == item.Size)
|
||||
coder = copyCoder;
|
||||
else
|
||||
|
||||
@@ -73,8 +73,7 @@ class CHandler:
|
||||
HRESULT Open2(IInStream *inStream, IArchiveOpenCallback *callback);
|
||||
|
||||
public:
|
||||
MY_QUERYINTERFACE_BEGIN
|
||||
MY_QUERYINTERFACE_ENTRY(IInArchive)
|
||||
MY_QUERYINTERFACE_BEGIN2(IInArchive)
|
||||
MY_QUERYINTERFACE_ENTRY(IArchiveOpenSeq)
|
||||
#ifndef EXTRACT_ONLY
|
||||
MY_QUERYINTERFACE_ENTRY(IOutArchive)
|
||||
@@ -644,7 +643,7 @@ STDMETHODIMP CHandler::UpdateItems(ISequentialOutStream *outStream, UInt32 numIt
|
||||
{
|
||||
COneMethodInfo &m = _methods[i];
|
||||
SetCompressionMethod2(m
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
, _numThreads
|
||||
#endif
|
||||
);
|
||||
@@ -658,7 +657,7 @@ STDMETHODIMP CHandler::UpdateItems(ISequentialOutStream *outStream, UInt32 numIt
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
lzma2Props.numTotalThreads = _numThreads;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ static HRESULT GetStreamCRC(ISequentialInStream *inStream, UInt32 &resultCRC)
|
||||
HRESULT CAddCommon::Compress(
|
||||
DECL_EXTERNAL_CODECS_LOC_VARS
|
||||
ISequentialInStream *inStream, IOutStream *outStream,
|
||||
ICompressProgressInfo *progress, CCompressingResult &operationResult)
|
||||
ICompressProgressInfo *progress, CCompressingResult &opRes)
|
||||
{
|
||||
CSequentialInStreamWithCRC *inSecCrcStreamSpec = 0;
|
||||
CInStreamWithCRC *inCrcStreamSpec = 0;
|
||||
@@ -139,13 +139,17 @@ HRESULT CAddCommon::Compress(
|
||||
}
|
||||
Byte method = 0;
|
||||
COutStreamReleaser outStreamReleaser;
|
||||
opRes.ExtractVersion = NFileHeader::NCompressionMethod::kExtractVersion_Default;
|
||||
for (int i = 0; i < numTestMethods; i++)
|
||||
{
|
||||
opRes.ExtractVersion = NFileHeader::NCompressionMethod::kExtractVersion_Default;
|
||||
if (inCrcStreamSpec != 0)
|
||||
RINOK(inCrcStreamSpec->Seek(0, STREAM_SEEK_SET, NULL));
|
||||
RINOK(outStream->Seek(0, STREAM_SEEK_SET, NULL));
|
||||
if (_options.PasswordIsDefined)
|
||||
{
|
||||
opRes.ExtractVersion = NFileHeader::NCompressionMethod::kExtractVersion_ZipCrypto;
|
||||
|
||||
if (!_cryptoStream)
|
||||
{
|
||||
_cryptoStreamSpec = new CFilterCoder;
|
||||
@@ -153,17 +157,24 @@ HRESULT CAddCommon::Compress(
|
||||
}
|
||||
if (_options.IsAesMode)
|
||||
{
|
||||
_cryptoStreamSpec->Filter = _aesFilter = _filterAesSpec = new NCrypto::NWzAes::CEncoder;
|
||||
_filterAesSpec->SetKeyMode(_options.AesKeyMode);
|
||||
RINOK(_filterAesSpec->CryptoSetPassword(
|
||||
opRes.ExtractVersion = NFileHeader::NCompressionMethod::kExtractVersion_Aes;
|
||||
if (!_cryptoStreamSpec->Filter)
|
||||
{
|
||||
_cryptoStreamSpec->Filter = _filterAesSpec = new NCrypto::NWzAes::CEncoder;
|
||||
_filterAesSpec->SetKeyMode(_options.AesKeyMode);
|
||||
RINOK(_filterAesSpec->CryptoSetPassword(
|
||||
(const Byte *)(const char *)_options.Password, _options.Password.Length()));
|
||||
}
|
||||
RINOK(_filterAesSpec->WriteHeader(outStream));
|
||||
}
|
||||
else
|
||||
{
|
||||
_cryptoStreamSpec->Filter = _zipCryptoFilter = _filterSpec = new NCrypto::NZip::CEncoder;
|
||||
RINOK(_filterSpec->CryptoSetPassword(
|
||||
if (!_cryptoStreamSpec->Filter)
|
||||
{
|
||||
_cryptoStreamSpec->Filter = _filterSpec = new NCrypto::NZip::CEncoder;
|
||||
RINOK(_filterSpec->CryptoSetPassword(
|
||||
(const Byte *)(const char *)_options.Password, _options.Password.Length()));
|
||||
}
|
||||
UInt32 crc = 0;
|
||||
RINOK(GetStreamCRC(inStream, crc));
|
||||
RINOK(inCrcStreamSpec->Seek(0, STREAM_SEEK_SET, NULL));
|
||||
@@ -190,7 +201,6 @@ HRESULT CAddCommon::Compress(
|
||||
else
|
||||
outStreamNew = outStream;
|
||||
RINOK(_copyCoder->Code(inCrcStream, outStreamNew, NULL, NULL, progress));
|
||||
operationResult.ExtractVersion = NFileHeader::NCompressionMethod::kStoreExtractVersion;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -199,11 +209,12 @@ HRESULT CAddCommon::Compress(
|
||||
{
|
||||
if (method == NFileHeader::NCompressionMethod::kLZMA)
|
||||
{
|
||||
_compressExtractVersion = NFileHeader::NCompressionMethod::kExtractVersion_LZMA;
|
||||
CLzmaEncoder *_lzmaEncoder = new CLzmaEncoder();
|
||||
_compressEncoder = _lzmaEncoder;
|
||||
NWindows::NCOM::CPropVariant props[] =
|
||||
{
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
_options.NumThreads,
|
||||
#endif
|
||||
_options.Algo,
|
||||
@@ -214,7 +225,7 @@ HRESULT CAddCommon::Compress(
|
||||
};
|
||||
PROPID propIDs[] =
|
||||
{
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
NCoderPropID::kNumThreads,
|
||||
#endif
|
||||
NCoderPropID::kAlgorithm,
|
||||
@@ -235,8 +246,12 @@ HRESULT CAddCommon::Compress(
|
||||
{
|
||||
case NFileHeader::NCompressionMethod::kBZip2:
|
||||
methodId = kMethodId_BZip2;
|
||||
_compressExtractVersion = NFileHeader::NCompressionMethod::kExtractVersion_BZip2;
|
||||
break;
|
||||
default:
|
||||
_compressExtractVersion = ((method == NFileHeader::NCompressionMethod::kDeflated64) ?
|
||||
NFileHeader::NCompressionMethod::kExtractVersion_Deflate64 :
|
||||
NFileHeader::NCompressionMethod::kExtractVersion_Deflate);
|
||||
methodId = kMethodId_ZipBase + method;
|
||||
break;
|
||||
}
|
||||
@@ -279,7 +294,7 @@ HRESULT CAddCommon::Compress(
|
||||
{
|
||||
_options.DicSize,
|
||||
_options.NumPasses
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
, _options.NumThreads
|
||||
#endif
|
||||
};
|
||||
@@ -287,7 +302,7 @@ HRESULT CAddCommon::Compress(
|
||||
{
|
||||
NCoderPropID::kDictionarySize,
|
||||
NCoderPropID::kNumPasses
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
, NCoderPropID::kNumThreads
|
||||
#endif
|
||||
};
|
||||
@@ -305,41 +320,42 @@ HRESULT CAddCommon::Compress(
|
||||
outStreamNew = _cryptoStream;
|
||||
else
|
||||
outStreamNew = outStream;
|
||||
if (_compressExtractVersion > opRes.ExtractVersion)
|
||||
opRes.ExtractVersion = _compressExtractVersion;
|
||||
RINOK(_compressEncoder->Code(inCrcStream, outStreamNew, NULL, NULL, progress));
|
||||
operationResult.ExtractVersion = NFileHeader::NCompressionMethod::kDeflateExtractVersion;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
RINOK(outStream->Seek(0, STREAM_SEEK_CUR, &operationResult.PackSize));
|
||||
RINOK(outStream->Seek(0, STREAM_SEEK_CUR, &opRes.PackSize));
|
||||
|
||||
if (inCrcStreamSpec != 0)
|
||||
{
|
||||
operationResult.CRC = inCrcStreamSpec->GetCRC();
|
||||
operationResult.UnpackSize = inCrcStreamSpec->GetSize();
|
||||
opRes.CRC = inCrcStreamSpec->GetCRC();
|
||||
opRes.UnpackSize = inCrcStreamSpec->GetSize();
|
||||
}
|
||||
else
|
||||
{
|
||||
operationResult.CRC = inSecCrcStreamSpec->GetCRC();
|
||||
operationResult.UnpackSize = inSecCrcStreamSpec->GetSize();
|
||||
opRes.CRC = inSecCrcStreamSpec->GetCRC();
|
||||
opRes.UnpackSize = inSecCrcStreamSpec->GetSize();
|
||||
}
|
||||
|
||||
if (_options.PasswordIsDefined)
|
||||
{
|
||||
if (operationResult.PackSize < operationResult.UnpackSize +
|
||||
if (opRes.PackSize < opRes.UnpackSize +
|
||||
(_options.IsAesMode ? _filterAesSpec->GetHeaderSize() : NCrypto::NZip::kHeaderSize))
|
||||
break;
|
||||
}
|
||||
else if (operationResult.PackSize < operationResult.UnpackSize)
|
||||
else if (opRes.PackSize < opRes.UnpackSize)
|
||||
break;
|
||||
}
|
||||
if (_options.IsAesMode)
|
||||
{
|
||||
RINOK(_filterAesSpec->WriteFooter(outStream));
|
||||
RINOK(outStream->Seek(0, STREAM_SEEK_CUR, &operationResult.PackSize));
|
||||
RINOK(outStream->Seek(0, STREAM_SEEK_CUR, &opRes.PackSize));
|
||||
}
|
||||
operationResult.Method = method;
|
||||
return outStream->SetSize(operationResult.PackSize);
|
||||
opRes.Method = method;
|
||||
return outStream->SetSize(opRes.PackSize);
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
@@ -35,6 +35,7 @@ class CAddCommon
|
||||
CMyComPtr<ICompressCoder> _copyCoder;
|
||||
|
||||
CMyComPtr<ICompressCoder> _compressEncoder;
|
||||
Byte _compressExtractVersion;
|
||||
|
||||
CFilterCoder *_cryptoStreamSpec;
|
||||
CMyComPtr<ISequentialOutStream> _cryptoStream;
|
||||
@@ -42,10 +43,6 @@ class CAddCommon
|
||||
NCrypto::NZip::CEncoder *_filterSpec;
|
||||
NCrypto::NWzAes::CEncoder *_filterAesSpec;
|
||||
|
||||
CMyComPtr<ICompressFilter> _zipCryptoFilter;
|
||||
CMyComPtr<ICompressFilter> _aesFilter;
|
||||
|
||||
|
||||
public:
|
||||
CAddCommon(const CCompressionMethodMode &options);
|
||||
HRESULT Compress(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// CompressionMode.h
|
||||
|
||||
#ifndef __ZIP_COMPRESSIONMETHOD_H
|
||||
#define __ZIP_COMPRESSIONMETHOD_H
|
||||
#ifndef __ZIP_COMPRESSION_MODE_H
|
||||
#define __ZIP_COMPRESSION_MODE_H
|
||||
|
||||
#include "Common/MyString.h"
|
||||
|
||||
@@ -18,7 +18,7 @@ struct CCompressionMethodMode
|
||||
bool NumMatchFinderCyclesDefined;
|
||||
UInt32 NumMatchFinderCycles;
|
||||
UInt32 DicSize;
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
UInt32 NumThreads;
|
||||
#endif
|
||||
bool PasswordIsDefined;
|
||||
|
||||
@@ -63,30 +63,7 @@ static const char *kHostOS[] =
|
||||
|
||||
static const char *kUnknownOS = "Unknown";
|
||||
|
||||
STATPROPSTG kProps[] =
|
||||
{
|
||||
{ NULL, kpidPath, VT_BSTR},
|
||||
{ NULL, kpidIsDir, VT_BOOL},
|
||||
{ NULL, kpidSize, VT_UI8},
|
||||
{ NULL, kpidPackSize, VT_UI8},
|
||||
{ NULL, kpidMTime, VT_FILETIME},
|
||||
{ NULL, kpidCTime, VT_FILETIME},
|
||||
{ NULL, kpidATime, VT_FILETIME},
|
||||
|
||||
{ NULL, kpidAttrib, VT_UI4},
|
||||
|
||||
{ NULL, kpidEncrypted, VT_BOOL},
|
||||
{ NULL, kpidComment, VT_BSTR},
|
||||
|
||||
{ NULL, kpidCRC, VT_UI4},
|
||||
|
||||
{ NULL, kpidMethod, VT_BSTR},
|
||||
{ NULL, kpidHostOS, VT_BSTR}
|
||||
|
||||
// { NULL, kpidUnpackVer, VT_UI1},
|
||||
};
|
||||
|
||||
const char *kMethods[] =
|
||||
static const char *kMethods[] =
|
||||
{
|
||||
"Store",
|
||||
"Shrink",
|
||||
@@ -101,23 +78,20 @@ const char *kMethods[] =
|
||||
"PKImploding"
|
||||
};
|
||||
|
||||
const int kNumMethods = sizeof(kMethods) / sizeof(kMethods[0]);
|
||||
const char *kBZip2Method = "BZip2";
|
||||
const char *kLZMAMethod = "LZMA";
|
||||
const char *kJpegMethod = "Jpeg";
|
||||
const char *kWavPackMethod = "WavPack";
|
||||
const char *kPPMdMethod = "PPMd";
|
||||
const char *kAESMethod = "AES";
|
||||
const char *kZipCryptoMethod = "ZipCrypto";
|
||||
const char *kStrongCryptoMethod = "StrongCrypto";
|
||||
static const char *kBZip2Method = "BZip2";
|
||||
static const char *kLZMAMethod = "LZMA";
|
||||
static const char *kJpegMethod = "Jpeg";
|
||||
static const char *kWavPackMethod = "WavPack";
|
||||
static const char *kPPMdMethod = "PPMd";
|
||||
static const char *kAESMethod = "AES";
|
||||
static const char *kZipCryptoMethod = "ZipCrypto";
|
||||
static const char *kStrongCryptoMethod = "StrongCrypto";
|
||||
|
||||
struct CStrongCryptoPair
|
||||
static struct CStrongCryptoPair
|
||||
{
|
||||
UInt16 Id;
|
||||
const char *Name;
|
||||
};
|
||||
|
||||
CStrongCryptoPair g_StrongCryptoPairs[] =
|
||||
} g_StrongCryptoPairs[] =
|
||||
{
|
||||
{ NStrongCryptoFlags::kDES, "DES" },
|
||||
{ NStrongCryptoFlags::kRC2old, "RC2a" },
|
||||
@@ -132,7 +106,25 @@ CStrongCryptoPair g_StrongCryptoPairs[] =
|
||||
{ NStrongCryptoFlags::kRC4, "RC4" }
|
||||
};
|
||||
|
||||
STATPROPSTG kArcProps[] =
|
||||
static STATPROPSTG kProps[] =
|
||||
{
|
||||
{ NULL, kpidPath, VT_BSTR},
|
||||
{ NULL, kpidIsDir, VT_BOOL},
|
||||
{ NULL, kpidSize, VT_UI8},
|
||||
{ NULL, kpidPackSize, VT_UI8},
|
||||
{ NULL, kpidMTime, VT_FILETIME},
|
||||
{ NULL, kpidCTime, VT_FILETIME},
|
||||
{ NULL, kpidATime, VT_FILETIME},
|
||||
{ NULL, kpidAttrib, VT_UI4},
|
||||
{ NULL, kpidEncrypted, VT_BOOL},
|
||||
{ NULL, kpidComment, VT_BSTR},
|
||||
{ NULL, kpidCRC, VT_UI4},
|
||||
{ NULL, kpidMethod, VT_BSTR},
|
||||
{ NULL, kpidHostOS, VT_BSTR},
|
||||
{ NULL, kpidUnpackVer, VT_UI4}
|
||||
};
|
||||
|
||||
static STATPROPSTG kArcProps[] =
|
||||
{
|
||||
{ NULL, kpidBit64, VT_BOOL},
|
||||
{ NULL, kpidComment, VT_BSTR}
|
||||
@@ -289,7 +281,7 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val
|
||||
method += ' ';
|
||||
}
|
||||
}
|
||||
if (methodId < kNumMethods)
|
||||
if (methodId < sizeof(kMethods) / sizeof(kMethods[0]))
|
||||
method += kMethods[methodId];
|
||||
else switch (methodId)
|
||||
{
|
||||
@@ -316,6 +308,9 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val
|
||||
prop = (item.MadeByVersion.HostOS < sizeof(kHostOS) / sizeof(kHostOS[0])) ?
|
||||
(kHostOS[item.MadeByVersion.HostOS]) : kUnknownOS;
|
||||
break;
|
||||
case kpidUnpackVer:
|
||||
prop = (UInt32)item.ExtractVersion.Version;
|
||||
break;
|
||||
}
|
||||
prop.Detach(value);
|
||||
return S_OK;
|
||||
@@ -637,7 +632,7 @@ HRESULT CZipDecoder::Decode(
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
{
|
||||
CMyComPtr<ICompressSetCoderMt> setCoderMt;
|
||||
coder->QueryInterface(IID_ICompressSetCoderMt, (void **)&setCoderMt);
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "ZipIn.h"
|
||||
#include "ZipCompressionMode.h"
|
||||
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
#include "../../../Windows/System.h"
|
||||
#endif
|
||||
|
||||
@@ -63,7 +63,7 @@ private:
|
||||
bool m_ForseLocal;
|
||||
bool m_ForseUtf8;
|
||||
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
UInt32 _numThreads;
|
||||
#endif
|
||||
|
||||
@@ -85,7 +85,7 @@ private:
|
||||
m_WriteNtfsTimeExtra = false;
|
||||
m_ForseLocal = false;
|
||||
m_ForseUtf8 = false;
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
_numThreads = NWindows::NSystem::GetNumberOfProcessors();;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -297,7 +297,7 @@ STDMETHODIMP CHandler::UpdateItems(ISequentialOutStream *outStream, UInt32 numIt
|
||||
options.NumMatchFinderCycles = m_NumMatchFinderCycles;
|
||||
options.NumMatchFinderCyclesDefined = m_NumMatchFinderCyclesDefined;
|
||||
options.Algo = m_Algo;
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
options.NumThreads = _numThreads;
|
||||
#endif
|
||||
if (isLz)
|
||||
@@ -357,7 +357,7 @@ STDMETHODIMP CHandler::UpdateItems(ISequentialOutStream *outStream, UInt32 numIt
|
||||
|
||||
STDMETHODIMP CHandler::SetProperties(const wchar_t **names, const PROPVARIANT *values, Int32 numProperties)
|
||||
{
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
const UInt32 numProcessors = NSystem::GetNumberOfProcessors();
|
||||
_numThreads = numProcessors;
|
||||
#endif
|
||||
@@ -467,7 +467,7 @@ STDMETHODIMP CHandler::SetProperties(const wchar_t **names, const PROPVARIANT *v
|
||||
}
|
||||
else if (name.Left(2) == L"MT")
|
||||
{
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
RINOK(ParseMtProp(name.Mid(2), prop, numProcessors, _numThreads));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -80,10 +80,17 @@ namespace NFileHeader
|
||||
const int kNumCompressionMethods = 11;
|
||||
const Byte kMadeByProgramVersion = 20;
|
||||
|
||||
const Byte kDeflateExtractVersion = 20;
|
||||
const Byte kStoreExtractVersion = 10;
|
||||
const Byte kExtractVersion_Default = 10;
|
||||
const Byte kExtractVersion_Dir = 20;
|
||||
const Byte kExtractVersion_ZipCrypto = 20;
|
||||
const Byte kExtractVersion_Deflate = 20;
|
||||
const Byte kExtractVersion_Deflate64 = 21;
|
||||
const Byte kExtractVersion_Zip64 = 45;
|
||||
const Byte kExtractVersion_BZip2 = 46;
|
||||
const Byte kExtractVersion_Aes = 51;
|
||||
const Byte kExtractVersion_LZMA = 63;
|
||||
|
||||
const Byte kSupportedVersion = 20;
|
||||
// const Byte kSupportedVersion = 20;
|
||||
}
|
||||
|
||||
namespace NExtraID
|
||||
|
||||
@@ -2,10 +2,9 @@
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "ZipOut.h"
|
||||
#include "Common/StringConvert.h"
|
||||
#include "../../Common/OffsetStream.h"
|
||||
#include "../../Common/StreamUtils.h"
|
||||
|
||||
#include "ZipOut.h"
|
||||
|
||||
namespace NArchive {
|
||||
namespace NZip {
|
||||
@@ -115,7 +114,12 @@ void COutArchive::WriteLocalHeader(const CLocalItem &item)
|
||||
bool isZip64 = m_IsZip64 || item.PackSize >= 0xFFFFFFFF || item.UnPackSize >= 0xFFFFFFFF;
|
||||
|
||||
WriteUInt32(NSignature::kLocalFileHeader);
|
||||
WriteByte(item.ExtractVersion.Version);
|
||||
{
|
||||
Byte ver = item.ExtractVersion.Version;
|
||||
if (isZip64 && ver < NFileHeader::NCompressionMethod::kExtractVersion_Zip64)
|
||||
ver = NFileHeader::NCompressionMethod::kExtractVersion_Zip64;
|
||||
WriteByte(ver);
|
||||
}
|
||||
WriteByte(item.ExtractVersion.HostOS);
|
||||
WriteUInt16(item.Flags);
|
||||
WriteUInt16(item.CompressionMethod);
|
||||
@@ -162,7 +166,12 @@ void COutArchive::WriteCentralHeader(const CItem &item)
|
||||
WriteUInt32(NSignature::kCentralFileHeader);
|
||||
WriteByte(item.MadeByVersion.Version);
|
||||
WriteByte(item.MadeByVersion.HostOS);
|
||||
WriteByte(item.ExtractVersion.Version);
|
||||
{
|
||||
Byte ver = item.ExtractVersion.Version;
|
||||
if (isZip64 && ver < NFileHeader::NCompressionMethod::kExtractVersion_Zip64)
|
||||
ver = NFileHeader::NCompressionMethod::kExtractVersion_Zip64;
|
||||
WriteByte(ver);
|
||||
}
|
||||
WriteByte(item.ExtractVersion.HostOS);
|
||||
WriteUInt16(item.Flags);
|
||||
WriteUInt16(item.CompressionMethod);
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "../../Common/LimitedStreams.h"
|
||||
#include "../../Common/OutMemStream.h"
|
||||
#include "../../Common/ProgressUtils.h"
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
#include "../../Common/ProgressMt.h"
|
||||
#endif
|
||||
|
||||
@@ -40,7 +40,6 @@ static const Byte kMadeByHostOS = kHostOS;
|
||||
static const Byte kExtractHostOS = kHostOS;
|
||||
|
||||
static const Byte kMethodForDirectory = NFileHeader::NCompressionMethod::kStored;
|
||||
static const Byte kExtractVersionForDirectory = NFileHeader::NCompressionMethod::kStoreExtractVersion;
|
||||
|
||||
static HRESULT CopyBlockToArchive(ISequentialInStream *inStream,
|
||||
COutArchive &outArchive, ICompressProgressInfo *progress)
|
||||
@@ -101,7 +100,7 @@ static void SetFileHeader(
|
||||
item.SetEncrypted(!isDir && options.PasswordIsDefined);
|
||||
if (isDir)
|
||||
{
|
||||
item.ExtractVersion.Version = kExtractVersionForDirectory;
|
||||
item.ExtractVersion.Version = NFileHeader::NCompressionMethod::kExtractVersion_Dir;
|
||||
item.CompressionMethod = kMethodForDirectory;
|
||||
item.PackSize = 0;
|
||||
item.FileCRC = 0; // test it
|
||||
@@ -134,7 +133,7 @@ static void SetItemInfoFromCompressingResult(const CCompressingResult &compressi
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
|
||||
static THREAD_FUNC_DECL CoderThread(void *threadCoderInfo);
|
||||
|
||||
@@ -525,7 +524,7 @@ static HRESULT Update2(
|
||||
|
||||
complexity = 0;
|
||||
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
|
||||
const size_t kNumMaxThreads = (1 << 10);
|
||||
UInt32 numThreads = options->NumThreads;
|
||||
@@ -584,7 +583,7 @@ static HRESULT Update2(
|
||||
inputItems, updateItems, options, comment, updateCallback);
|
||||
|
||||
|
||||
#ifdef COMPRESS_MT
|
||||
#ifndef _7ZIP_ST
|
||||
|
||||
CObjectVector<CItem> items;
|
||||
|
||||
|
||||
7
CPP/7zip/Asm.mak
Executable file
7
CPP/7zip/Asm.mak
Executable file
@@ -0,0 +1,7 @@
|
||||
!IF "$(CPU)" == "ARM"
|
||||
$(ASM_OBJS): ../../../../Asm/Arm/$(*B).asm
|
||||
$(COMPL_ASM)
|
||||
!ELSEIF "$(CPU)" != "IA64" && "$(CPU)" != "MIPS"
|
||||
$(ASM_OBJS): ../../../../Asm/x86/$(*B).asm
|
||||
$(COMPL_ASM)
|
||||
!ENDIF
|
||||
@@ -44,7 +44,7 @@ RSC=rc.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /Gz /MT /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "_MBCS" /D "WIN32" /D "_CONSOLE" /D "COMPRESS_MF_MT" /D "COMPRESS_MT" /D "COMPRESS_BZIP2_MT" /D "BREAK_HANDLER" /D "_7ZIP_LARGE_PAGES" /D "BENCH_MT" /D "SUPPORT_DEVICE_FILE" /Yu"StdAfx.h" /FD /c
|
||||
# ADD CPP /nologo /Gz /MT /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "_MBCS" /D "WIN32" /D "_CONSOLE" /D "_7ZIP_LARGE_PAGES" /D "SUPPORT_DEVICE_FILE" /Yu"StdAfx.h" /FD /c
|
||||
# ADD BASE RSC /l 0x419 /d "NDEBUG"
|
||||
# ADD RSC /l 0x419 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@@ -69,7 +69,7 @@ LINK32=link.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /Gz /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\\" /D "_DEBUG" /D "_MBCS" /D "WIN32" /D "_CONSOLE" /D "COMPRESS_MF_MT" /D "COMPRESS_MT" /D "COMPRESS_BZIP2_MT" /D "BREAK_HANDLER" /D "_7ZIP_LARGE_PAGES" /D "BENCH_MT" /D "SUPPORT_DEVICE_FILE" /Yu"StdAfx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /Gz /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\\" /D "_DEBUG" /D "_MBCS" /D "WIN32" /D "_CONSOLE" /D "_7ZIP_LARGE_PAGES" /D "SUPPORT_DEVICE_FILE" /Yu"StdAfx.h" /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x419 /d "_DEBUG"
|
||||
# ADD RSC /l 0x419 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@@ -93,8 +93,8 @@ LINK32=link.exe
|
||||
# PROP Intermediate_Dir "ReleaseU"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "EXCLUDE_COM" /D "NO_REGISTRY" /D "FORMAT_7Z" /D "FORMAT_BZIP2" /D "FORMAT_ZIP" /D "FORMAT_TAR" /D "FORMAT_GZIP" /D "COMPRESS_LZMA" /D "COMPRESS_BCJ_X86" /D "COMPRESS_BCJ2" /D "COMPRESS_COPY" /D "COMPRESS_MF_PAT" /D "COMPRESS_MF_BT" /D "COMPRESS_PPMD" /D "COMPRESS_DEFLATE" /D "COMPRESS_IMPLODE" /D "COMPRESS_BZIP2" /D "CRYPTO_ZIP" /Yu"StdAfx.h" /FD /c
|
||||
# ADD CPP /nologo /Gz /MD /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "_CONSOLE" /D "COMPRESS_MF_MT" /D "COMPRESS_MT" /D "COMPRESS_BZIP2_MT" /D "BREAK_HANDLER" /D "_7ZIP_LARGE_PAGES" /D "BENCH_MT" /D "SUPPORT_DEVICE_FILE" /Yu"StdAfx.h" /FD /c
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "EXCLUDE_COM" /D "NO_REGISTRY" /Yu"StdAfx.h" /FD /c
|
||||
# ADD CPP /nologo /Gz /MD /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "_CONSOLE" /D "_7ZIP_LARGE_PAGES" /D "SUPPORT_DEVICE_FILE" /Yu"StdAfx.h" /FD /c
|
||||
# ADD BASE RSC /l 0x419 /d "NDEBUG"
|
||||
# ADD RSC /l 0x419 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@@ -120,8 +120,8 @@ LINK32=link.exe
|
||||
# PROP Intermediate_Dir "DebugU"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "EXCLUDE_COM" /D "NO_REGISTRY" /D "FORMAT_7Z" /D "FORMAT_BZIP2" /D "FORMAT_ZIP" /D "FORMAT_TAR" /D "FORMAT_GZIP" /D "COMPRESS_LZMA" /D "COMPRESS_BCJ_X86" /D "COMPRESS_BCJ2" /D "COMPRESS_COPY" /D "COMPRESS_MF_PAT" /D "COMPRESS_MF_BT" /D "COMPRESS_PPMD" /D "COMPRESS_DEFLATE" /D "COMPRESS_IMPLODE" /D "COMPRESS_BZIP2" /D "CRYPTO_ZIP" /D "_MBCS" /Yu"StdAfx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /Gz /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\\" /D "_DEBUG" /D "_UNICODE" /D "UNICODE" /D "WIN32" /D "_CONSOLE" /D "COMPRESS_MF_MT" /D "COMPRESS_MT" /D "COMPRESS_BZIP2_MT" /D "BREAK_HANDLER" /D "_7ZIP_LARGE_PAGES" /D "BENCH_MT" /D "SUPPORT_DEVICE_FILE" /Yu"StdAfx.h" /FD /GZ /c
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "EXCLUDE_COM" /D "NO_REGISTRY" /D "_MBCS" /Yu"StdAfx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /Gz /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\\" /D "_DEBUG" /D "_UNICODE" /D "UNICODE" /D "WIN32" /D "_CONSOLE" /D "_7ZIP_LARGE_PAGES" /D "SUPPORT_DEVICE_FILE" /Yu"StdAfx.h" /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x419 /d "_DEBUG"
|
||||
# ADD RSC /l 0x419 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@@ -176,6 +176,14 @@ SOURCE=..\..\UI\Console\List.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\UI\Console\BenchCon.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\UI\Console\BenchCon.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\UI\Console\Main.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -1099,26 +1107,6 @@ SOURCE=..\..\Compress\QuantumDecoder.cpp
|
||||
SOURCE=..\..\Compress\QuantumDecoder.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "LZMA_Alone"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Compress\LZMA_Alone\LzmaBench.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Compress\LZMA_Alone\LzmaBench.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Compress\LZMA_Alone\LzmaBenchCon.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Compress\LZMA_Alone\LzmaBenchCon.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Compress\Bcj2Coder.cpp
|
||||
@@ -1593,6 +1581,14 @@ SOURCE=..\..\Archive\Bz2Handler.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Archive\DeflateProps.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Archive\DeflateProps.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Archive\GzHandler.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -1681,6 +1677,14 @@ SOURCE=..\..\UI\Common\LoadCodecs.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\UI\Common\Bench.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\UI\Common\Bench.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\UI\Common\OpenArchive.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -2136,6 +2140,30 @@ SOURCE=..\..\..\..\C\7zCrc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\7zCrcOpt.c
|
||||
|
||||
!IF "$(CFG)" == "Alone - Win32 Release"
|
||||
|
||||
# ADD CPP /O2
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
|
||||
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
|
||||
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
|
||||
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\7zStream.c
|
||||
|
||||
!IF "$(CFG)" == "Alone - Win32 Release"
|
||||
@@ -2188,6 +2216,30 @@ SOURCE=..\..\..\..\C\Aes.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\AesOpt.c
|
||||
|
||||
!IF "$(CFG)" == "Alone - Win32 Release"
|
||||
|
||||
# ADD CPP /O2
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
|
||||
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
|
||||
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
|
||||
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\Alloc.c
|
||||
|
||||
!IF "$(CFG)" == "Alone - Win32 Release"
|
||||
@@ -2329,6 +2381,30 @@ SOURCE=..\..\..\..\C\BwtSort.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\CpuArch.c
|
||||
|
||||
!IF "$(CFG)" == "Alone - Win32 Release"
|
||||
|
||||
# ADD CPP /O2
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
|
||||
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
|
||||
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
|
||||
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\CpuArch.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
PROG = 7za.exe
|
||||
MY_CONSOLE = 1
|
||||
CFLAGS = $(CFLAGS) -I ../../../ \
|
||||
-DCOMPRESS_MT \
|
||||
-DCOMPRESS_BZIP2_MT \
|
||||
-DCOMPRESS_MF_MT \
|
||||
-DBREAK_HANDLER \
|
||||
-DBENCH_MT \
|
||||
CFLAGS = $(CFLAGS) -I ../../../
|
||||
|
||||
!IFNDEF UNDER_CE
|
||||
CFLAGS = $(CFLAGS) -DWIN_LONG_PATH -D_7ZIP_LARGE_PAGES -DSUPPORT_DEVICE_FILE
|
||||
!ENDIF
|
||||
|
||||
CONSOLE_OBJS = \
|
||||
$O\BenchCon.obj \
|
||||
$O\ConsoleClose.obj \
|
||||
$O\ExtractCallbackConsole.obj \
|
||||
$O\List.obj \
|
||||
@@ -78,6 +74,7 @@ UI_COMMON_OBJS = \
|
||||
$O\ArchiveCommandLine.obj \
|
||||
$O\ArchiveExtractCallback.obj \
|
||||
$O\ArchiveOpenCallback.obj \
|
||||
$O\Bench.obj \
|
||||
$O\DefaultName.obj \
|
||||
$O\EnumDirItems.obj \
|
||||
$O\Extract.obj \
|
||||
@@ -202,10 +199,6 @@ COMPRESS_OBJS = \
|
||||
$O\ShrinkDecoder.obj \
|
||||
$O\ZDecoder.obj \
|
||||
|
||||
LZMA_BENCH_OBJS = \
|
||||
$O\LzmaBench.obj \
|
||||
$O\LzmaBenchCon.obj \
|
||||
|
||||
CRYPTO_OBJS = \
|
||||
$O\7zAes.obj \
|
||||
$O\7zAesRegister.obj \
|
||||
@@ -220,12 +213,12 @@ CRYPTO_OBJS = \
|
||||
|
||||
C_OBJS = \
|
||||
$O\7zStream.obj \
|
||||
$O\Aes.obj \
|
||||
$O\Alloc.obj \
|
||||
$O\Bra.obj \
|
||||
$O\Bra86.obj \
|
||||
$O\BraIA64.obj \
|
||||
$O\BwtSort.obj \
|
||||
$O\CpuArch.obj \
|
||||
$O\Delta.obj \
|
||||
$O\HuffEnc.obj \
|
||||
$O\LzFind.obj \
|
||||
@@ -244,7 +237,8 @@ C_OBJS = \
|
||||
$O\XzEnc.obj \
|
||||
$O\XzIn.obj \
|
||||
|
||||
!include "../../Crc2.mak"
|
||||
!include "../../Aes.mak"
|
||||
!include "../../Crc.mak"
|
||||
|
||||
OBJS = \
|
||||
$O\StdAfx.obj \
|
||||
@@ -264,7 +258,7 @@ OBJS = \
|
||||
$(LZMA_BENCH_OBJS) \
|
||||
$(CRYPTO_OBJS) \
|
||||
$(C_OBJS) \
|
||||
$(CRC_OBJS) \
|
||||
$(ASM_OBJS) \
|
||||
$O\resource.res
|
||||
|
||||
|
||||
@@ -298,12 +292,10 @@ $(ZIP_OBJS): ../../Archive/Zip/$(*B).cpp
|
||||
$(COMPRESS_OBJS): ../../Compress/$(*B).cpp
|
||||
$(COMPL_O2)
|
||||
|
||||
$(LZMA_BENCH_OBJS): ../../Compress/LZMA_Alone/$(*B).cpp
|
||||
$(COMPL)
|
||||
|
||||
$(CRYPTO_OBJS): ../../Crypto/$(*B).cpp
|
||||
$(COMPL_O2)
|
||||
|
||||
$(C_OBJS): ../../../../C/$(*B).c
|
||||
$(COMPL_O2)
|
||||
!include "../../Crc.mak"
|
||||
|
||||
!include "../../Asm.mak"
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
PROG = 7zr.exe
|
||||
MY_CONSOLE = 1
|
||||
CFLAGS = $(CFLAGS) -I ../../../ \
|
||||
-DCOMPRESS_MT \
|
||||
-DCOMPRESS_MF_MT \
|
||||
-D_NO_CRYPTO \
|
||||
-DBREAK_HANDLER \
|
||||
-DBENCH_MT \
|
||||
|
||||
!IFNDEF UNDER_CE
|
||||
CFLAGS = $(CFLAGS) -DWIN_LONG_PATH
|
||||
!ENDIF
|
||||
|
||||
CONSOLE_OBJS = \
|
||||
$O\BenchCon.obj \
|
||||
$O\ConsoleClose.obj \
|
||||
$O\ExtractCallbackConsole.obj \
|
||||
$O\List.obj \
|
||||
@@ -75,6 +72,7 @@ UI_COMMON_OBJS = \
|
||||
$O\ArchiveCommandLine.obj \
|
||||
$O\ArchiveExtractCallback.obj \
|
||||
$O\ArchiveOpenCallback.obj \
|
||||
$O\Bench.obj \
|
||||
$O\DefaultName.obj \
|
||||
$O\EnumDirItems.obj \
|
||||
$O\Extract.obj \
|
||||
@@ -146,16 +144,13 @@ COMPRESS_OBJS = \
|
||||
$O\LzmaEncoder.obj \
|
||||
$O\LzmaRegister.obj \
|
||||
|
||||
LZMA_BENCH_OBJS = \
|
||||
$O\LzmaBench.obj \
|
||||
$O\LzmaBenchCon.obj \
|
||||
|
||||
C_OBJS = \
|
||||
$O\7zStream.obj \
|
||||
$O\Alloc.obj \
|
||||
$O\Bra.obj \
|
||||
$O\Bra86.obj \
|
||||
$O\BraIA64.obj \
|
||||
$O\Alloc.obj \
|
||||
$O\CpuArch.obj \
|
||||
$O\Delta.obj \
|
||||
$O\LzFind.obj \
|
||||
$O\LzFindMt.obj \
|
||||
@@ -172,7 +167,7 @@ C_OBJS = \
|
||||
$O\XzEnc.obj \
|
||||
$O\XzIn.obj \
|
||||
|
||||
!include "../../Crc2.mak"
|
||||
!include "../../Crc.mak"
|
||||
|
||||
OBJS = \
|
||||
$O\StdAfx.obj \
|
||||
@@ -185,9 +180,8 @@ OBJS = \
|
||||
$(AR_COMMON_OBJS) \
|
||||
$(7Z_OBJS) \
|
||||
$(COMPRESS_OBJS) \
|
||||
$(LZMA_BENCH_OBJS) \
|
||||
$(C_OBJS) \
|
||||
$(CRC_OBJS) \
|
||||
$(ASM_OBJS) \
|
||||
$O\resource.res
|
||||
|
||||
|
||||
@@ -213,8 +207,7 @@ $(7Z_OBJS): ../../Archive/7z/$(*B).cpp
|
||||
$(COMPL)
|
||||
$(COMPRESS_OBJS): ../../Compress/$(*B).cpp
|
||||
$(COMPL_O2)
|
||||
$(LZMA_BENCH_OBJS): ../../Compress/LZMA_Alone/$(*B).cpp
|
||||
$(COMPL)
|
||||
$(C_OBJS): ../../../../C/$(*B).c
|
||||
$(COMPL_O2)
|
||||
!include "../../Crc.mak"
|
||||
|
||||
!include "../../Asm.mak"
|
||||
|
||||
@@ -45,7 +45,7 @@ RSC=rc.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /Gz /MD /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "_MBCS" /D "WIN32" /D "_WINDOWS" /D "LANG" /D "WIN_LONG_PATH" /D "NEW_FOLDER_INTERFACE" /D "EXTERNAL_CODECS" /D "SUPPORT_DEVICE_FILE" /D "EXTERNAL_LZMA" /Yu"StdAfx.h" /FD /c
|
||||
# ADD CPP /nologo /Gz /MD /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "_MBCS" /D "WIN32" /D "_WINDOWS" /D "LANG" /D "WIN_LONG_PATH" /D "NEW_FOLDER_INTERFACE" /D "EXTERNAL_CODECS" /D "SUPPORT_DEVICE_FILE" /Yu"StdAfx.h" /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x419 /d "NDEBUG"
|
||||
@@ -72,7 +72,7 @@ LINK32=link.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /Gz /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\\" /D "_DEBUG" /D "_MBCS" /D "WIN32" /D "_WINDOWS" /D "LANG" /D "WIN_LONG_PATH" /D "NEW_FOLDER_INTERFACE" /D "EXTERNAL_CODECS" /D "SUPPORT_DEVICE_FILE" /D "EXTERNAL_LZMA" /Yu"StdAfx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /Gz /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\\" /D "_DEBUG" /D "_MBCS" /D "WIN32" /D "_WINDOWS" /D "LANG" /D "WIN_LONG_PATH" /D "NEW_FOLDER_INTERFACE" /D "EXTERNAL_CODECS" /D "SUPPORT_DEVICE_FILE" /Yu"StdAfx.h" /FD /GZ /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x419 /d "_DEBUG"
|
||||
@@ -99,7 +99,7 @@ LINK32=link.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Yu"StdAfx.h" /FD /c
|
||||
# ADD CPP /nologo /Gz /MD /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "LANG" /D "WIN_LONG_PATH" /D "NEW_FOLDER_INTERFACE" /D "EXTERNAL_CODECS" /D "SUPPORT_DEVICE_FILE" /D "EXTERNAL_LZMA" /Yu"StdAfx.h" /FD /c
|
||||
# ADD CPP /nologo /Gz /MD /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "LANG" /D "WIN_LONG_PATH" /D "NEW_FOLDER_INTERFACE" /D "EXTERNAL_CODECS" /D "SUPPORT_DEVICE_FILE" /Yu"StdAfx.h" /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x419 /d "NDEBUG"
|
||||
@@ -127,7 +127,7 @@ LINK32=link.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Yu"StdAfx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /Gz /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\\" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "LANG" /D "WIN_LONG_PATH" /D "NEW_FOLDER_INTERFACE" /D "EXTERNAL_CODECS" /D "SUPPORT_DEVICE_FILE" /D "EXTERNAL_LZMA" /Yu"StdAfx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /Gz /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\\" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "LANG" /D "WIN_LONG_PATH" /D "NEW_FOLDER_INTERFACE" /D "EXTERNAL_CODECS" /D "SUPPORT_DEVICE_FILE" /Yu"StdAfx.h" /FD /GZ /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x419 /d "_DEBUG"
|
||||
@@ -658,6 +658,31 @@ SOURCE=..\..\..\..\C\7zCrc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\7zCrcOpt.c
|
||||
|
||||
!IF "$(CFG)" == "FM - Win32 Release"
|
||||
|
||||
# ADD CPP /O2
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ELSEIF "$(CFG)" == "FM - Win32 Debug"
|
||||
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ELSEIF "$(CFG)" == "FM - Win32 ReleaseU"
|
||||
|
||||
# ADD CPP /O2
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ELSEIF "$(CFG)" == "FM - Win32 DebugU"
|
||||
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\Alloc.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
@@ -667,6 +692,35 @@ SOURCE=..\..\..\..\C\Alloc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\CpuArch.c
|
||||
|
||||
!IF "$(CFG)" == "FM - Win32 Release"
|
||||
|
||||
# ADD CPP /O2
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ELSEIF "$(CFG)" == "FM - Win32 Debug"
|
||||
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ELSEIF "$(CFG)" == "FM - Win32 ReleaseU"
|
||||
|
||||
# ADD CPP /O2
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ELSEIF "$(CFG)" == "FM - Win32 DebugU"
|
||||
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\CpuArch.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\Sha256.c
|
||||
|
||||
!IF "$(CFG)" == "FM - Win32 Release"
|
||||
@@ -1196,6 +1250,14 @@ SOURCE=..\..\UI\Common\ArchiveOpenCallback.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\UI\Common\Bench.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\UI\Common\Bench.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\UI\Common\CompressCall.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -1204,6 +1266,14 @@ SOURCE=..\..\UI\Common\CompressCall2.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Common\CreateCoder.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Common\CreateCoder.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\UI\Common\DefaultName.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -1248,6 +1318,14 @@ SOURCE=..\..\UI\Common\ExtractMode.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Common\FilterCoder.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Common\FilterCoder.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\UI\Common\IFileExtractCallback.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -1507,14 +1585,6 @@ SOURCE=..\..\Compress\CopyCoder.cpp
|
||||
|
||||
SOURCE=..\..\Compress\CopyCoder.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Compress\LZMA_Alone\LzmaBench.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Compress\LZMA_Alone\LzmaBench.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Interface"
|
||||
|
||||
|
||||
@@ -3,9 +3,6 @@ CFLAGS = $(CFLAGS) -I ../../../ \
|
||||
-DLANG \
|
||||
-DNEW_FOLDER_INTERFACE \
|
||||
-DEXTERNAL_CODECS \
|
||||
-DCOMPRESS_MT \
|
||||
-DCOMPRESS_BZIP2_MT \
|
||||
-DCOMPRESS_MF_MT \
|
||||
|
||||
!IFDEF UNDER_CE
|
||||
LIBS = $(LIBS) ceshell.lib Commctrl.lib
|
||||
@@ -206,6 +203,7 @@ UI_COMMON_OBJS = \
|
||||
$O\ArchiveExtractCallback.obj \
|
||||
$O\ArchiveName.obj \
|
||||
$O\ArchiveOpenCallback.obj \
|
||||
$O\Bench.obj \
|
||||
$O\CompressCall2.obj \
|
||||
$O\DefaultName.obj \
|
||||
$O\EnumDirItems.obj \
|
||||
@@ -388,9 +386,6 @@ COMPRESS_OBJS = \
|
||||
$O\ZlibEncoder.obj \
|
||||
$O\ZDecoder.obj \
|
||||
|
||||
LZMA_BENCH_OBJS = \
|
||||
$O\LzmaBench.obj \
|
||||
|
||||
CRYPTO_OBJS = \
|
||||
$O\7zAes.obj \
|
||||
$O\7zAesRegister.obj \
|
||||
@@ -409,12 +404,12 @@ CRYPTO_OBJS = \
|
||||
C_OBJS = \
|
||||
$O\7zBuf2.obj \
|
||||
$O\7zStream.obj \
|
||||
$O\Aes.obj \
|
||||
$O\Alloc.obj \
|
||||
$O\Bra.obj \
|
||||
$O\Bra86.obj \
|
||||
$O\BraIA64.obj \
|
||||
$O\BwtSort.obj \
|
||||
$O\CpuArch.obj \
|
||||
$O\Delta.obj \
|
||||
$O\HuffEnc.obj \
|
||||
$O\LzFind.obj \
|
||||
@@ -433,7 +428,8 @@ C_OBJS = \
|
||||
$O\XzEnc.obj \
|
||||
$O\XzIn.obj \
|
||||
|
||||
!include "../../Crc2.mak"
|
||||
!include "../../Aes.mak"
|
||||
!include "../../Crc.mak"
|
||||
|
||||
OBJS = \
|
||||
$O\StdAfx.obj \
|
||||
@@ -461,10 +457,9 @@ OBJS = \
|
||||
$(WIM_OBJS) \
|
||||
$(ZIP_OBJS) \
|
||||
$(COMPRESS_OBJS) \
|
||||
$(LZMA_BENCH_OBJS) \
|
||||
$(CRYPTO_OBJS) \
|
||||
$(CRC_OBJS) \
|
||||
$(C_OBJS) \
|
||||
$(ASM_OBJS) \
|
||||
$O\resource.res \
|
||||
|
||||
!include "../../../Build.mak"
|
||||
@@ -512,8 +507,6 @@ $(ZIP_OBJS): ../../Archive/Zip/$(*B).cpp
|
||||
|
||||
$(COMPRESS_OBJS): ../../Compress/$(*B).cpp
|
||||
$(COMPL_O2)
|
||||
$(LZMA_BENCH_OBJS): ../../Compress/LZMA_Alone/$(*B).cpp
|
||||
$(COMPL)
|
||||
|
||||
$(CRYPTO_OBJS): ../../Crypto/$(*B).cpp
|
||||
$(COMPL_O2)
|
||||
@@ -530,4 +523,4 @@ $(GUI_OBJS): ../../UI/GUI/$(*B).cpp
|
||||
$(C_OBJS): ../../../../C/$(*B).c
|
||||
$(COMPL_O2)
|
||||
|
||||
!include "../../Crc.mak"
|
||||
!include "../../Asm.mak"
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
PROG = 7za.dll
|
||||
DEF_FILE = ../../Archive/Archive2.def
|
||||
CFLAGS = $(CFLAGS) -I ../../../ \
|
||||
-DCOMPRESS_MT \
|
||||
-DCOMPRESS_MF_MT \
|
||||
-DCOMPRESS_BZIP2_MT \
|
||||
-DDEFLATE_EXTRACT_ONLY \
|
||||
-DBZIP2_EXTRACT_ONLY \
|
||||
|
||||
@@ -121,6 +118,7 @@ C_OBJS = \
|
||||
$O\Bra86.obj \
|
||||
$O\BraIA64.obj \
|
||||
$O\BwtSort.obj \
|
||||
$O\CpuArch.obj \
|
||||
$O\Delta.obj \
|
||||
$O\HuffEnc.obj \
|
||||
$O\LzFind.obj \
|
||||
@@ -134,7 +132,8 @@ C_OBJS = \
|
||||
$O\Sort.obj \
|
||||
$O\Threads.obj \
|
||||
|
||||
!include "../../Crc2.mak"
|
||||
!include "../../Aes.mak"
|
||||
!include "../../Crc.mak"
|
||||
|
||||
OBJS = \
|
||||
$O\StdAfx.obj \
|
||||
@@ -148,7 +147,7 @@ OBJS = \
|
||||
$(COMPRESS_OBJS) \
|
||||
$(CRYPTO_OBJS) \
|
||||
$(C_OBJS) \
|
||||
$(CRC_OBJS) \
|
||||
$(ASM_OBJS) \
|
||||
$O\resource.res
|
||||
|
||||
|
||||
@@ -177,4 +176,4 @@ $(CRYPTO_OBJS): ../../Crypto/$(*B).cpp
|
||||
$(C_OBJS): ../../../../C/$(*B).c
|
||||
$(COMPL_O2)
|
||||
|
||||
!include "../../Crc.mak"
|
||||
!include "../../Asm.mak"
|
||||
|
||||
@@ -2,8 +2,6 @@ PROG = 7zxa.dll
|
||||
DEF_FILE = ../../Archive/Archive2.def
|
||||
CFLAGS = $(CFLAGS) -I ../../../ \
|
||||
-DEXTRACT_ONLY \
|
||||
-DCOMPRESS_MT \
|
||||
-DCOMPRESS_BZIP2_MT \
|
||||
|
||||
COMMON_OBJS = \
|
||||
$O\CRC.obj \
|
||||
@@ -92,18 +90,19 @@ CRYPTO_OBJS = \
|
||||
$O\MyAes.obj \
|
||||
|
||||
C_OBJS = \
|
||||
$O\Aes.obj \
|
||||
$O\Alloc.obj \
|
||||
$O\Bra.obj \
|
||||
$O\Bra86.obj \
|
||||
$O\BraIA64.obj \
|
||||
$O\CpuArch.obj \
|
||||
$O\Delta.obj \
|
||||
$O\Lzma2Dec.obj \
|
||||
$O\LzmaDec.obj \
|
||||
$O\Sha256.obj \
|
||||
$O\Threads.obj \
|
||||
|
||||
!include "../../Crc2.mak"
|
||||
!include "../../Aes.mak"
|
||||
!include "../../Crc.mak"
|
||||
|
||||
OBJS = \
|
||||
$O\StdAfx.obj \
|
||||
@@ -117,7 +116,7 @@ OBJS = \
|
||||
$(COMPRESS_OBJS) \
|
||||
$(CRYPTO_OBJS) \
|
||||
$(C_OBJS) \
|
||||
$(CRC_OBJS) \
|
||||
$(ASM_OBJS) \
|
||||
$O\resource.res
|
||||
|
||||
|
||||
@@ -146,4 +145,4 @@ $(CRYPTO_OBJS): ../../Crypto/$(*B).cpp
|
||||
$(C_OBJS): ../../../../C/$(*B).c
|
||||
$(COMPL_O2)
|
||||
|
||||
!include "../../Crc.mak"
|
||||
!include "../../Asm.mak"
|
||||
|
||||
@@ -2,7 +2,6 @@ PROG = 7zxr.dll
|
||||
DEF_FILE = ../../Archive/Archive2.def
|
||||
CFLAGS = $(CFLAGS) -I ../../../ \
|
||||
-DEXTRACT_ONLY \
|
||||
-DCOMPRESS_MT \
|
||||
-D_NO_CRYPTO
|
||||
|
||||
COMMON_OBJS = \
|
||||
@@ -81,16 +80,18 @@ COMPRESS_OBJS = \
|
||||
$O\LzmaRegister.obj \
|
||||
|
||||
C_OBJS = \
|
||||
$O\7zCrc.obj \
|
||||
$O\Alloc.obj \
|
||||
$O\Bra.obj \
|
||||
$O\Bra86.obj \
|
||||
$O\BraIA64.obj \
|
||||
$O\CpuArch.obj \
|
||||
$O\Delta.obj \
|
||||
$O\Lzma2Dec.obj \
|
||||
$O\LzmaDec.obj \
|
||||
$O\Threads.obj \
|
||||
|
||||
!include "../../Crc.mak"
|
||||
|
||||
OBJS = \
|
||||
$O\StdAfx.obj \
|
||||
$(CONSOLE_OBJS) \
|
||||
@@ -102,6 +103,7 @@ OBJS = \
|
||||
$(7Z_OBJS) \
|
||||
$(COMPRESS_OBJS) \
|
||||
$(C_OBJS) \
|
||||
$(ASM_OBJS) \
|
||||
$O\resource.res
|
||||
|
||||
|
||||
@@ -126,3 +128,5 @@ $(COMPRESS_OBJS): ../../Compress/$(*B).cpp
|
||||
|
||||
$(C_OBJS): ../../../../C/$(*B).c
|
||||
$(COMPL_O2)
|
||||
|
||||
!include "../../Asm.mak"
|
||||
|
||||
@@ -43,7 +43,7 @@ RSC=rc.exe
|
||||
# PROP Ignore_Export_Lib 1
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MY7Z_EXPORTS" /YX /FD /c
|
||||
# ADD CPP /nologo /Gr /MT /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MY7Z_EXPORTS" /D "NO_REGISTRY" /D "COMPRESS_MF_MT" /D "COMPRESS_MT" /D "COMPRESS_BZIP2_MT" /D "EXTERNAL_CODECS" /D "_7ZIP_LARGE_PAGES" /D "_LZMA_PROB32_" /FAcs /Yu"StdAfx.h" /FD /c
|
||||
# ADD CPP /nologo /Gr /MT /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MY7Z_EXPORTS" /D "NO_REGISTRY" /D "EXTERNAL_CODECS" /D "_7ZIP_LARGE_PAGES" /FAcs /Yu"StdAfx.h" /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x419 /d "NDEBUG"
|
||||
@@ -70,7 +70,7 @@ LINK32=link.exe
|
||||
# PROP Ignore_Export_Lib 1
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MY7Z_EXPORTS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /Gr /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\..\SDK" /I "..\..\..\\" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MY7Z_EXPORTS" /D "NO_REGISTRY" /D "COMPRESS_MF_MT" /D "COMPRESS_MT" /D "COMPRESS_BZIP2_MT" /D "EXTERNAL_CODECS" /D "_7ZIP_LARGE_PAGES" /D "_LZMA_PROB32" /Yu"StdAfx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /Gr /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\..\SDK" /I "..\..\..\\" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MY7Z_EXPORTS" /D "NO_REGISTRY" /D "EXTERNAL_CODECS" /D "_7ZIP_LARGE_PAGES" /Yu"StdAfx.h" /FD /GZ /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x419 /d "_DEBUG"
|
||||
@@ -1316,6 +1316,11 @@ SOURCE=..\..\..\..\C\BwtSort.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\CpuArch.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\CpuArch.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -2175,6 +2180,10 @@ SOURCE=..\..\Archive\Udf\UdfRegister.cpp
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Archive\ApmHandler.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Archive\ArjHandler.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -2380,6 +2389,78 @@ SOURCE=..\..\..\Windows\Time.cpp
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\Time.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Asm"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\Asm\x86\7zAsm.asm
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\Asm\x86\7zCrcOpt.asm
|
||||
|
||||
!IF "$(CFG)" == "7z - Win32 Release"
|
||||
|
||||
# Begin Custom Build
|
||||
OutDir=.\Release
|
||||
InputPath=..\..\..\..\Asm\x86\7zCrcOpt.asm
|
||||
InputName=7zCrcOpt
|
||||
|
||||
"$(OutDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
ml.exe -c -Fo$(OutDir)\$(InputName).obj $(InputPath)
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "7z - Win32 Debug"
|
||||
|
||||
# Begin Custom Build
|
||||
OutDir=.\Debug
|
||||
InputPath=..\..\..\..\Asm\x86\7zCrcOpt.asm
|
||||
InputName=7zCrcOpt
|
||||
|
||||
"$(OutDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
ml.exe -c -omf -Fo$(OutDir)\$(InputName).obj $(InputPath)
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\Asm\x86\AesOpt.asm
|
||||
|
||||
!IF "$(CFG)" == "7z - Win32 Release"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
# Begin Custom Build
|
||||
OutDir=.\Release
|
||||
InputPath=..\..\..\..\Asm\x86\AesOpt.asm
|
||||
InputName=AesOpt
|
||||
|
||||
"$(OutDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
ml.exe -c -Fo$(OutDir)\$(InputName).obj $(InputPath)
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "7z - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
# Begin Custom Build
|
||||
OutDir=.\Debug
|
||||
InputPath=..\..\..\..\Asm\x86\AesOpt.asm
|
||||
InputName=AesOpt
|
||||
|
||||
"$(OutDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
ml.exe -c -omf -WX -W3 -Fo$(OutDir)\$(InputName).obj $(InputPath)
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
|
||||
@@ -2,9 +2,6 @@ PROG = 7z.dll
|
||||
DEF_FILE = ../../Archive/Archive2.def
|
||||
CFLAGS = $(CFLAGS) -I ../../../ \
|
||||
-DEXTERNAL_CODECS \
|
||||
-DCOMPRESS_MT \
|
||||
-DCOMPRESS_BZIP2_MT \
|
||||
-DCOMPRESS_MF_MT \
|
||||
|
||||
!IFNDEF UNDER_CE
|
||||
CFLAGS = $(CFLAGS) -D_7ZIP_LARGE_PAGES
|
||||
@@ -57,6 +54,7 @@ WIN_OBJS = \
|
||||
AR_OBJS = \
|
||||
$O\ArchiveExports.obj \
|
||||
$O\DllExports2.obj \
|
||||
$O\ApmHandler.obj \
|
||||
$O\ArjHandler.obj \
|
||||
$O\Bz2Handler.obj \
|
||||
$O\CpioHandler.obj \
|
||||
@@ -257,12 +255,12 @@ CRYPTO_OBJS = \
|
||||
C_OBJS = \
|
||||
$O\7zBuf2.obj \
|
||||
$O\7zStream.obj \
|
||||
$O\Aes.obj \
|
||||
$O\Alloc.obj \
|
||||
$O\Bra.obj \
|
||||
$O\Bra86.obj \
|
||||
$O\BraIA64.obj \
|
||||
$O\BwtSort.obj \
|
||||
$O\CpuArch.obj \
|
||||
$O\Delta.obj \
|
||||
$O\HuffEnc.obj \
|
||||
$O\LzFind.obj \
|
||||
@@ -281,7 +279,8 @@ C_OBJS = \
|
||||
$O\XzEnc.obj \
|
||||
$O\XzIn.obj \
|
||||
|
||||
!include "../../Crc2.mak"
|
||||
!include "../../Aes.mak"
|
||||
!include "../../Crc.mak"
|
||||
|
||||
OBJS = \
|
||||
$O\StdAfx.obj \
|
||||
@@ -306,7 +305,7 @@ OBJS = \
|
||||
$(COMPRESS_OBJS) \
|
||||
$(CRYPTO_OBJS) \
|
||||
$(C_OBJS) \
|
||||
$(CRC_OBJS) \
|
||||
$(ASM_OBJS) \
|
||||
$O\resource.res
|
||||
|
||||
|
||||
@@ -357,4 +356,4 @@ $(CRYPTO_OBJS): ../../Crypto/$(*B).cpp
|
||||
$(C_OBJS): ../../../../C/$(*B).c
|
||||
$(COMPL_O2)
|
||||
|
||||
!include "../../Crc.mak"
|
||||
!include "../../Asm.mak"
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
PROG = 7zra.dll
|
||||
DEF_FILE = ../../Archive/Archive2.def
|
||||
CFLAGS = $(CFLAGS) -I ../../../ \
|
||||
-DCOMPRESS_MT \
|
||||
-DCOMPRESS_MF_MT \
|
||||
-D_NO_CRYPTO
|
||||
|
||||
COMMON_OBJS = \
|
||||
@@ -94,11 +92,11 @@ COMPRESS_OBJS = \
|
||||
$O\LzmaRegister.obj \
|
||||
|
||||
C_OBJS = \
|
||||
$O\7zCrc.obj \
|
||||
$O\Alloc.obj \
|
||||
$O\Bra.obj \
|
||||
$O\Bra86.obj \
|
||||
$O\BraIA64.obj \
|
||||
$O\CpuArch.obj \
|
||||
$O\Delta.obj \
|
||||
$O\LzFind.obj \
|
||||
$O\LzFindMt.obj \
|
||||
@@ -109,6 +107,8 @@ C_OBJS = \
|
||||
$O\MtCoder.obj \
|
||||
$O\Threads.obj \
|
||||
|
||||
!include "../../Crc.mak"
|
||||
|
||||
OBJS = \
|
||||
$O\StdAfx.obj \
|
||||
$(CONSOLE_OBJS) \
|
||||
@@ -120,6 +120,7 @@ OBJS = \
|
||||
$(7Z_OBJS) \
|
||||
$(COMPRESS_OBJS) \
|
||||
$(C_OBJS) \
|
||||
$(ASM_OBJS) \
|
||||
$O\resource.res
|
||||
|
||||
|
||||
@@ -144,3 +145,5 @@ $(COMPRESS_OBJS): ../../Compress/$(*B).cpp
|
||||
|
||||
$(C_OBJS): ../../../../C/$(*B).c
|
||||
$(COMPL_O2)
|
||||
|
||||
!include "../../Asm.mak"
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "../../../Common/MyWindows.h"
|
||||
#include "../../../Common/MyInitGuid.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#if (defined(_WIN32) || defined(OS2) || defined(MSDOS)) && !defined(UNDER_CE)
|
||||
@@ -15,28 +12,32 @@
|
||||
#define MY_SET_BINARY_MODE(file)
|
||||
#endif
|
||||
|
||||
#include "../../../Common/CommandLineParser.h"
|
||||
#include "../../../Common/StringConvert.h"
|
||||
#include "../../../Common/StringToInt.h"
|
||||
|
||||
#include "../../../Windows/NtCheck.h"
|
||||
|
||||
#include "../../Common/FileStreams.h"
|
||||
#include "../../Common/StreamUtils.h"
|
||||
|
||||
#include "../LzmaDecoder.h"
|
||||
#include "../LzmaEncoder.h"
|
||||
|
||||
#include "LzmaBenchCon.h"
|
||||
|
||||
#ifdef COMPRESS_MF_MT
|
||||
#include "../../../Windows/System.h"
|
||||
#endif
|
||||
// #include "../../../Common/MyWindows.h"
|
||||
#include "../../../Common/MyInitGuid.h"
|
||||
|
||||
#include "../../../../C/7zVersion.h"
|
||||
#include "../../../../C/Alloc.h"
|
||||
#include "../../../../C/Lzma86.h"
|
||||
|
||||
#include "../../../Windows/NtCheck.h"
|
||||
|
||||
#ifndef _7ZIP_ST
|
||||
#include "../../../Windows/System.h"
|
||||
#endif
|
||||
|
||||
#include "../../../Common/CommandLineParser.h"
|
||||
#include "../../../Common/StringConvert.h"
|
||||
#include "../../../Common/StringToInt.h"
|
||||
|
||||
#include "../../Common/FileStreams.h"
|
||||
#include "../../Common/StreamUtils.h"
|
||||
|
||||
#include "../../Compress/LzmaDecoder.h"
|
||||
#include "../../Compress/LzmaEncoder.h"
|
||||
|
||||
#include "../../UI/Console/BenchCon.h"
|
||||
|
||||
|
||||
using namespace NCommandLineParser;
|
||||
|
||||
static const char *kCantAllocate = "Can not allocate memory";
|
||||
@@ -213,7 +214,7 @@ int main2(int numArgs, const char *args[])
|
||||
|
||||
UInt32 numThreads = (UInt32)-1;
|
||||
|
||||
#ifdef COMPRESS_MF_MT
|
||||
#ifndef _7ZIP_ST
|
||||
if (parser[NKey::kMultiThread].ThereIs)
|
||||
{
|
||||
UInt32 numCPUs = NWindows::NSystem::GetNumberOfProcessors();
|
||||
@@ -1,26 +1,24 @@
|
||||
# Microsoft Developer Studio Project File - Name="AloneLZMA" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Project File - Name="LzmaCon" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=AloneLZMA - Win32 DebugU
|
||||
CFG=LzmaCon - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "AloneLZMA.mak".
|
||||
!MESSAGE NMAKE /f "LzmaCon.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "AloneLZMA.mak" CFG="AloneLZMA - Win32 DebugU"
|
||||
!MESSAGE NMAKE /f "LzmaCon.mak" CFG="LzmaCon - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "AloneLZMA - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "AloneLZMA - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "AloneLZMA - Win32 ReleaseU" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "AloneLZMA - Win32 DebugU" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "LzmaCon - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "LzmaCon - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
@@ -30,7 +28,7 @@ CFG=AloneLZMA - Win32 DebugU
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "AloneLZMA - Win32 Release"
|
||||
!IF "$(CFG)" == "LzmaCon - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
@@ -44,7 +42,7 @@ RSC=rc.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "_MBCS" /D "WIN32" /D "_CONSOLE" /D "COMPRESS_MF_MT" /D "BENCH_MT" /FAcs /Yu"StdAfx.h" /FD /c
|
||||
# ADD CPP /nologo /Gr /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"StdAfx.h" /FD /c
|
||||
# ADD BASE RSC /l 0x419 /d "NDEBUG"
|
||||
# ADD RSC /l 0x419 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@@ -52,10 +50,9 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"c:\UTIL\lzma.exe" /opt:NOWIN98
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"C:\Util\lzma.exe"
|
||||
|
||||
!ELSEIF "$(CFG)" == "AloneLZMA - Win32 Debug"
|
||||
!ELSEIF "$(CFG)" == "LzmaCon - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
@@ -69,7 +66,7 @@ LINK32=link.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "_MBCS" /D "WIN32" /D "_CONSOLE" /D "COMPRESS_MF_MT" /D "BENCH_MT" /Yu"StdAfx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"StdAfx.h" /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x419 /d "_DEBUG"
|
||||
# ADD RSC /l 0x419 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@@ -77,68 +74,14 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"c:\UTIL\lzma.exe" /pdbtype:sept
|
||||
|
||||
!ELSEIF "$(CFG)" == "AloneLZMA - Win32 ReleaseU"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "ReleaseU"
|
||||
# PROP BASE Intermediate_Dir "ReleaseU"
|
||||
# PROP BASE Ignore_Export_Lib 0
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "ReleaseU"
|
||||
# PROP Intermediate_Dir "ReleaseU"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "EXCLUDE_COM" /D "NO_REGISTRY" /D "FORMAT_7Z" /D "FORMAT_BZIP2" /D "FORMAT_ZIP" /D "FORMAT_TAR" /D "FORMAT_GZIP" /D "COMPRESS_LZMA" /D "COMPRESS_BCJ_X86" /D "COMPRESS_BCJ2" /D "COMPRESS_COPY" /D "COMPRESS_MF_PAT" /D "COMPRESS_MF_BT" /D "COMPRESS_PPMD" /D "COMPRESS_DEFLATE" /D "COMPRESS_IMPLODE" /D "COMPRESS_BZIP2" /D "CRYPTO_ZIP" /Yu"StdAfx.h" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /D "NDEBUG" /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "_CONSOLE" /D "COMPRESS_MF_MT" /D "BENCH_MT" /Yu"StdAfx.h" /FD /c
|
||||
# ADD BASE RSC /l 0x419 /d "NDEBUG"
|
||||
# ADD RSC /l 0x419 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"c:\UTIL\7za2.exe" /opt:NOWIN98
|
||||
# SUBTRACT BASE LINK32 /pdb:none
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"c:\UTIL\lzma.exe" /opt:NOWIN98
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "AloneLZMA - Win32 DebugU"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "DebugU"
|
||||
# PROP BASE Intermediate_Dir "DebugU"
|
||||
# PROP BASE Ignore_Export_Lib 0
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "DebugU"
|
||||
# PROP Intermediate_Dir "DebugU"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "EXCLUDE_COM" /D "NO_REGISTRY" /D "FORMAT_7Z" /D "FORMAT_BZIP2" /D "FORMAT_ZIP" /D "FORMAT_TAR" /D "FORMAT_GZIP" /D "COMPRESS_LZMA" /D "COMPRESS_BCJ_X86" /D "COMPRESS_BCJ2" /D "COMPRESS_COPY" /D "COMPRESS_MF_PAT" /D "COMPRESS_MF_BT" /D "COMPRESS_PPMD" /D "COMPRESS_DEFLATE" /D "COMPRESS_IMPLODE" /D "COMPRESS_BZIP2" /D "CRYPTO_ZIP" /D "_MBCS" /Yu"StdAfx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "_UNICODE" /D "UNICODE" /D "WIN32" /D "_CONSOLE" /D "COMPRESS_MF_MT" /D "BENCH_MT" /Yu"StdAfx.h" /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x419 /d "_DEBUG"
|
||||
# ADD RSC /l 0x419 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"c:\UTIL\7za2.exe" /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"c:\UTIL\lzma.exe" /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"C:\Util\lzma.exe" /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "AloneLZMA - Win32 Release"
|
||||
# Name "AloneLZMA - Win32 Debug"
|
||||
# Name "AloneLZMA - Win32 ReleaseU"
|
||||
# Name "AloneLZMA - Win32 DebugU"
|
||||
# Name "LzmaCon - Win32 Release"
|
||||
# Name "LzmaCon - Win32 Debug"
|
||||
# Begin Group "Spec"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
@@ -154,27 +97,27 @@ SOURCE=.\StdAfx.h
|
||||
# End Group
|
||||
# Begin Group "Compress"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Group "LZMA"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\LzmaDecoder.cpp
|
||||
SOURCE=..\..\Compress\LzmaDecoder.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\LzmaDecoder.h
|
||||
SOURCE=..\..\Compress\LzmaDecoder.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\LzmaEncoder.cpp
|
||||
SOURCE=..\..\Compress\LzmaEncoder.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\LzmaEncoder.h
|
||||
SOURCE=..\..\Compress\LzmaEncoder.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Compress\LzmaRegister.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Group
|
||||
# Begin Group "Windows"
|
||||
|
||||
@@ -221,6 +164,10 @@ SOURCE=..\..\..\Common\CommandLineParser.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\ComTry.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\CRC.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -229,10 +176,6 @@ SOURCE=..\..\..\Common\Defs.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\Defs.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\IntToString.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -253,6 +196,10 @@ SOURCE=..\..\..\Common\MyString.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\MyUnknown.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\MyVector.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -261,6 +208,10 @@ SOURCE=..\..\..\Common\MyVector.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\MyWindows.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\MyWindows.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -297,6 +248,14 @@ SOURCE=..\..\..\Common\Types.h
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Common\CreateCoder.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Common\CreateCoder.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Common\CWrappers.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -313,19 +272,11 @@ SOURCE=..\..\Common\FileStreams.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Common\InBuffer.cpp
|
||||
SOURCE=..\..\Common\FilterCoder.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Common\InBuffer.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Common\OutBuffer.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Common\OutBuffer.h
|
||||
SOURCE=..\..\Common\FilterCoder.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -336,13 +287,49 @@ SOURCE=..\..\Common\StreamUtils.cpp
|
||||
SOURCE=..\..\Common\StreamUtils.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "UI Common"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\UI\Common\Bench.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\UI\Common\Bench.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\UI\Common\LoadCodecs.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\UI\Common\LoadCodecs.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Console"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\UI\Console\BenchCon.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\UI\Console\BenchCon.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\UI\Console\ConsoleClose.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\UI\Console\ConsoleClose.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "C"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Group "LzmaUtil"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\7zCrc.c
|
||||
@@ -354,6 +341,11 @@ SOURCE=..\..\..\..\C\7zCrc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\7zCrcOpt.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\Alloc.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
@@ -363,6 +355,11 @@ SOURCE=..\..\..\..\C\Alloc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\Bra.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\Bra.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -372,6 +369,20 @@ SOURCE=..\..\..\..\C\Bra86.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\BraIA64.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\CpuArch.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\CpuArch.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\LzFind.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
@@ -440,27 +451,7 @@ SOURCE=..\..\..\..\C\Types.h
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\ICoder.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\LzmaAlone.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\LzmaBench.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\LzmaBench.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\LzmaBenchCon.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\LzmaBenchCon.h
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -3,7 +3,7 @@ Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "AloneLZMA"=.\AloneLZMA.dsp - Package Owner=<4>
|
||||
Project: "LzmaCon"=.\LzmaCon.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
@@ -1,17 +1,14 @@
|
||||
PROG = lzma.exe
|
||||
MY_CONSOLE = 1
|
||||
CFLAGS = $(CFLAGS) \
|
||||
-DCOMPRESS_MF_MT \
|
||||
-DBENCH_MT \
|
||||
CFLAGS = $(CFLAGS)
|
||||
|
||||
LZMA_OBJS = \
|
||||
$O\LzmaAlone.obj \
|
||||
$O\LzmaBench.obj \
|
||||
$O\LzmaBenchCon.obj \
|
||||
|
||||
LZMA_OPT_OBJS = \
|
||||
COMPRESS_OBJS = \
|
||||
$O\LzmaDecoder.obj \
|
||||
$O\LzmaEncoder.obj \
|
||||
$O\LzmaRegister.obj \
|
||||
|
||||
COMMON_OBJS = \
|
||||
$O\CommandLineParser.obj \
|
||||
@@ -23,18 +20,28 @@ COMMON_OBJS = \
|
||||
$O\MyVector.obj
|
||||
|
||||
WIN_OBJS = \
|
||||
$O\FileIO.obj \
|
||||
$O\System.obj
|
||||
|
||||
7ZIP_COMMON_OBJS = \
|
||||
$O\CWrappers.obj \
|
||||
$O\InBuffer.obj \
|
||||
$O\CreateCoder.obj \
|
||||
$O\FileStreams.obj \
|
||||
$O\FilterCoder.obj \
|
||||
$O\OutBuffer.obj \
|
||||
$O\StreamUtils.obj \
|
||||
|
||||
UI_COMMON_OBJS = \
|
||||
$O\Bench.obj \
|
||||
|
||||
CONSOLE_OBJS = \
|
||||
$O\ConsoleClose.obj \
|
||||
$O\BenchCon.obj \
|
||||
|
||||
C_OBJS = \
|
||||
$O\7zCrc.obj \
|
||||
$O\Alloc.obj \
|
||||
$O\Bra86.obj \
|
||||
$O\CpuArch.obj \
|
||||
$O\LzFind.obj \
|
||||
$O\LzFindMt.obj \
|
||||
$O\Lzma86Dec.obj \
|
||||
@@ -43,23 +50,26 @@ C_OBJS = \
|
||||
$O\LzmaEnc.obj \
|
||||
$O\Threads.obj \
|
||||
|
||||
!include "../../Crc.mak"
|
||||
|
||||
OBJS = \
|
||||
$O\StdAfx.obj \
|
||||
$(LZMA_OBJS) \
|
||||
$(LZMA_OPT_OBJS) \
|
||||
$(COMPRESS_OBJS) \
|
||||
$(COMMON_OBJS) \
|
||||
$(WIN_OBJS) \
|
||||
$(7ZIP_COMMON_OBJS) \
|
||||
$(UI_COMMON_OBJS) \
|
||||
$(CONSOLE_OBJS) \
|
||||
$(C_OBJS) \
|
||||
$O\FileStreams.obj \
|
||||
$O\FileIO.obj \
|
||||
$(ASM_OBJS) \
|
||||
|
||||
!include "../../../Build.mak"
|
||||
|
||||
|
||||
$(LZMA_OBJS): $(*B).cpp
|
||||
$(COMPL)
|
||||
$(LZMA_OPT_OBJS): ../$(*B).cpp
|
||||
$(COMPRESS_OBJS): ../../Compress/$(*B).cpp
|
||||
$(COMPL_O2)
|
||||
$(COMMON_OBJS): ../../../Common/$(*B).cpp
|
||||
$(COMPL)
|
||||
@@ -67,9 +77,11 @@ $(WIN_OBJS): ../../../Windows/$(*B).cpp
|
||||
$(COMPL)
|
||||
$(7ZIP_COMMON_OBJS): ../../Common/$(*B).cpp
|
||||
$(COMPL)
|
||||
$O\FileStreams.obj: ../../Common/FileStreams.cpp
|
||||
$(UI_COMMON_OBJS): ../../UI/Common/$(*B).cpp
|
||||
$(COMPL)
|
||||
$O\FileIO.obj: ../../../Windows/FileIO.cpp
|
||||
$(CONSOLE_OBJS): ../../UI/Console/$(*B).cpp
|
||||
$(COMPL)
|
||||
$(C_OBJS): ../../../../C/$(*B).c
|
||||
$(COMPL_O2)
|
||||
|
||||
!include "../../Asm.mak"
|
||||
@@ -3,7 +3,7 @@ CXX = g++ -O2 -Wall
|
||||
CXX_C = gcc -O2 -Wall
|
||||
LIB = -lm
|
||||
RM = rm -f
|
||||
CFLAGS = -c
|
||||
CFLAGS = -c -D_7ZIP_ST
|
||||
|
||||
ifdef SystemDrive
|
||||
IS_MINGW = 1
|
||||
@@ -20,14 +20,16 @@ endif
|
||||
|
||||
OBJS = \
|
||||
LzmaAlone.o \
|
||||
LzmaBench.o \
|
||||
LzmaBenchCon.o \
|
||||
Bench.o \
|
||||
BenchCon.o \
|
||||
ConsoleClose.o \
|
||||
LzmaDecoder.o \
|
||||
LzmaEncoder.o \
|
||||
LzmaRegister.o \
|
||||
CreateCoder.o \
|
||||
CWrappers.o \
|
||||
InBuffer.o \
|
||||
OutBuffer.o \
|
||||
FileStreams.o \
|
||||
FilterCoder.o \
|
||||
StreamUtils.o \
|
||||
$(FILE_IO).o \
|
||||
CommandLineParser.o \
|
||||
@@ -38,8 +40,10 @@ OBJS = \
|
||||
StringToInt.o \
|
||||
MyVector.o \
|
||||
7zCrc.o \
|
||||
7zCrcOpt.o \
|
||||
Alloc.o \
|
||||
Bra86.o \
|
||||
CpuArch.o \
|
||||
LzFind.o \
|
||||
LzmaDec.o \
|
||||
LzmaEnc.o \
|
||||
@@ -55,30 +59,36 @@ $(PROG): $(OBJS)
|
||||
LzmaAlone.o: LzmaAlone.cpp
|
||||
$(CXX) $(CFLAGS) LzmaAlone.cpp
|
||||
|
||||
LzmaBench.o: LzmaBench.cpp
|
||||
$(CXX) $(CFLAGS) LzmaBench.cpp
|
||||
Bench.o: ../../UI/Common/Bench.cpp
|
||||
$(CXX) $(CFLAGS) ../../UI/Common/Bench.cpp
|
||||
|
||||
LzmaBenchCon.o: LzmaBenchCon.cpp
|
||||
$(CXX) $(CFLAGS) LzmaBenchCon.cpp
|
||||
BenchCon.o: ../../UI/Console/BenchCon.cpp
|
||||
$(CXX) $(CFLAGS) ../../UI/Console/BenchCon.cpp
|
||||
|
||||
LzmaDecoder.o: ../LzmaDecoder.cpp
|
||||
$(CXX) $(CFLAGS) ../LzmaDecoder.cpp
|
||||
ConsoleClose.o: ../../UI/Console/ConsoleClose.cpp
|
||||
$(CXX) $(CFLAGS) ../../UI/Console/ConsoleClose.cpp
|
||||
|
||||
LzmaEncoder.o: ../LzmaEncoder.cpp
|
||||
$(CXX) $(CFLAGS) ../LzmaEncoder.cpp
|
||||
LzmaDecoder.o: ../../Compress/LzmaDecoder.cpp
|
||||
$(CXX) $(CFLAGS) ../../Compress/LzmaDecoder.cpp
|
||||
|
||||
LzmaEncoder.o: ../../Compress/LzmaEncoder.cpp
|
||||
$(CXX) $(CFLAGS) ../../Compress/LzmaEncoder.cpp
|
||||
|
||||
LzmaRegister.o: ../../Compress/LzmaRegister.cpp
|
||||
$(CXX) $(CFLAGS) ../../Compress/LzmaRegister.cpp
|
||||
|
||||
CreateCoder.o: ../../Common/CreateCoder.cpp
|
||||
$(CXX) $(CFLAGS) ../../Common/CreateCoder.cpp
|
||||
|
||||
CWrappers.o: ../../Common/CWrappers.cpp
|
||||
$(CXX) $(CFLAGS) ../../Common/CWrappers.cpp
|
||||
|
||||
InBuffer.o: ../../Common/InBuffer.cpp
|
||||
$(CXX) $(CFLAGS) ../../Common/InBuffer.cpp
|
||||
|
||||
OutBuffer.o: ../../Common/OutBuffer.cpp
|
||||
$(CXX) $(CFLAGS) ../../Common/OutBuffer.cpp
|
||||
|
||||
FileStreams.o: ../../Common/FileStreams.cpp
|
||||
$(CXX) $(CFLAGS) ../../Common/FileStreams.cpp
|
||||
|
||||
FilterCoder.o: ../../Common/FilterCoder.cpp
|
||||
$(CXX) $(CFLAGS) ../../Common/FilterCoder.cpp
|
||||
|
||||
StreamUtils.o: ../../Common/StreamUtils.cpp
|
||||
$(CXX) $(CFLAGS) ../../Common/StreamUtils.cpp
|
||||
|
||||
@@ -113,12 +123,18 @@ MyVector.o: ../../../Common/MyVector.cpp
|
||||
7zCrc.o: ../../../../C/7zCrc.c
|
||||
$(CXX_C) $(CFLAGS) ../../../../C/7zCrc.c
|
||||
|
||||
7zCrcOpt.o: ../../../../C/7zCrcOpt.c
|
||||
$(CXX_C) $(CFLAGS) ../../../../C/7zCrcOpt.c
|
||||
|
||||
Alloc.o: ../../../../C/Alloc.c
|
||||
$(CXX_C) $(CFLAGS) ../../../../C/Alloc.c
|
||||
|
||||
Bra86.o: ../../../../C/Bra86.c
|
||||
$(CXX_C) $(CFLAGS) ../../../../C/Bra86.c
|
||||
|
||||
CpuArch.o: ../../../../C/CpuArch.c
|
||||
$(CXX_C) $(CFLAGS) ../../../../C/CpuArch.c
|
||||
|
||||
LzFind.o: ../../../../C/LzFind.c
|
||||
$(CXX_C) $(CFLAGS) ../../../../C/LzFind.c
|
||||
|
||||
@@ -42,7 +42,7 @@ RSC=rc.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /Gz /MD /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "COMPRESS_BCJ2" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "EXTRACT_ONLY" /D "_SFX" /D "NO_READ_FROM_CODER" /Yu"StdAfx.h" /FD /c
|
||||
# ADD CPP /nologo /Gz /MD /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "EXTRACT_ONLY" /D "_SFX" /D "NO_READ_FROM_CODER" /Yu"StdAfx.h" /FD /c
|
||||
# ADD BASE RSC /l 0x419 /d "NDEBUG"
|
||||
# ADD RSC /l 0x419 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@@ -710,6 +710,11 @@ SOURCE=..\..\..\..\C\7zCrc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\7zCrcOpt.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\Aes.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
@@ -719,6 +724,11 @@ SOURCE=..\..\..\..\C\Aes.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\AesOpt.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\Alloc.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
@@ -737,6 +747,11 @@ SOURCE=..\..\..\..\C\Bra86.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\CpuArch.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\Lzma2Dec.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
|
||||
@@ -38,7 +38,7 @@ WIN_OBJS = \
|
||||
$O\FileName.obj \
|
||||
$O\PropVariant.obj \
|
||||
$O\PropVariantConversions.obj \
|
||||
$O\Synchronization.obj
|
||||
$O\Synchronization.obj \
|
||||
|
||||
7ZIP_COMMON_OBJS = \
|
||||
$O\CreateCoder.obj \
|
||||
@@ -103,15 +103,16 @@ CRYPTO_OBJS = \
|
||||
$O\MyAes.obj \
|
||||
|
||||
C_OBJS = \
|
||||
$O\Aes.obj \
|
||||
$O\Alloc.obj \
|
||||
$O\Bra86.obj \
|
||||
$O\CpuArch.obj \
|
||||
$O\Lzma2Dec.obj \
|
||||
$O\LzmaDec.obj \
|
||||
$O\Sha256.obj \
|
||||
$O\Threads.obj \
|
||||
|
||||
!include "../../Crc2.mak"
|
||||
!include "../../Aes.mak"
|
||||
!include "../../Crc.mak"
|
||||
|
||||
OBJS = \
|
||||
$O\StdAfx.obj \
|
||||
@@ -126,7 +127,7 @@ OBJS = \
|
||||
$(COMPRESS_OBJS) \
|
||||
$(CRYPTO_OBJS) \
|
||||
$(C_OBJS) \
|
||||
$(CRC_OBJS) \
|
||||
$(ASM_OBJS) \
|
||||
$O\resource.res
|
||||
|
||||
|
||||
@@ -157,4 +158,4 @@ $(CRYPTO_OBJS): ../../Crypto/$(*B).cpp
|
||||
$(C_OBJS): ../../../../C/$(*B).c
|
||||
$(COMPL_O2)
|
||||
|
||||
!include "../../Crc.mak"
|
||||
!include "../../Asm.mak"
|
||||
|
||||
@@ -97,7 +97,7 @@ LINK32=link.exe
|
||||
# PROP Intermediate_Dir "ReleaseD"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O1 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "EXTRACT_ONLY" /D "EXCLUDE_COM" /D "NO_REGISTRY" /D "FORMAT_7Z" /D "COMPRESS_LZMA" /D "COMPRESS_BCJ_X86" /D "COMPRESS_BCJ2" /D "COMPRESS_COPY" /D "_SFX" /Yu"StdAfx.h" /FD /c
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O1 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "EXTRACT_ONLY" /D "EXCLUDE_COM" /D "NO_REGISTRY" /D "_SFX" /Yu"StdAfx.h" /FD /c
|
||||
# ADD CPP /nologo /Gz /MD /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "EXTRACT_ONLY" /D "NO_REGISTRY" /D "_SFX" /D "_NO_CRYPTO" /Yu"StdAfx.h" /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
@@ -650,6 +650,11 @@ SOURCE=..\..\..\..\C\7zCrc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\7zCrcOpt.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\Alloc.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
@@ -668,6 +673,15 @@ SOURCE=..\..\..\..\C\Bra86.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\CpuArch.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\CpuArch.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\LzmaDec.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
|
||||
@@ -92,10 +92,11 @@ COMPRESS_OBJS = \
|
||||
C_OBJS = \
|
||||
$O\Alloc.obj \
|
||||
$O\Bra86.obj \
|
||||
$O\CpuArch.obj \
|
||||
$O\LzmaDec.obj \
|
||||
$O\Threads.obj \
|
||||
|
||||
!include "../../Crc2.mak"
|
||||
!include "../../Crc.mak"
|
||||
|
||||
OBJS = \
|
||||
$O\StdAfx.obj \
|
||||
@@ -111,7 +112,7 @@ OBJS = \
|
||||
$(COMPRESS_OBJS) \
|
||||
$O\MyMessages.obj \
|
||||
$(C_OBJS) \
|
||||
$(CRC_OBJS) \
|
||||
$(ASM_OBJS) \
|
||||
$O\resource.res
|
||||
|
||||
|
||||
@@ -146,4 +147,4 @@ $O\MyMessages.obj: ../../UI/Explorer/MyMessages.cpp
|
||||
$(C_OBJS): ../../../../C/$(*B).c
|
||||
$(COMPL_O2)
|
||||
|
||||
!include "../../Crc.mak"
|
||||
!include "../../Asm.mak"
|
||||
|
||||
@@ -97,7 +97,7 @@ LINK32=link.exe
|
||||
# PROP Intermediate_Dir "SFXWin___Win32_ReleaseD"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /Gz /MT /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "EXTRACT_ONLY" /D "EXCLUDE_COM" /D "NO_REGISTRY" /D "FORMAT_7Z" /D "COMPRESS_LZMA" /D "COMPRESS_BCJ_X86" /D "COMPRESS_BCJ2" /D "COMPRESS_COPY" /D "COMPRESS_PPMD" /D "_SFX" /D "CRYPTO_7ZAES" /D "CRYPTO_AES" /Yu"StdAfx.h" /FD /c
|
||||
# ADD BASE CPP /nologo /Gz /MT /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "EXTRACT_ONLY" /D "EXCLUDE_COM" /D "NO_REGISTRY" /D "_SFX" /Yu"StdAfx.h" /FD /c
|
||||
# ADD CPP /nologo /Gz /MD /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "_SFXWIN32" /D "_WINDOWS" /D "_MBCS" /D "EXTRACT_ONLY" /D "NO_REGISTRY" /D "NO_READ_FROM_CODER" /D "_SFX" /Yu"StdAfx.h" /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
@@ -770,6 +770,11 @@ SOURCE=..\..\..\..\C\7zCrc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\7zCrcOpt.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\Aes.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
@@ -779,6 +784,11 @@ SOURCE=..\..\..\..\C\Aes.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\AesOpt.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\Alloc.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
@@ -797,6 +807,11 @@ SOURCE=..\..\..\..\C\Bra86.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\CpuArch.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\Lzma2Dec.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
|
||||
@@ -120,15 +120,16 @@ CRYPTO_OBJS = \
|
||||
$O\MyAes.obj \
|
||||
|
||||
C_OBJS = \
|
||||
$O\Aes.obj \
|
||||
$O\Alloc.obj \
|
||||
$O\Bra86.obj \
|
||||
$O\CpuArch.obj \
|
||||
$O\Lzma2Dec.obj \
|
||||
$O\LzmaDec.obj \
|
||||
$O\Sha256.obj \
|
||||
$O\Threads.obj \
|
||||
|
||||
!include "../../Crc2.mak"
|
||||
!include "../../Aes.mak"
|
||||
!include "../../Crc.mak"
|
||||
|
||||
OBJS = \
|
||||
$O\StdAfx.obj \
|
||||
@@ -146,7 +147,7 @@ OBJS = \
|
||||
$(CRYPTO_OBJS) \
|
||||
$O\MyMessages.obj \
|
||||
$(C_OBJS) \
|
||||
$(CRC_OBJS) \
|
||||
$(ASM_OBJS) \
|
||||
$O\resource.res
|
||||
|
||||
|
||||
@@ -184,4 +185,4 @@ $O\MyMessages.obj: ../../UI/Explorer/MyMessages.cpp
|
||||
$(C_OBJS): ../../../../C/$(*B).c
|
||||
$(COMPL_O2)
|
||||
|
||||
!include "../../Crc.mak"
|
||||
!include "../../Asm.mak"
|
||||
|
||||
@@ -7,6 +7,7 @@ DIRS = \
|
||||
Format7zR\~ \
|
||||
Format7zExtract\~ \
|
||||
Format7zExtractR\~ \
|
||||
LzmaCon\~ \
|
||||
SFXCon\~ \
|
||||
SFXSetup\~ \
|
||||
SFXWin\~ \
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "../../Windows/Defs.h"
|
||||
#include "../../Windows/PropVariant.h"
|
||||
|
||||
#include "CreateCoder.h"
|
||||
|
||||
#include "../../Windows/PropVariant.h"
|
||||
#include "../../Windows/Defs.h"
|
||||
#include "FilterCoder.h"
|
||||
#include "RegisterCodec.h"
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// CreateCoder.h
|
||||
|
||||
#ifndef __CREATECODER_H
|
||||
#define __CREATECODER_H
|
||||
#ifndef __CREATE_CODER_H
|
||||
#define __CREATE_CODER_H
|
||||
|
||||
#include "Common/MyCom.h"
|
||||
#include "Common/MyString.h"
|
||||
#include "../../Common/MyCom.h"
|
||||
#include "../../Common/MyString.h"
|
||||
#include "../ICoder.h"
|
||||
|
||||
#include "MethodId.h"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user