xor ax,ax
;-----------------------------------------------------------------
Processing label near
call NextChar
ja NotQuote
;------------------------------------
InString label near
jb BuildArgv
call NextChar
ja InString
;------------------------------------
NotQuote label near
cmp al,' '
je EndArgument
cmp al,13
je EndArgument
cmp al,9
jne Processing
;-----------------------------------
EndArgument label near
xor al,al
;------------------------------
push bx
; push dx
; dec dx
shl bx,1
mov word ptr cs:Argv2[bx],dx
; pop dx
pop bx
;-------------------------------
jmp short Processing
NextChar proc near
or ax,ax
jz NextChar0
inc dx
stosb
or al,al
jnz NextChar0
inc bx
NextChar0 label near
xchg ah,al
xor al,al
stc
jcxz NextChar2
lodsb
dec cx
sub al,'"'
jz NextChar2
add al,'"'
cmp al,'\'
jnz NextChar1
cmp byte ptr ds:[si],'"'
jne NextChar1
lodsb
dec cx
NextChar1 label near
or si,si
NextChar2 label near
ret
NextChar endp
;-------------------------------------------------
BuildArgv label near
push cs
pop ds
push cs
pop es
; mov ds:_Argc,bx
mov di,si
@@1 label near
lodsw
add ax,bx
cmp dx,cx
jz @1st
inc ax
@1st label near
stosw
loop @@1
;------------------------------------
pop bx
cmp bx,3
jb Test_argu
;lea si,Argv3
mov si,cs:argv3
lodsb
;------------------
cmp al,'T' ; to try !
jz Forced ; I want make it can unlock some unknowe version bitlok
cmp al,'t'
jz Forced ;add 1995,9,20
;------------------
cmp al,'0'
jb Continue
cmp al,'K'
ja Continue
cmp al,'9'
jbe Ten
cmp al,'A'
jb Continue
Hex:
sub al,'A'-0ah
jmp Set_Scheme
Ten:
sub al,'0'
Set_Scheme:
mov byte ptr ds:SchemeSign,al
jmp short Continue
Test_argu label near
cmp bx,2
jnb Continue
;---------------------------
lea dx,Useage_Msg
Quit label near
mov ah,9
int 21h
mov ah,4ch
int 21h
;------------------------------------------------------
;------------------------------------------------------
Forced:
lea dx,Forced_MSG ;add 19950920
mov ah,9
int 21h
mov byte ptr cs:Force,1
;---------------------------------
Continue label near
;--------added 950629
lea dx,Processing_MSG
mov ah,9
int 21h
;--------
shr cx,1
dec cx
xor ds:[si],bx
xor dx,dx
UnlockFF_0:
lodsw
push cx
inc dx
mov cl,dl
and cl,0fh
xor ds:[si],bx
rol word ptr ds:[si],cl
xor ds:[si],dx
pop cx
xor ds:[si],ax
loop UnlockFF_0
pop dx
pop cx
pop bx
pop ax
ret
UnlockFF endp
;------------------------------------------------
; UnLock Schem 0 ;
UnLock0 proc near ;
jmp UnLock ;
retn ;
UnLock0 endp
;
UnLock1 proc near
shr cx,1 ;
dec cx ;
jcxz Unlock1_2 ;
push ax ;
push di ;
push es ;
push ds ;
pop es ;
mov ax,cx ;
shl ax,1 ;
mov di,si ;
add di,ax ;
Unlock1_0: lodsb ;
mov ah,byte ptr [di] ;
xor ax,bx ;
push cx ;
and cx,3fh ;
cmp cx,29h ;
pop cx ;
jne short Unlock1_1 ;
xor ax,1997h ;
Unlock1_1: stosb ;
dec di ;
dec di ;
mov byte ptr [si-01],ah ;
loop Unlock1_0 ;
pop es ;
pop di ;
pop ax ;
Unlock1_2: retn ;
UnLock1 endp
;
UnLock2 proc near
shr cx,1 ;
dec cx ;
push ax ;
push dx ;
push bp ;
xor bp,bp ;
xor word ptr [si],bx ;
Unlock2_0: lodsw ;
push cx ;
inc bp ;
mov cx,bp ;
and cx,0fh ;
mov dx,word ptr [si] ;
xor dx,bx ;
rol dx,cl ;
xor dx,bp ;
xor ax,word ptr cs:KEY2 ; !!!
xor dx,ax ;
xchg dh,dl ;
mov word ptr [si],dx ;
pop cx ;
loop Unlock2_0 ;
pop bp ;
pop dx ;
pop ax ;
retn ;
UnLock2 endp
;
UnLock3 proc near
jmp Unlock3_start ;
;------------------------------------------------
UL3_Buf1 db 09,0ch,03,06,0bh,0fh ; 19e1
db 08,01,07,05,04,0ah ;
db 02,0eh,0dh,00,08,06 ;
db 04,00,09,07,02,0ah ;
db 0dh,01,0fh,0bh,05,0ch ;
db 03,0eh,04,09,03,0fh ;
db 01,0bh,02,0ch,07,00 ;
db 05,0ah,06,0eh,0dh,08 ;
db 04,0ah,0fh,0dh,0bh,05 ;
db 0eh,0ch,09,06,00,07 ;
db 03,02,08,01,02,06 ;
db 05,0dh,04,0ah,03,08 ;
db 01,0eh,07,09,0ch,00 ;
db 0bh,0fh,02,0dh,08,00 ;
db 0ah,09,03,05,04,0eh ;
db 0bh,07,0ch,06,0fh,01 ;
db 03,05,06,01,0fh,09 ;
db 07,0ch,0bh,02,0ah,0dh ;
db 04,0eh,00,08,0ah,0dh ;
db 07,0eh,08,02,01,09 ;
db 04,0ch,0fh,06,0bh,03 ;
db 05,00,00,00,00,40h ;
db 02,00,01,00,00,01 ;
db 10h,00,00,04,80h,00 ;
db 08,00,00,10h,04,00 ;
db 00,02,00,20h,40h,00 ;
db 00,80h,00,08,20h,00 ;
UL3_Buf2 db 07,0ah,0ch,09,0dh,05 ;
db 00,04,03,01,0fh,08 ;
db 0bh,02,0eh,06,08,09 ;
db 02,0ah,07,0bh,03,0eh ;
db 05,06,00,0dh,0ch,04 ;
db 0fh,01,08,01,05,0ch ;
db 0bh,04,0dh,03,06,02 ;
db 0ah,0eh,00,09,07,0fh ;
db 06,02,04,08,00,0fh ;
db 0bh,0eh,09,01,05,03 ;
db 0dh,07,0ch,0ah,08,0dh ;
db 0ch,00,07,01,09,0bh ;
db 03,0eh,04,02,05,0fh ;
db 06,0ah,07,0bh,0ah,0ch ;
db 02,04,09,0eh,03,08 ;
db 01,0fh,00,05,06,0dh ;
db 09,07,0bh,02,04,05 ;
db 08,03,00,01,0dh,0ch ;
db 0eh,06,0ah,0fh,0ch,05 ;
db 0bh,09,06,0dh,0fh,07 ;
db 02,01,0ah,04,08,0eh ;
db 00,03 ;
UL3_AX dw 00 ;
UL3_CX dw 00 ;
UL3_BH db 00 ;
UL3_BL db 00 ;
;------------------------------------------------
Unlock3_start: push ds ;
pop es ;
mov di,si ;
push cs ;
pop ds ;
mov word ptr cs:UL3_CX,cx ;
mov word ptr cs:UL3_BH,bx ;
shr word ptr cs:UL3_CX,1 ;
mov al,byte ptr cs:UL3_BL ;
mov ah,al ;
mov word ptr cs:UL3_AX,ax ;
mov ch,byte ptr cs:UL3_BH ;
mov cl,04 ;
mov bh,00 ;
Unlock3_0: mov dx,word ptr es:[di] ;
mov si, offset UL3_Buf1
mov al,10h ;
Unlock3_1: mov bl,dl ;
and bl,0fh ;
test al,ch ;
je short Unlock3_2 ;
add bl,10h ;
Unlock3_2: and dl,0f0h ;
or dl,byte ptr [bx+si] ;
add si,20h ;
ror dx,cl ;
shl al,1 ;
jne short Unlock3_1 ;
mov ah,00 ;
Unlock3_3: add si,02 ;
shr dx,1 ;
jnb short Unlock3_4 ;
or ax,word ptr [si] ;
Unlock3_4: jne short Unlock3_3 ;
mov si,offset UL3_Buf2
mov dh,08 ;
Unlock3_5: mov bl,al ;
and bl,0fh ;
test ch,dh ;
je short Unlock3_6 ;
add bl,10h ;
Unlock3_6: and al,0f0h ;
or al,byte ptr [bx+si] ;
add si,20h ;
ror ax,cl ;
shr dh,1 ;
jne short Unlock3_5 ;
sub ax,word ptr cs:UL3_CX ;
sub ax,word ptr cs:UL3_AX ;
mov dx,word ptr es:[di] ;
mov word ptr cs:UL3_AX,dx ;
stosw ;
dec word ptr cs:UL3_CX ;
jne short Unlock3_0 ;
retn ;
UnLock3 endp
;
UnLock proc near
push ds ;
pop es ;
mov di,si ;
xor dx,dx ;
Unlock_0: xor ah,ah ;
Unlock_1: push bx ;
push cx ;
push dx ;
mov cl,04 ;
rol dx,cl ;
lodsb ;
sub al,dl ;
mov cl,ah ;
shr bx,cl ;
xor al,bl ;
stosb ;
pop dx ;
pop cx ;
pop bx ;
inc ah ;
dec cx ;
je short Unlock_2 ;
cmp ah,08 ;
jne short Unlock_1 ;
inc dx ;
cmp cx,00 ;
jne short Unlock_0 ;
Unlock_2: retn ;
; ;*
;-----------------------------------------------------
UnLockD: xor bx,0521h ;
jmp short UnLock ;
UnLockE: xor bx,0586h ;
jmp short UnLock ;
UnLockF: xor bx,05ebh ;
jmp short UnLock ;
UnLock10: xor bx,0650h ;
jmp short UnLock ;
UnLock11: xor bx,06b5h ;
jmp short UnLock ;
UnLock12: xor bx,071ah ;
jmp short UnLock ;
UnLock13: xor bx,077fh ;
jmp short UnLock ;
UnLock14: xor bx,07e4h ;
jmp short UnLock ;
;<07f09> *
UnLockA proc near
push ds ;
pop es ;
push si ;
pop di ;
mov ax,bx ;
cmp cx,02 ;
jb short UnlockA_2 ;
push bp ;
mov bp,cx ;
shr cx,1 ;
mov word ptr cs:ULA_CX,cx ;
call s42 ;
mov si,di ;
UnlockA_0: call s43 ;
xor dx,dx ;
div bp ;
mov di,dx ;
add di,si ;
mov al,byte ptr es:[di] ;
xor al,93h ;
lea bx,word ptr [bp-01] ;
sub bx,dx ;
cmp bx,dx ;
je short UnlockA_1 ;
xchg al,byte ptr es:[bx+si] ;
xor al,67h ;
mov byte ptr es:[di],al ;
UnlockA_1: dec word ptr cs:ULA_CX ;
jne short UnlockA_0 ;
pop bp ;
UnlockA_2: retn ;
;------------------------------------------------
ULA_CX db 00,00 ;
ULA_AX dw 00 ;
;------------------------------------------------
;
s42 proc near
mov word ptr cs:ULA_AX,ax ;
retn ;
s42 endp
;
s43 proc near
mov ax,word ptr cs:ULA_AX ;
mov dx,ax ;
mov cl,06 ;
shl ax,cl ;
sub ax,dx ;
sub ax,dx ;
sub ax,dx ;
add ax,0159h ;
mov word ptr cs:ULA_AX,ax ;
and ax,37ffh ;
xchg ax,dx ;
retn ;
s43 endp
UnlockA endp
;
UnLockB proc near
push es ;
push bp ;
mov dx,bx ;
mov bx,cx ;
dec bx ;
add dx,bx ;
push ds ;
pop es ;
push si ;
pop di ;
mov bp,si ;
cld ;
shr cx,1 ;
pushf ;
UnlockB_0: push cx ;
mov cx,dx ;
lodsb ;
xchg bp,si ;
mov ah,byte ptr [bx+si] ;
mov dx,ax ;
xchg dh,dl ;
rol dx,1 ;
rol dx,1 ;
add dx,bx ;
sub ah,cl ;
xor ah,ch ;
mov byte ptr [bx+si],ah ;
xchg bp,si ;
sub al,ch ;
xor al,cl ;
stosb ;
dec bx ;
pop cx ;
loop UnlockB_0 ;
popf ;
jnb short UnlockB_1 ;
lodsb ;
sub al,bh ;
xor al,dh ;
xor al,dl ;
stosb ;
UnlockB_1: pop bp ;
pop es ;
retn ;
UnLockB endp
;
UnLockC proc near
push si ;
push di ;
mov di,1997h ;
shr cx,1 ;
jcxz UnlockC_17
UnlockC_0: lodsw ;
mov dx,bx ;
rol bx,1 ;
jnb short UnlockC_1 ;
xor ax,di ;
UnlockC_1: rol bx,1 ;
jnb short UnlockC_2 ;
add ax,dx ;
UnlockC_2: rol bx,1 ;
jnb short UnlockC_3
not ax ;
UnlockC_3: rol bx,1 ;
jnb short UnlockC_4
sub ax,dx ;
UnlockC_4: rol bx,1 ;
jnb short UnlockC_5
ror ax,1 ;
UnlockC_5: rol bx,1 ;
jnb short UnlockC_6
inc ax ;
UnlockC_6: rol bx,1 ;
jnb short UnlockC_7
rol ax,1 ;
UnlockC_7: rol bx,1 ;
jnb short UnlockC_8
dec ax ;
UnlockC_8: rol bx,1 ;
jnb short UnlockC_9
xor ax,di ;
UnlockC_9: rol bx,1 ;
jnb short UnlockC_10
add ax,dx ;
UnlockC_10: rol bx,1 ;
jnb short UnlockC_11
not ax ;
UnlockC_11: rol bx,1 ;
jnb short UnlockC_12
sub ax,dx ;
UnlockC_12: rol bx,1 ;
jnb short UnlockC_13
ror ax,1 ;
UnlockC_13: rol bx,1 ;
jnb short UnlockC_14
inc ax ;
UnlockC_14: rol bx,1 ;
jnb short UnlockC_15
rol ax,1 ;
UnlockC_15: rol bx,1 ;
jnb short UnlockC_16
dec ax ;
UnlockC_16: inc bx ;
ror bx,1 ;
xor ax,bx ;
mov word ptr [si-02],ax ;
loop UnlockC_0 ;
UnlockC_17: pop di ;
pop si ;
retn ;
UnLockC endp
UnLock_process proc near
cli ;
cld ;
push ds ;
push es ;
push si ;
push di ;
push bp ;
push bx ;
xor bx,bx ;
;--------------------------------------Special version
cmp byte ptr cs:case1,0
jnz NotSpecial
mov bl,15h
jmp Bit12
;---------------------------------------
NotSpecial:
mov bl,byte ptr cs:SchemeSign
cmp bl,0ffh
jnz ULP_0
;---------------------------------------
mov word ptr cs:UnLocking,bx ;
pop bx ;
call word ptr cs:UnLocking ;
pop bp ;
pop di ;
pop si ;
pop es ;
pop ds ;
retn ;
UnLock_process endp
;-----------------------------------------------------------------
;
Decode proc near
push ds ;
push si ;
mov byte ptr cs:Finish,00 ;
Decode_0:
cmp word ptr cs:Code_Size_H,00 ;
ja short Decode_1 ;
cmp word ptr cs:Code_Size_L,8000h
ja short Decode_1 ;
mov cx,word ptr cs:Code_Size_L ;
mov byte ptr cs:Finish,01 ;
nop ;
jmp short Decode_2 ;
Decode_1: mov cx,8000h ;
sub word ptr cs:Code_Size_L,cx ;
sbb word ptr cs:Code_Size_H,00 ;
Decode_2: xor si,si ;
mov bx,word ptr cs:KEY1 ;!!!
; push cx
call UnLock_process ;
; pop cx
; call write
mov ax,ds ;
add ax,0800h ;
mov ds,ax ;
cmp byte ptr cs:Finish,01 ;
jne short Decode_0 ;
pop si ;
pop ds ;
retn ;
;------------------------------------------------
Finish db 00 ;
;------------------------------------------------
Decode endp
;-------------------------------------------------------------------------
Read proc near
push bx
mov bx,cs:handle1
push ds
xor dx,dx
mov ah,3fh
int 21h
pop dx
pop cx
sub cx,8000h
sbb dx,0
js @read2
mov ax,ds
add ax,800h
mov ds,ax
jmp @read
@read2:
pop ds
pop bx
ret
Read endp
;-----------------------------------------------------
Write proc near
push bx
mov bx,cs:handle2
push ds
xor dx,dx
mov ah,40h
int 21h
pop dx
pop cx
sub cx,8000h
sbb dx,0
js @write2
mov ax,ds
add ax,800h
mov ds,ax
jmp @write
@write2:
pop ds
pop bx
ret
write endp
Version_MSG db 0ah,0dh,"捱哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌?
db 0ah,0dh,"? BitFree - BITLOK Locked Program UnLock Tool ?
db 0ah,0dh,"? ?
db 0ah,0dh,"? CopyRight (C) 1995 TeamWork SoftWare Group ?
db 0ah,0dh,"? ?
db 0ah,0dh,"? Personal Version 2.02@ 1996.05.05 ?
db 0ah,0dh,"? release 0.18 ?
db 0ah,0dh,"捃苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘?,0ah,0dh,24h
Processing_MSG db 0ah,0dh,07," - Now Processing . . . ",0ah,0dh,24h
Forced_MSG db 0ah,0dh,07," - Forced To Be Mode 2 Include 20 Schemes (Maybe Not Correct,But Try ...)! ",24h
OK_MSG db " - UnLock Finished ! Please Test OutPutFile(s) ",0ah,0dh,24h
APP_OVL_MSG db " - Creating APP_OVL_FILE : @@@@@@@@.OVL ",0ah,0dh,24h
Useage_MSG db 0ah,0dh,07,07," - Usage : BITFREE LockedFile OutPutFile [ Scheme ] "
db 0ah,0dh," - : Scheme = 0 .. A .. K -> Scheme 0 ..10 .. 20 "
db 0ah,0dh," - : .or. T Forced be Bitlok v2.00-v2.01 ",0ah,0dh,24h
Err1_MSG db 0ah,0dh,07,07," - Error Open Source_File !",0ah,0dh,24h
Err2_MSG db 0ah,0dh,07,07," - Error Creat OutPut_File !",0ah,0dh,24h
Err3_MSG db 0ah,0dh,07,07," - Error Read Source_File !",0ah,0dh,24h
Err4_MSG db 0ah,0dh,07,07," - Error : Not A BITLOKED FILE !!!",0ah,0dh,24h
Err5_MSG db 0ah,0dh,07,07," - Error : Unknow Version Of BITLOK , Call With Me !",0ah,0dh,24h
Proc_LNG db 0
code ends
end start