Crackme First 8bit Working Version by Independent (IND)
1 of 1 file
passlib
-
This download is an executable MS-DOS program that will not run on a modern computer.
It needs a DOS emulator such as DOSBox-X, Staging;
or a virtualized MS-DOS or FreeDOS system.
Browsers may flag this download as unwanted or malicious. If unsure, scan it with VirusTotal. -
Last modified Nov 6, 2017 5:20:16 PM
MD5 checksum ccd022a99bd4e0c34f15d840ea04a606
Mime type Zip archive data
Download FINAL.zip
Size 5 kB
1997 November 30
6 items in the archive
- FINAL/
- CRACK39.ASM
- CRACK39.COM
- CRACK39.MAP
- CRACK39.OBJ
- CRACK50.ASM
c0de segment
org 100h
assume cs:c0de,ds:c0de,es:c0de
start:
jmp realStart
;------------------------------------------------------------------------
;
; name: passLib
; code: anormal
; rev : 0.1 Sun 11-30-1997 : first 8bit working version
;
; todo: tweak in 32bits, investigate mmx non-saturated arithmetic,
; try loop unrolling with indexed jumps
; add decWord
;
; possible errors: i've not add code to test for word > 255 because
; this seems to be impossible to happen
;
;------------------------------------------------------------------------
;------------------------------------------------------------------------
; code
;------------------------------------------------------------------------
;------------------------------------------------------------------------
setAlpha proc
;input
; si = alphabet (ASCIIZ)
;output
; cx = length(alphabet)
;errors
;ax=-1 if length(alphabet) > ffh
mov di,offset myAlpha
xor cx,cx
xor ax,ax
setal1:
lodsb
or al,al
je endSeta
stosb
inc cx
cmp cx,00ffh
jg setaE1
jmp setal1
setaE1:
mov ax,-1
ret
endSeta:
mov isAlphaSet,1
mov lAlpha,cx
ret
setAlpha endp
;------------------------------------------------------------------------
setWord proc
;input
; si = initial word (ASCIIZ)
;output
; cx = length(word)
; si = offset where you could read the word
;errors
;ax=-1 if length(word) > ffh
;ax=-2 if some char in word is not in alphabet
;ax=-3 if alphabet is not set
mov bx,isAlphaSet
mov ax,-3
or bx,bx
jne setwO1
ret
setwO1:
mov di,offset myWord
xor cx,cx
xor ax,ax
setwl1:
lodsb
or al,al
je endSetw1
stosb
inc cx
cmp cx,00ffh
jg setwE1
jmp setwl1
setwE1:
mov ax,-1
endSetW1:
dec cx
mov lWord,cx
; now setting counters
xor bx,bx
mov dx,cx ;saves lword
mov si,offset myWord
setwl2:
mov al,[si+bx]
mov di,offset myalpha
mov cx,lAlpha
repnz scasb
je setwO2
mov ax,-2 ;char not found in alphabet
ret
setwO2:
mov ax,lAlpha
inc cx
sub ax,cx
mov [myCnts+bx],al
inc bx
cmp bx,dx
jng setwl2
mov cx,lWord
ret
setWord endp
;------------------------------------------------------------------------
incWord proc
;input
; si = actual word (ASCIIZ)
;output
; none
;errors
; none
mov si,offset myCnts
mov di,si
dec di
mov ax,lAlpha
mov bx,lWord
inc byte ptr [bx+si]
chkCarry:
cmp [bx+si],al
jb noCarry
inc byte ptr [bx+di] ;we'll use di=si-1 to avoid [bx+si-1]
dec bx
jnz chkCarry
noCarry:
; must increment long of word
cmp [si],al ;has produced the first char carry?
jb noIncLength
inc word ptr lWord ;yes!, increment length of word
mov al,[myAlpha]
mov cx,lWord
mov di,offset myWord
rep stosb ;fill new word with first char (a)
stosb
xor al,al
mov di,offset myCnts
mov cx,lWord ;set counters to 0
rep stosb
stosb
ret ;premature exiting from proc
noIncLength:
mov ax,lAlpha
mov bx,lWord
incwL1: ;check for
cmp [bx+si],al
jb noSet0
mov byte ptr [bx+si],0
noSet0:
or bx,bx
je endSet0
dec bx
jmp incwL1
endSet0:
mov si,offset myWord
mov bp,lWord
buildWord: ;translate counters to chars
mov bl,myCnts[bp]
mov al,myAlpha[bx]
mov [si+bp],al
or bp,bp
je endBuildWord
dec bp
jmp buildWord
endBuildWord:
ret
incWord endp
;------------------------------------------------------------------------
; data
;------------------------------------------------------------------------
align 4
myAlpha db 0ffh dup(0)
align 4
myWord db 0ffh dup(0)
align 4
myCnts db 0ffh dup(0)
align 4
LWord dw 0
LAlpha dw 0
isAlphaSet dw 0
;------------------------------------------------------------------------
; end module
;------------------------------------------------------------------------
realStart:
mov si,offset alpha
call setAlpha
mov si,offset initPal
call setWord
mov offword,si
.486
crack:
call IncWord
mov cx,83h
mov si,offword
crack2:
mov ax,[si]
rol ax,cl
mov dx,[si+2]
xor ax,dx
xor ax,cx
mov bx,ax
mov ax,[si+4]
mul bx
mov [si+2],ax
or ax,ax
jne noprint
xor dx,cx ;needed to force the 07 printing
cmp dl,0bh
jne noprint
mov si,offword
mov di,offset initpal
copy:
lodsb
or al,al
je endcopy
stosb
jmp copy
endcopy:
mov byte ptr [di],13
mov byte ptr [di+1],10
mov byte ptr [di+2],'$'
mov dx,offset initpal
mov ah,9h
int 21h
noprint:
inc cx
cmp cx,0ffh
jne crack2
cmp lWord,6
jne crack
mov ah,4ch
int 21h
offword dw ?
initPal db '99999',0,0,0,0,0,0,0,0,0,0,0,0
;alpha db '0123456789abcdefghijklmnopqrstuvwxyz',0
alpha db '0123456789abcdef',0
;alpha db '0123456789',0
c0de ends
end start