CEDK Crackme by Rebels (RBS)
3 of 3 files
kouger
-
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:15:49 PM
MD5 checksum ede8e016bf8f24b6df92aeb12c91fe4f
Mime type Zip archive data
Download CEDK.zip
Size 3 kB
1998 January 25
- Zip - DOS / Computer tool
- KOUGER, program credits
4 items in the archive
- CEDK/
- KOU-CEDK.COM
- KOU.ASM
- KOU.COM
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
;
; how to use: first: call to setAlpha with your own alphabet (ASCIIZ)
; second: call to setWord with your initial word
; keep calling to incWord for getting the words
;
;------------------------------------------------------------------------
;------------------------------------------------------------------------
; 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
align 4
crack:
call IncWord
mov si,offword
xor bx,bx
lodsw
add bx,ax
lodsw
add bx,ax
lodsw
add bl,al
sub bh,ah
xor ax,ax
lodsb
imul bx,ax
sbb bx,0fbf1h
jne crack
mov si,offword
mov di,offset clave
lodsd
stosd
mov [di+9],eax
movsd
; mov word ptr [di+3],0b0ch
xor eax,eax
retrig:
inc eax
or eax,eax
je crack
mov bx,offset clave
mov si,offset uno
; mov di,offset tres
mov bp,offset dos
mov cx,207ah
mov [bx+7],eax
rept 7
lodsb ;1..7
sub al,[bx]
add al,[bp]
cmp al,ch
jl crack
cmp al,cl
jg crack
inc bx
inc bp
endm
rept 4
lodsb ;8..11
sub al,[bx]
add al,[bp]
cmp al,ch
jl retrig
cmp al,cl
jg retrig
inc bx
inc bp
endm
rept 5
lodsb ;12..16
sub al,[bx]
add al,[bp]
cmp al,ch
jl crack
cmp al,cl
jg crack
inc bx
inc bp
endm
bingo:
mov si,offword
mov di,offset initpal
movsd
movsd
movsd
mov [di-2],00240a0dh
mov dx,offset initpal
mov ah,9
int 21h
cmp lword,7
jne crack
noprint:
mov ah,4ch
int 21h
offword dw ?
align 4
initPal db 'ZZZZZZ',0,0,0,0,0,0,0,0,0,0,0,0,'$'
;alpha db '0123456789ABCDEFGHIJKLMNÑOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',0
;alpha db 'abcdefghijklmnopqrstuvwxyz',0
alpha db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',0
;alpha db '0123456789abcdefghijklmnopqrstuvwxyz',0
;alpha db '0123456789',0
align 4
uno db 066h,0adh,003h,0d8h,066h,0c1h,0e8h,010h
db 003h,008h,0adh,002h,0d8h,02ah,0fch,033h
dos db 078h,016h,0c1h,0e1h,04ch,0fch,0a6h,0abh
db 0d9h,0fch,02ch,07dh,054h,053h,078h,03ch
tres db 16 dup(0)
align 4
clave db 11 dup(0)
db 0ch,0bh
db 32 dup(0)
align 4
; 0 1 2 3 4 5 6 7 8 9 a b c d e f 0 1 2 3 4 5 6 7 8 9 a b c d e f
filtro db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;1
; ! " # $ % & ' ( ) * + , - . /
db 1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0
; 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 ;3
; P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o
db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 ;4
; p q r s t u v w x y z { | } ~
db 1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;5
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;6
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;7
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;8
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
c0de ends
end start