;
;	KEWLIZER BY ZAREK iNDUSTRiEZ - give creditzz---- NOt! :)
;

.model	small
.stack	100h

.data

;	------------------------------------------------------------------

Before	db	"NSAeECfnabTtOdIYo",0	; 0 is the end marker of the table
After	db	"¥$ää›Ÿï áâç0ëié"

;	just modify this fuck here for your own style...
;	------------------------------------------------------------------

fucktxt		db	"KäWLizîR - USE KEWL INFILE.EXT OUTFILE.EXT",13,10
		db	"Twice the same filename will result to bullshit...",13,10,"$"

; the folling 2 lines MUST follow each other (it's one string)
oktxt		db	"KäWLizîë ço: "
okname		db	128 dup (?)

readsize	dw	?

readname	db	128 dup (?)
writename	db	128 dup (?)
readhandle	dw	?
writehandle	dw	?

readbuff	db	8000 dup (?)
writebuff	db	8000 dup (?)

.code
.386p


start:	push	@data
	pop	es

	mov	si,81h
	lodsb
	cmp	al,0dh
	je	fuck
	cmp	al,32
	jne	fuck 

	mov	di,offset readname
	lodsb
	cmp	al,32
	je	fuck
	cmp	al,0dh
	je	fuck
write1:	stosb
	lodsb
	cmp	al,0dh
	je	fuck
	cmp	al,32
	je	write2
	jmp	write1
write2:	mov	al,0
	stosb	; endmarker of filename dor dos
	mov	di,offset writename
	lodsb
	cmp	al,32
	je	fuck
	cmp	al,0dh
	je	fuck
write3:	stosb
	lodsb
	cmp	al,32
	je	write4
	cmp	al,0dh
	jne	write3
write4:	mov	al,0
	stosb
	jmp	ok

fuck:	push	@data
	pop	ds
	mov	dx,offset fucktxt
	mov	ah,09h
	int	21h
	mov	ax,4cffh
	int	21h

ok:	push	@data
	pop	ds
	push	ds
	pop	es

	mov	si,offset writename
	mov	di,offset okname
	cld
okz:	lodsb
	cmp	al,0h
	jne	okz2
	mov	al,"$"	; write end character of string
okz2:	stosb
	cmp	al,"$"
	jne	okz

	mov	ah,3ch
	xor	cx,cx
	mov	dx,offset writename
	int	21h
	jb	fuck
	mov	[writehandle],ax

	mov	ax,3d00h
	mov	dx,offset readname
	int	21h
	jb	fuck
	mov	[readhandle],ax

again:

	mov	bx,[readhandle]
	mov	cx,2000
	mov	dx,offset readbuff
	mov	ah,3fh
	int	21h
	mov	[readsize],ax
	cmp	ax,0h	; nothing left to modify
	je	done

	mov	si,offset readbuff
	mov	di,offset writebuff
	mov	cx,[readsize]
	cld

dokewl:	lodsb
	xor	bx,bx
dokewl2:
	mov	ah,[before+bx]
	cmp	ah,0h
	je	dokewl4
	cmp	al,ah
	je	dokewl3
	inc	bx
	jmp	dokewl2
dokewl3:mov	al,[after+bx]
dokewl4:stosb
	loop	dokewl

	mov	bx,[writehandle]
	mov	cx,[readsize]
	mov	dx,offset writebuff
	mov	ah,40h
	int	21h

	jmp	again

done:

	mov	bx,[writehandle]
	mov	ah,3eh
	int	21h

	mov	bx,[readhandle]
	mov	ah,3eh
	int	21h

	mov	dx,offset oktxt
	mov	ah,09h
	int	21h
	mov	ax,4c00h
	int	21h

end	start