Tuesday, March 7, 2023

NASM DOS16, Win32, Win64 & MacOS 64-bit and 32-bit Quines

 ;

; spc.asm
;
; alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]
; 10/5/2021 .revision = 1/27/2023
;
; nasm -f win64 spc.asm
; link spc.obj /subsystem:console /defaultlib:msvcrt64.lib /entry:m /largeaddressaware:no
;
global m
extern printf
section .text
m:sub rsp,28h
mov al,10
mov bl,95
z:lea r9,a
mov dx,567
r:cmp byte[r9],bl
je s
jmp u
s:mov byte[r9],al
u:inc r9
dec dx
cmp dx,0
jnz r
lea rdx,a
lea rcx,i
call printf
mov al,10
cmp bl,95
xchg al,bl
je z
lea rdx,x
lea rcx,i
call printf
add rsp,28h
ret
section .data
x:db 2Ch,32h,37h,68h,2Ch,30h,0
i:db 25h,73h,0
a:db ';_; spc.asm_;_; alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]_; 10/5/2021 .revision = 1/27/2023_;_; nasm -f win64 spc.asm_; link spc.obj /subsystem:console /defaultlib:msvcrt64.lib /entry:m /largeaddressaware:no_;_global m_extern printf_section .text_m:sub rsp,28h_mov al,10_mov bl,95_z:lea r9,a_mov dx,567_r:cmp byte[r9],bl_je s_jmp u_s:mov byte[r9],al_u:inc r9_dec dx_cmp dx,0_jnz r_lea rdx,a_lea rcx,i_call printf_mov al,10_cmp bl,95_xchg al,bl_je z_lea rdx,x_lea rcx,i_call printf_add rsp,28h_ret_section .data_x:db 2Ch,32h,37h,68h,2Ch,30h,0_i:db 25h,73h,0_a:db ',27h,0

;
; sp4ce.asm
;
; alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]
; 10/6/2021 .revision = 1/27/2023
;
; nasm <dash>f win32 sp4ce.asm
; link sp4ce.obj /subsystem:console /defaultlib:32msvcrt.lib /entry:m
;
global m
extern _printf
section .text
m:enter 0,0
mov al,10
mov bl,45
z:lea edx,a
mov cx,543
r:cmp byte[edx],bl
je s
jmp u
s:mov byte[edx],al
u:inc edx
dec cx
cmp cx,0
jnz r
push a
push i
call _printf
mov al,10
cmp bl,45
xchg al,bl
je z
push x
push i
call _printf
leave
ret
section .data
x:db 2Ch,32h,37h,68h,2Ch,30h,0
i:db 25h,73h,0
a:db ';-; sp4ce.asm-;-; alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]-; 10/6/2021 .revision = 1/27/2023-;-; nasm <dash>f win32 sp4ce.asm-; link sp4ce.obj /subsystem:console /defaultlib:32msvcrt.lib /entry:m-;-global m-extern _printf-section .text-m:enter 0,0-mov al,10-mov bl,45-z:lea edx,a-mov cx,543-r:cmp byte[edx],bl-je s-jmp u-s:mov byte[edx],al-u:inc edx-dec cx-cmp cx,0-jnz r-push a-push i-call _printf-mov al,10-cmp bl,45-xchg al,bl-je z-push x-push i-call _printf-leave-ret-section .data-x:db 2Ch,32h,37h,68h,2Ch,30h,0-i:db 25h,73h,0-a:db ',27h,0

;
; sulfur16.asm
;
; alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]
; 10/7/2021 .revision 2 = 2/1/2023
;
; nasm <dash>f bin <dash>o sulfur16.com sulfur16.asm
;
org 100h
mov al,13
mov ah,45
z:lea bx,[k]
mov cx,551
r:cmp byte[bx],ah
je s
jmp u
s:mov byte[bx],al
cmp al,45
je c
mov byte[bx+1],10
jmp u
c:mov byte[bx+1],45
u:inc bx
dec cx
cmp cx,0
jnz r
push ax
lea dx,[k]
mov ah,9
int 21h
pop ax
cmp al,13
mov ah,45
xchg al,ah
je z
lea dx,[x]
mov ah,9
int 21h
int 20h
x:db 2Ch,32h,37h,68h,2Ch,32h,34h,68h,24h
k:db ';--; sulfur16.asm--;--; alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]--; 10/7/2021 .revision 2 = 2/1/2023--;--; nasm <dash>f bin <dash>o sulfur16.com sulfur16.asm--;--org 100h--mov al,13--mov ah,45--z:lea bx,[k]--mov cx,551--r:cmp byte[bx],ah--je s--jmp u--s:mov byte[bx],al--cmp al,45--je c--mov byte[bx+1],10--jmp u--c:mov byte[bx+1],45--u:inc bx--dec cx--cmp cx,0--jnz r--push ax--lea dx,[k]--mov ah,9--int 21h--pop ax--cmp al,13--mov ah,45--xchg al,ah--je z--lea dx,[x]--mov ah,9--int 21h--int 20h--x:db 2Ch,32h,37h,68h,2Ch,32h,34h,68h,24h--k:db ',27h,24h

; by alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]
; January 25, 2023 NYC
; nasm <dash>f macho <dash>o GosuIchiban.o SnowLeopard.asm
; ld <dash>arch i386 <dash>macosx_version_min 10.4 <dash>lc /usr/lib/crt1.o <dash>o GesuIchIvan GosuIchiban.o
global _main
extern _printf
section .text
_main:
enter 0,0
mov al,10
mov bl,45
z:lea edx,[a]
mov cx,596
r:cmp byte [edx],bl
je s
jmp u
s:mov byte [edx],al
u:inc edx
dec cx
cmp cx,0
jnz r
push a
push i
call _printf
mov al,10
cmp bl,45
xchg al,bl
je z
push x
push i
call _printf
leave
ret
section .data
x:db 2Ch,32h,37h,68h,2Ch,30h,0
i:db 25h,73h,0
a:db '; by alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]-; January 25, 2023 NYC-; nasm <dash>f macho <dash>o GosuIchiban.o SnowLeopard.asm-; ld <dash>arch i386 <dash>macosx_version_min 10.4 <dash>lc /usr/lib/crt1.o <dash>o GesuIchIvan GosuIchiban.o-global _main-extern _printf-section .text-_main:-enter 0,0-mov al,10-mov bl,45-z:lea edx,[a]-mov cx,596-r:cmp byte [edx],bl-je s-jmp u-s:mov byte [edx],al-u:inc edx-dec cx-cmp cx,0-jnz r-push a-push i-call _printf-mov al,10-cmp bl,45-xchg al,bl-je z-push x-push i-call _printf-leave-ret-section .data-x:db 2Ch,32h,37h,68h,2Ch,30h,0-i:db 25h,73h,0-a:db ',27h,0


; by alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]
; January 26, 2023 NYC
; ./nasm <dash>f macho64 <dash>o 6GosuIchiban4.o SnowLeopard64.asm
; ld <dash>arch x86_64  <dash>macosx_version_min 10.4 <dash>lc /usr/lib/crt1.o <dash>o 6GesuIchIvan4 6GosuIchiban4.o
global _main
extern _printf
section .text
_main:push rbx
mov cl,10
mov bl,45
z:lea r9,[a]
mov dx,685
r:cmp byte[r9],bl
je s
jmp u
s:mov byte[r9],cl
u:inc r9
dec dx
cmp dx,0
jnz r
lea rdi,[i]
lea rax,[a]
mov rsi,rax
xor rax,rax
call _printf
mov cl,10
cmp bl,45
xchg cl,bl
je z
lea rdi,[i]
lea rax,[x]
mov rsi,rax
xor rax,rax
call _printf
pop rbx
ret
section .data
default rel
x:db 2Ch,32h,37h,68h,2Ch,30h,0
i:db 25h,73h,0
a:db '; by alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]-; January 26, 2023 NYC-; ./nasm <dash>f macho64 <dash>o 6GosuIchiban4.o SnowLeopard64.asm-; ld <dash>arch x86_64  <dash>macosx_version_min 10.4 <dash>lc /usr/lib/crt1.o <dash>o 6GesuIchIvan4 6GosuIchiban4.o-global _main-extern _printf-section .text-_main:push rbx-mov cl,10-mov bl,45-z:lea r9,[a]-mov dx,685-r:cmp byte[r9],bl-je s-jmp u-s:mov byte[r9],cl-u:inc r9-dec dx-cmp dx,0-jnz r-lea rdi,[i]-lea rax,[a]-mov rsi,rax-xor rax,rax-call _printf-mov cl,10-cmp bl,45-xchg cl,bl-je z-lea rdi,[i]-lea rax,[x]-mov rsi,rax-xor rax,rax-call _printf-pop rbx-ret-section .data-default rel-x:db 2Ch,32h,37h,68h,2Ch,30h,0-i:db 25h,73h,0-a:db ',27h,0

Saturday, March 4, 2023

TASM32, MASM32, MASM64 Quines : Benu, Firebird & Feng Huang

 ; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////

; Benu
; by alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]
; 2/27/2023 NYC
; tasm32 benu.asm
; tlink32 ~Tpe ~ap benu.obj,benu.exe,,tmsvcrt.lib,,
; /////////////////////////////////////////////////////////////////////////////////////////////
.686
.model flat,stdcall
extrn _printf:proc
.code
start:
enter 0,0
mov al,0Ah
mov bl,2Dh
z:lea edx,[a]
mov cx,1318
r:cmp byte ptr[edx],bl
je s
jmp u
s:mov byte ptr[edx],al
u:inc edx
dec cx
cmp cx,0
jnz r
cmp bl,0Ah
je td
push offset a
push offset i
call _printf
jmp ll
td:
lea edi,[n]
lea esi,[a]
mov cx,1372
sn:mov al,byte ptr[esi]
mov byte ptr[edi],al
inc esi
inc edi
dec cx
cmp cx,1224
je t
cmp cx,1074
je t
cmp cx,924
je t
cmp cx,774
je t
cmp cx,624
je t
cmp cx,474
je t
cmp cx,324
je t
cmp cx,174
je t
cmp cx,24
je t
jmp sts
t:mov byte ptr[edi],27h
mov byte ptr[edi+1],0Ah
mov byte ptr[edi+2],64h
mov byte ptr[edi+3],62h
mov byte ptr[edi+4],20h
mov byte ptr[edi+5],27h
add edi,6
jmp sts
sts:cmp cx,0
jne sn
push offset n
push offset i
call _printf
ll:mov al,0Ah
cmp bl,2Dh
xchg al,bl
je z
push offset x
push offset i
call _printf
leave
ret
.data
x db 2Ch,32h,37h,68h,2Ch,30h,0Ah,65h,6eh,64h,20h,73h,74h,61h,72h,74h,0
i db 25h,73h,0
n db 1319 DUP(0)
a db '; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////-; Benu-; by alCoPaUL [GIMO][As]'
db '[aBrA][NPA][b8][BCVG][rRlf]-; 2/27/2023 NYC-; tasm32 benu.asm-; tlink32 ~Tpe ~ap benu.obj,benu.exe,,tmsvcrt.lib,,-; //////////////////////////////////'
db '///////////////////////////////////////////////////////////-.686-.model flat,stdcall-extrn _printf:proc-.code-start:-enter 0,0-mov al,0Ah-mov bl,2Dh-z'
db ':lea edx,[a]-mov cx,1318-r:cmp byte ptr[edx],bl-je s-jmp u-s:mov byte ptr[edx],al-u:inc edx-dec cx-cmp cx,0-jnz r-cmp bl,0Ah-je td-push offset a-push '
db 'offset i-call _printf-jmp ll-td:-lea edi,[n]-lea esi,[a]-mov cx,1372-sn:mov al,byte ptr[esi]-mov byte ptr[edi],al-inc esi-inc edi-dec cx-cmp cx,1224-j'
db 'e t-cmp cx,1074-je t-cmp cx,924-je t-cmp cx,774-je t-cmp cx,624-je t-cmp cx,474-je t-cmp cx,324-je t-cmp cx,174-je t-cmp cx,24-je t-jmp sts-t:mov byte'
db ' ptr[edi],27h-mov byte ptr[edi+1],0Ah-mov byte ptr[edi+2],64h-mov byte ptr[edi+3],62h-mov byte ptr[edi+4],20h-mov byte ptr[edi+5],27h-add edi,6-jmp st'
db 's-sts:cmp cx,0-jne sn-push offset n-push offset i-call _printf-ll:mov al,0Ah-cmp bl,2Dh-xchg al,bl-je z-push offset x-push offset i-call _printf-leave'
db '-ret-.data-x db 2Ch,32h,37h,68h,2Ch,30h,0Ah,65h,6eh,64h,20h,73h,74h,61h,72h,74h,0-i db 25h,73h,0-n db 1319 DUP(0)-a db ',27h,0
end start

; ///////////////////////////////////////////////////////////////////////////////////////////
;
; Firebird
; by alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]
; 2/27/2023 Revised: 3/03/2023 @ NYC
; ml64.exe firebird.asm /link /subsystem:console /defaultlib:64mscrt.lib /entry:main
;
; /////////////////////////////////////////////////////////////////////////////////////
extrn printf:proc
.code
main proc
sub rsp,28h
mov al,0Ah
mov bl,2Dh
z:lea r9,[a]
mov dx,1318
r:cmp byte ptr[r9],bl
je s
jmp u
s:mov byte ptr[r9],al
u:inc r9
dec dx
cmp dx,0
jnz r
cmp bl,0Ah
je td
lea rdx,[a]
lea rcx,[i]
call printf
jmp ll
td:
lea rdi,[n]
lea rsi,[a]
mov cx,1372
sn:mov al,byte ptr[rsi]
mov byte ptr[rdi],al
inc rsi
inc rdi
dec cx
cmp cx,1224
je t
cmp cx,1074
je t
cmp cx,924
je t
cmp cx,774
je t
cmp cx,624
je t
cmp cx,474
je t
cmp cx,324
je t
cmp cx,174
je t
cmp cx,24
je t
jmp sts
t:mov byte ptr[rdi],27h
mov byte ptr[rdi+1],0Ah
mov byte ptr[rdi+2],64h
mov byte ptr[rdi+3],62h
mov byte ptr[rdi+4],20h
mov byte ptr[rdi+5],27h
add rdi,6
jmp sts
sts:cmp cx,0
jne sn
lea rdx,[n]
lea rcx,[i]
call printf
ll:mov al,0Ah
cmp bl,2Dh
xchg al,bl
je z
lea rdx,[x]
lea rcx,[i]
call printf
add rsp,28h
ret
main endp
.data
b db 27h,0Dh,0Ah,64h,62h,20h,27h,0
x db 2Ch,32h,37h,68h,2Ch,30h,0Ah,65h,6eh,64h,0
i db 25h,73h,0
n db 1319 DUP(0)
a db '; ///////////////////////////////////////////////////////////////////////////////////////////-;-; Firebird-; by alCoPaUL [GIMO][As][aBrA][NPA][b8][B'
db 'CVG][rRlf]-; 2/27/2023 Revised: 3/03/2023 @ NYC-; ml64.exe firebird.asm /link /subsystem:console /defaultlib:64mscrt.lib /entry:main-;-; /////////////'
db '////////////////////////////////////////////////////////////////////////-extrn printf:proc-.code-main proc-sub rsp,28h-mov al,0Ah-mov bl,2Dh-z:lea r9,'
db '[a]-mov dx,1318-r:cmp byte ptr[r9],bl-je s-jmp u-s:mov byte ptr[r9],al-u:inc r9-dec dx-cmp dx,0-jnz r-cmp bl,0Ah-je td-lea rdx,[a]-lea rcx,[i]-call pr'
db 'intf-jmp ll-td:-lea rdi,[n]-lea rsi,[a]-mov cx,1372-sn:mov al,byte ptr[rsi]-mov byte ptr[rdi],al-inc rsi-inc rdi-dec cx-cmp cx,1224-je t-cmp cx,1074-j'
db 'e t-cmp cx,924-je t-cmp cx,774-je t-cmp cx,624-je t-cmp cx,474-je t-cmp cx,324-je t-cmp cx,174-je t-cmp cx,24-je t-jmp sts-t:mov byte ptr[rdi],27h-mov'
db ' byte ptr[rdi+1],0Ah-mov byte ptr[rdi+2],64h-mov byte ptr[rdi+3],62h-mov byte ptr[rdi+4],20h-mov byte ptr[rdi+5],27h-add rdi,6-jmp sts-sts:cmp cx,0-jn'
db 'e sn-lea rdx,[n]-lea rcx,[i]-call printf-ll:mov al,0Ah-cmp bl,2Dh-xchg al,bl-je z-lea rdx,[x]-lea rcx,[i]-call printf-add rsp,28h-ret-main endp-.data-'
db 'b db 27h,0Dh,0Ah,64h,62h,20h,27h,0-x db 2Ch,32h,37h,68h,2Ch,30h,0Ah,65h,6eh,64h,0-i db 25h,73h,0-n db 1319 DUP(0)-a db ',27h,0
end

; //////////////////////////////////////////////
;
; Feng Huang
; by alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]
; 2/27/2023 Revised: 3/03/2023 @ NYC
; ml.exe fenghuang.asm /link /subsystem:console /defaultlib:32mscrt.lib /entry:main
;
; ////////////////////////////////////////////////////////////////
.686
.model flat,stdcall
extern printf:proc
.code
start:
main proc
enter 0,0
mov al,0Ah
mov bl,2Dh
z:lea edx,[a]
mov cx,1318
r:cmp byte ptr[edx],bl
je s
jmp u
s:mov byte ptr[edx],al
u:inc edx
dec cx
cmp cx,0
jnz r
cmp bl,0Ah
je td
push offset a
push offset i
call printf
jmp ll
td:
lea edi,[n]
lea esi,[a]
mov cx,1372
sn:mov al,byte ptr[esi]
mov byte ptr[edi],al
inc esi
inc edi
dec cx
cmp cx,1224
je t
cmp cx,1074
je t
cmp cx,924
je t
cmp cx,774
je t
cmp cx,624
je t
cmp cx,474
je t
cmp cx,324
je t
cmp cx,174
je t
cmp cx,24
je t
jmp sts
t:mov byte ptr[edi],27h
mov byte ptr[edi+1],0Ah
mov byte ptr[edi+2],64h
mov byte ptr[edi+3],62h
mov byte ptr[edi+4],20h
mov byte ptr[edi+5],27h
add edi,6
jmp sts
sts:cmp cx,0
jne sn
push offset n
push offset i
call printf
ll:mov al,0Ah
cmp bl,2Dh
xchg al,bl
je z
push offset x
push offset i
call printf
leave
ret
main endp
.data
b db 27h,0Dh,0Ah,64h,62h,20h,27h,0
x db 2Ch,32h,37h,68h,2Ch,30h,0Ah,65h,6eh,64h,20h,73h,74h,61h,72h,74h,0
i db 25h,73h,0
n db 1319 DUP(0)
a db '; //////////////////////////////////////////////-;-; Feng Huang-; by alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]-; 2/27/2023 Revised: 3/03/2023 @'
db ' NYC-; ml.exe fenghuang.asm /link /subsystem:console /defaultlib:32mscrt.lib /entry:main-;-; /////////////////////////////////////////////////////////'
db '///////-.686-.model flat,stdcall-extern printf:proc-.code-start:-main proc-enter 0,0-mov al,0Ah-mov bl,2Dh-z:lea edx,[a]-mov cx,1318-r:cmp byte ptr[ed'
db 'x],bl-je s-jmp u-s:mov byte ptr[edx],al-u:inc edx-dec cx-cmp cx,0-jnz r-cmp bl,0Ah-je td-push offset a-push offset i-call printf-jmp ll-td:-lea edi,[n'
db ']-lea esi,[a]-mov cx,1372-sn:mov al,byte ptr[esi]-mov byte ptr[edi],al-inc esi-inc edi-dec cx-cmp cx,1224-je t-cmp cx,1074-je t-cmp cx,924-je t-cmp cx'
db ',774-je t-cmp cx,624-je t-cmp cx,474-je t-cmp cx,324-je t-cmp cx,174-je t-cmp cx,24-je t-jmp sts-t:mov byte ptr[edi],27h-mov byte ptr[edi+1],0Ah-mov b'
db 'yte ptr[edi+2],64h-mov byte ptr[edi+3],62h-mov byte ptr[edi+4],20h-mov byte ptr[edi+5],27h-add edi,6-jmp sts-sts:cmp cx,0-jne sn-push offset n-push of'
db 'fset i-call printf-ll:mov al,0Ah-cmp bl,2Dh-xchg al,bl-je z-push offset x-push offset i-call printf-leave-ret-main endp-.data-b db 27h,0Dh,0Ah,64h,62h'
db ',20h,27h,0-x db 2Ch,32h,37h,68h,2Ch,30h,0Ah,65h,6eh,64h,20h,73h,74h,61h,72h,74h,0-i db 25h,73h,0-n db 1319 DUP(0)-a db ',27h,0
end start

16-bit TASM and MASM Quines : GOAT & ARIES

; GOAT
; by alCoPaUL[GIMO][As][aBrA][NPA][b8][BCVG][rRlf]
; 3/2/2023 NYC
;
; tasm GOAT.asm
; tlink GOAT.obj
;
.model tiny
.stack
.code
start:
main proc
push cs
pop ds
mov al,13
mov ah,45
z:lea bx,[k]
mov cx,1265
r:cmp byte ptr[bx],ah
je s
jmp u
s:mov byte ptr[bx],al
cmp al,45
je cu
mov byte ptr[bx+1],10
jmp u
cu:mov byte ptr[bx+1],45
u:inc bx
dec cx
cmp cx,0
jnz r
cmp al,45
je td
push ax
lea dx,[k]
mov ah,9h
int 21h
pop ax
jmp ll
td:lea si,[k]
lea di,[n]
mov cx,1328
sn:mov al,byte ptr[si]
mov byte ptr[di],al
jmp q
zf:jmp z
q:inc si
inc di
dec cx
cmp cx,1224
je t
cmp cx,1074
je t
cmp cx,924
je t
cmp cx,774
je t
cmp cx,624
je t
cmp cx,474
je t
cmp cx,324
je t
cmp cx,174
je t
cmp cx,24
je t
jmp sts
t:mov byte ptr[di],27h
mov byte ptr[di+1],0Dh
mov byte ptr[di+2],0Ah
mov byte ptr[di+3],64h
mov byte ptr[di+4],62h
mov byte ptr[di+5],20h
mov byte ptr[di+6],27h
add di,7
jmp sts
sts:cmp cx,0
jne sn
push ax
lea dx,[n]
mov ah,9h
int 21h
pop ax
ll:cmp al,13
mov ah,45
xchg al,ah
je zf
lea dx,[x]
mov ah,09h
int 21h
mov ax,4C00h
int 21h
main endp
.data
x db 2Ch,32h,37h,68h,2Ch,32h,34h,68h,0Dh,0Ah,65h,6eh,64h,20h,73h,74h,61h,72h,74h,24h,0
n db 1265 DUP(0),24h
k db '; GOAT--; by alCoPaUL[GIMO][As][aBrA][NPA][b8][BCVG][rRlf]--; 3/2/2023 NYC--;--; tasm GOAT.asm--; tlink '
db 'GOAT.obj--;--.model tiny--.stack--.code--start:--main proc--push cs--pop ds--mov al,13--mov ah,45--z:lea bx,[k]--mov cx,1265--r:cmp byte ptr[bx],ah--j'
db 'e s--jmp u--s:mov byte ptr[bx],al--cmp al,45--je cu--mov byte ptr[bx+1],10--jmp u--cu:mov byte ptr[bx+1],45--u:inc bx--dec cx--cmp cx,0--jnz r--cmp al'
db ',45--je td--push ax--lea dx,[k]--mov ah,9h--int 21h--pop ax--jmp ll--td:lea si,[k]--lea di,[n]--mov cx,1328--sn:mov al,byte ptr[si]--mov byte ptr[di],'
db 'al--jmp q--zf:jmp z--q:inc si--inc di--dec cx--cmp cx,1224--je t--cmp cx,1074--je t--cmp cx,924--je t--cmp cx,774--je t--cmp cx,624--je t--cmp cx,474-'
db '-je t--cmp cx,324--je t--cmp cx,174--je t--cmp cx,24--je t--jmp sts--t:mov byte ptr[di],27h--mov byte ptr[di+1],0Dh--mov byte ptr[di+2],0Ah--mov byte '
db 'ptr[di+3],64h--mov byte ptr[di+4],62h--mov byte ptr[di+5],20h--mov byte ptr[di+6],27h--add di,7--jmp sts--sts:cmp cx,0--jne sn--push ax--lea dx,[n]--m'
db 'ov ah,9h--int 21h--pop ax--ll:cmp al,13--mov ah,45--xchg al,ah--je zf--lea dx,[x]--mov ah,09h--int 21h--mov ax,4C00h--int 21h--main endp--.data--x db '
db '2Ch,32h,37h,68h,2Ch,32h,34h,68h,0Dh,0Ah,65h,6eh,64h,20h,73h,74h,61h,72h,74h,24h,0--n db 1265 DUP(0),24h--k db ',27h,24h
end start


; ARIES
; by alCoPaUL[GIMO][As][aBrA][NPA][b8][BCVG][rRlf]
; 3/2/2023 NYC
;
; ml /omf ARIES.asm
; m16link.exe ARIES.obj
;
.model tiny
.stack
.code
start:
main proc
push cs
pop ds
mov al,13
mov ah,45
z:lea bx,[k]
mov cx,1261
r:cmp byte ptr[bx],ah
je s
jmp u
s:mov byte ptr[bx],al
cmp al,45
je cu
mov byte ptr[bx+1],10
jmp u
cu:mov byte ptr[bx+1],45
u:inc bx
dec cx
cmp cx,0
jnz r
cmp al,45
je td
push ax
lea dx,[k]
mov ah,9h
int 21h
pop ax
jmp ll
td:
lea si,[k]
lea di,[n]
mov cx,1324
sn:mov al,byte ptr[si]
mov byte ptr[di],al
inc si
inc di
dec cx
cmp cx,1224
je t
cmp cx,1074
je t
cmp cx,924
je t
cmp cx,774
je t
cmp cx,624
je t
cmp cx,474
je t
cmp cx,324
je t
cmp cx,174
je t
cmp cx,24
je t
jmp sts
t:mov byte ptr[di],27h
mov byte ptr[di+1],0Dh
mov byte ptr[di+2],0Ah
mov byte ptr[di+3],64h
mov byte ptr[di+4],62h
mov byte ptr[di+5],20h
mov byte ptr[di+6],27h
add di,7
jmp sts
sts:cmp cx,0
jne sn
push ax
lea dx,[n]
mov ah,9h
int 21h
pop ax
ll:
cmp al,13
mov ah,45
xchg al,ah
je z
lea dx,[x]
mov ah,09h
int 21h
mov ax,4C00h
int 21h
main endp
.data
x db 2Ch,32h,37h,68h,2Ch,32h,34h,68h,0Dh,0Ah,65h,6eh,64h,20h,73h,74h,61h,72h,74h,24h,0
n db 1261 DUP(0),24h
k db '; ARIES--; by alCoPaUL[GIMO][As][aBrA][NPA][b8][BCVG][rRlf]--; 3/2/2023 NYC--;--; ml /omf ARIES.asm-'
db '-; m16link.exe ARIES.obj--;--.model tiny--.stack--.code--start:--main proc--push cs--pop ds--mov al,13--mov ah,45--z:lea bx,[k]--mov cx,1261--r:cmp by'
db 'te ptr[bx],ah--je s--jmp u--s:mov byte ptr[bx],al--cmp al,45--je cu--mov byte ptr[bx+1],10--jmp u--cu:mov byte ptr[bx+1],45--u:inc bx--dec cx--cmp cx,'
db '0--jnz r--cmp al,45--je td--push ax--lea dx,[k]--mov ah,9h--int 21h--pop ax--jmp ll--td:--lea si,[k]--lea di,[n]--mov cx,1324--sn:mov al,byte ptr[si]-'
db '-mov byte ptr[di],al--inc si--inc di--dec cx--cmp cx,1224--je t--cmp cx,1074--je t--cmp cx,924--je t--cmp cx,774--je t--cmp cx,624--je t--cmp cx,474--'
db 'je t--cmp cx,324--je t--cmp cx,174--je t--cmp cx,24--je t--jmp sts--t:mov byte ptr[di],27h--mov byte ptr[di+1],0Dh--mov byte ptr[di+2],0Ah--mov byte p'
db 'tr[di+3],64h--mov byte ptr[di+4],62h--mov byte ptr[di+5],20h--mov byte ptr[di+6],27h--add di,7--jmp sts--sts:cmp cx,0--jne sn--push ax--lea dx,[n]--mo'
db 'v ah,9h--int 21h--pop ax--ll:--cmp al,13--mov ah,45--xchg al,ah--je z--lea dx,[x]--mov ah,09h--int 21h--mov ax,4C00h--int 21h--main endp--.data--x db '
db '2Ch,32h,37h,68h,2Ch,32h,34h,68h,0Dh,0Ah,65h,6eh,64h,20h,73h,74h,61h,72h,74h,24h,0--n db 1261 DUP(0),24h--k db ',27h,24h
end start

Wednesday, March 1, 2023

TASM32, MASM32, MASM64 Quines (Formatting: Macintosh CR (0Dh0Dh0Ah))

; Benu

; by alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]

; 2/27/2023 NYC

; tasm32 benu.asm

; tlink32 ~Tpe ~ap benu.obj,benu.exe,,tmsvcrt.lib,,

.686

.model flat,stdcall

extrn _printf:proc

.code

start:

enter 0,0

mov al,0Dh

mov bl,2Dh

z:lea edx,a

mov cx,1318

r:cmp byte ptr[edx],bl

je s

jmp u

s:mov byte ptr[edx],al

cmp al,2Dh

je c

mov byte ptr[edx+1],0Ah

jmp u

c:mov byte ptr[edx+1],2Dh

u:inc edx

dec cx

cmp cx,0

jnz r

cmp bl,0Dh

je td

push offset a

push offset i

call _printf

jmp ll

td:

lea edi,n

lea esi,a

mov cx,1374

sn:mov al,byte ptr[esi]

mov byte ptr[edi],al

inc esi

inc edi

dec cx

cmp cx,1224

je t

cmp cx,1074

je t

cmp cx,924

je t

cmp cx,774

je t

cmp cx,624

je t

cmp cx,474

je t

cmp cx,324

je t

cmp cx,174

je t

cmp cx,24

je t

jmp sts

t:mov byte ptr[edi],27h

mov byte ptr[edi+1],0Dh

mov byte ptr[edi+2],0Ah

mov byte ptr[edi+3],64h

mov byte ptr[edi+4],62h

mov byte ptr[edi+5],20h

mov byte ptr[edi+6],27h

add edi,7

jmp sts

sts:cmp cx,0

jne sn

push offset n

push offset i

call _printf

ll:mov al,0Dh

cmp bl,2Dh

xchg al,bl

je z

push offset x

push offset i

call _printf

leave

ret

.data

d db 27h,0Dh,0Ah,64h,62h,20h,27h,0

x db 2Ch,32h,37h,68h,2Ch,30h,0Dh,0Ah,65h,6eh,64h,20h,73h,74h,61h,72h,74h,0

i db 25h,73h,0

n db 1380 DUP(0)

a db '; Benu--; by alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]--; 2/27/2023 NYC--; tasm32 benu.asm--; tlink32 ~Tpe ~ap benu.obj,benu.exe,,tmsvcrt.lib,,--'

db '.686--.model flat,stdcall--extrn _printf:proc--.code--start:--enter 0,0--mov al,0Dh--mov bl,2Dh--z:lea edx,a--mov cx,1318--r:cmp byte ptr[edx],bl--je '

db 's--jmp u--s:mov byte ptr[edx],al--cmp al,2Dh--je c--mov byte ptr[edx+1],0Ah--jmp u--c:mov byte ptr[edx+1],2Dh--u:inc edx--dec cx--cmp cx,0--jnz r--cmp'

db ' bl,0Dh--je td--push offset a--push offset i--call _printf--jmp ll--td:--lea edi,n--lea esi,a--mov cx,1374--sn:mov al,byte ptr[esi]--mov byte ptr[edi]'

db ',al--inc esi--inc edi--dec cx--cmp cx,1224--je t--cmp cx,1074--je t--cmp cx,924--je t--cmp cx,774--je t--cmp cx,624--je t--cmp cx,474--je t--cmp cx,32'

db '4--je t--cmp cx,174--je t--cmp cx,24--je t--jmp sts--t:mov byte ptr[edi],27h--mov byte ptr[edi+1],0Dh--mov byte ptr[edi+2],0Ah--mov byte ptr[edi+3],64'

db 'h--mov byte ptr[edi+4],62h--mov byte ptr[edi+5],20h--mov byte ptr[edi+6],27h--add edi,7--jmp sts--sts:cmp cx,0--jne sn--push offset n--push offset i--'

db 'call _printf--ll:mov al,0Dh--cmp bl,2Dh--xchg al,bl--je z--push offset x--push offset i--call _printf--leave--ret--.data--d db 27h,0Dh,0Ah,64h,62h,20h'

db ',27h,0--x db 2Ch,32h,37h,68h,2Ch,30h,0Dh,0Ah,65h,6eh,64h,20h,73h,74h,61h,72h,74h,0--i db 25h,73h,0--n db 1380 DUP(0)--a db ',27h,0

end start


; ###########################

; Firebird

; by alCoPaUL[GIMO][As][aBrA][NPA][b8][BCVG][rRlf]

; 2/27/2023 NYC

; ml64.exe firebird.asm /link /subsystem:console /defaultlib:64mscrt.lib /entry:main

; ############

;

extrn printf:proc

.code

main proc

sub rsp,28h

mov al,13

mov bl,95

z:lea r9,a

mov dx,1329

r:cmp byte ptr[r9],bl

je s

jmp u

s:mov byte ptr[r9],al

cmp al,95

je kcl

mov byte ptr[r9+1],10

jmp u

kcl:mov byte ptr[r9+1],95

u:inc r9

dec dx

cmp dx,0

jnz r

cmp bl,0Dh

je otd

lea rdx,a

lea rcx,i

call printf

jmp ll

otd:

lea rdi,n

lea rsi,a

mov cx,1380

son:mov al,byte ptr[rsi]

mov byte ptr[rdi],al

inc rsi

inc rdi

dec cx

cmp cx,1224

je t

cmp cx,1074

je t

cmp cx,924

je t

cmp cx,774

je t

cmp cx,624

je t

cmp cx,474

je t

cmp cx,324

je t

cmp cx,174

je t

cmp cx,24

je t

jmp sts

t:mov byte ptr[rdi],27h

mov byte ptr[rdi+1],0Dh

mov byte ptr[rdi+2],0Ah

mov byte ptr[rdi+3],64h

mov byte ptr[rdi+4],62h

mov byte ptr[rdi+5],20h

mov byte ptr[rdi+6],27h

add rdi,7

jmp sts

sts:cmp cx,0

jne son

lea rdx,n

lea rcx,i

call printf

ll:mov al,13

cmp bl,95

xchg al,bl

je z

lea rdx,x

lea rcx,i

call printf

add rsp,28h

ret

main endp

.data

d db 27h,0Dh,0Ah,64h,62h,20h,27h,0

x db 2Ch,32h,37h,68h,2Ch,30h,0Dh,0Ah,65h,6eh,64h,0

i db 25h,73h,0

n db 1380 DUP(0)

a db '; ###########################__; Firebird__; by alCoPaUL[GIMO][As][aBrA][NPA][b8][BCVG][rRlf]__; 2/27/2023 NYC__; ml64.exe firebird.asm /link /subsystem:con'

db 'sole /defaultlib:64mscrt.lib /entry:main__; ############__;__extrn printf:proc__.code__main proc__sub rsp,28h__mov al,13__mov bl,95__z:lea r9,a__mov d'

db 'x,1329__r:cmp byte ptr[r9],bl__je s__jmp u__s:mov byte ptr[r9],al__cmp al,95__je kcl__mov byte ptr[r9+1],10__jmp u__kcl:mov byte ptr[r9+1],95__u:inc r'

db '9__dec dx__cmp dx,0__jnz r__cmp bl,0Dh__je otd__lea rdx,a__lea rcx,i__call printf__jmp ll__otd:__lea rdi,n__lea rsi,a__mov cx,1380__son:mov al,byte pt'

db 'r[rsi]__mov byte ptr[rdi],al__inc rsi__inc rdi__dec cx__cmp cx,1224__je t__cmp cx,1074__je t__cmp cx,924__je t__cmp cx,774__je t__cmp cx,624__je t__cm'

db 'p cx,474__je t__cmp cx,324__je t__cmp cx,174__je t__cmp cx,24__je t__jmp sts__t:mov byte ptr[rdi],27h__mov byte ptr[rdi+1],0Dh__mov byte ptr[rdi+2],0A'

db 'h__mov byte ptr[rdi+3],64h__mov byte ptr[rdi+4],62h__mov byte ptr[rdi+5],20h__mov byte ptr[rdi+6],27h__add rdi,7__jmp sts__sts:cmp cx,0__jne son__lea '

db 'rdx,n__lea rcx,i__call printf__ll:mov al,13__cmp bl,95__xchg al,bl__je z__lea rdx,x__lea rcx,i__call printf__add rsp,28h__ret__main endp__.data__d db '

db '27h,0Dh,0Ah,64h,62h,20h,27h,0__x db 2Ch,32h,37h,68h,2Ch,30h,0Dh,0Ah,65h,6eh,64h,0__i db 25h,73h,0__n db 1380 DUP(0)__a db ',27h,0

end


;FengHuang


;by alCoPaUL[GIMO][As][aBrA][NPA][b8]

;2/27/2023

;ml fh.asm /link /subsystem:console /defaultlib:32mscrt.lib /entry:main

.686

.model flat,stdcall

extern printf:proc

.code

start:

main proc

enter 0,0

mov al,0Dh

mov bl,2Dh

z:lea edx,a

mov cx,1329

r:cmp byte ptr[edx],bl

je s

jmp u

s:mov byte ptr[edx],al

cmp al,2Dh

je g

mov byte ptr[edx+1],0Ah

jmp u

g:mov byte ptr[edx+1],2Dh

u:inc edx

dec cx

cmp cx,0

jnz r

cmp bl,0Dh

je td

push offset a

push offset i

call printf

jmp ll

td:

lea edi,n

lea esi,a

mov cx,1374

sn:mov al,byte ptr[esi]

mov byte ptr[edi],al

inc esi

inc edi

dec cx

cmp cx,1224

je t

cmp cx,1074

je t

cmp cx,924

je t

cmp cx,774

je t

cmp cx,624

je t

cmp cx,474

je t

cmp cx,324

je t

cmp cx,174

je t

cmp cx,24

je t

jmp sts

t:mov byte ptr[edi],27h

mov byte ptr[edi+1],0Dh

mov byte ptr[edi+2],0Ah

mov byte ptr[edi+3],64h

mov byte ptr[edi+4],62h

mov byte ptr[edi+5],20h

mov byte ptr[edi+6],27h

add edi,7

jmp sts

sts:cmp cx,0

jne sn

push offset n

push offset i

call printf

ll:mov al,0Dh

cmp bl,2Dh

xchg al,bl

je z

push offset x

push offset i

call printf

leave

ret

main endp

.data

d db 27h,0Dh,0Ah,64h,62h,20h,27h,0

x db 2Ch,32h,37h,68h,2Ch,30h,0Dh,0Ah,65h,6eh,64h,20h,73h,74h,61h,72h,74h,0

i db 25h,73h,0

n db 1380 DUP(0)

a db ';FengHuang--;by alCoPaUL[GIMO][As][aBrA][NPA][b8]--;2/27/2023--;ml fh.asm /link /subsystem:console /defaultlib:32mscrt.lib /entry:main--.686--.model f'

db 'lat,stdcall--extern printf:proc--.code--start:--main proc--enter 0,0--mov al,0Dh--mov bl,2Dh--z:lea edx,a--mov cx,1329--r:cmp byte ptr[edx],bl--je s--'

db 'jmp u--s:mov byte ptr[edx],al--cmp al,2Dh--je g--mov byte ptr[edx+1],0Ah--jmp u--g:mov byte ptr[edx+1],2Dh--u:inc edx--dec cx--cmp cx,0--jnz r--cmp bl'

db ',0Dh--je td--push offset a--push offset i--call printf--jmp ll--td:--lea edi,n--lea esi,a--mov cx,1374--sn:mov al,byte ptr[esi]--mov byte ptr[edi],al-'

db '-inc esi--inc edi--dec cx--cmp cx,1224--je t--cmp cx,1074--je t--cmp cx,924--je t--cmp cx,774--je t--cmp cx,624--je t--cmp cx,474--je t--cmp cx,324--j'

db 'e t--cmp cx,174--je t--cmp cx,24--je t--jmp sts--t:mov byte ptr[edi],27h--mov byte ptr[edi+1],0Dh--mov byte ptr[edi+2],0Ah--mov byte ptr[edi+3],64h--m'

db 'ov byte ptr[edi+4],62h--mov byte ptr[edi+5],20h--mov byte ptr[edi+6],27h--add edi,7--jmp sts--sts:cmp cx,0--jne sn--push offset n--push offset i--call'

db ' printf--ll:mov al,0Dh--cmp bl,2Dh--xchg al,bl--je z--push offset x--push offset i--call printf--leave--ret--main endp--.data--d db 27h,0Dh,0Ah,64h,62'

db 'h,20h,27h,0--x db 2Ch,32h,37h,68h,2Ch,30h,0Dh,0Ah,65h,6eh,64h,20h,73h,74h,61h,72h,74h,0--i db 25h,73h,0--n db 1380 DUP(0)--a db ',27h,0

end start

https://github.com/alcopaul/assemblylanguagequines

Thursday, February 2, 2023

​Win64, Win32, DOS16, MacOS 64-bit and 32-bit Quines ~ alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf] 2/1/2023, NYC

;
; spc-crlf.asm
; alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]
; 10/5/2021 .revision 3 = 2/1/2023
;
; nasm -f win64 spc-crlf.asm
; link spc-crlf.obj /subsystem:console /defaultlib:msvcrt64.lib /entry:m /largeaddressaware:no
;
global m
extern printf
section .text
m:sub rsp,28h
mov al,13
mov bl,95
z:lea r9,a
mov dx,684
r:cmp byte[r9],bl
je s
jmp u
s:mov byte[r9],al
cmp al,95
je c
mov byte[r9+1],10
jmp u
c:mov byte[r9+1],95
u:inc r9
dec dx
cmp dx,0
jnz r
lea rdx,a
lea rcx,i
call printf
mov al,13
cmp bl,95
xchg al,bl
je z
lea rdx,x
lea rcx,i
call printf
add rsp,28h
ret
section .data
x:db 2Ch,32h,37h,68h,2Ch,30h,0
i:db 25h,73h,0
a:db ';__; spc-crlf.asm__; alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]__; 10/5/2021 .revision 3 = 2/1/2023__;__; nasm -f win64 spc-crlf.asm__; link spc-crlf.obj /subsystem:console /defaultlib:msvcrt64.lib /entry:m /largeaddressaware:no__;__global m__extern printf__section .text__m:sub rsp,28h__mov al,13__mov bl,95__z:lea r9,a__mov dx,684__r:cmp byte[r9],bl__je s__jmp u__s:mov byte[r9],al__cmp al,95__je c__mov byte[r9+1],10__jmp u__c:mov byte[r9+1],95__u:inc r9__dec dx__cmp dx,0__jnz r__lea rdx,a__lea rcx,i__call printf__mov al,13__cmp bl,95__xchg al,bl__je z__lea rdx,x__lea rcx,i__call printf__add rsp,28h__ret__section .data__x:db 2Ch,32h,37h,68h,2Ch,30h,0__i:db 25h,73h,0__a:db ',27h,0

;
; sp4ce_crlf.asm
;
; alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]
; 10/6/2021 .revision 2 = 1/31/2023
;
; nasm <dash>f win32 sp4ce_crlf.asm
; link sp4ce_crlf.obj /subsystem:console /defaultlib:32msvcrt.lib /entry:m
;
global m
extern _printf
section .text
m:enter 0,0
mov al,13
mov bl,45
z:lea edx,a
mov cx,666
r:cmp byte[edx],bl
je s
jmp u
s:mov byte[edx],al
cmp al,45
je c
mov byte[edx+1],10
jmp u
c:mov byte[edx+1],45
u:inc edx
dec cx
cmp cx,0
jnz r
push a
push i
call _printf
mov al,13
cmp bl,45
xchg al,bl
je z
push x
push i
call _printf
leave
ret
section .data
x:db 2Ch,32h,37h,68h,2Ch,30h,0
i:db 25h,73h,0
a:db ';--; sp4ce_crlf.asm--;--; alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]--; 10/6/2021 .revision 2 = 1/31/2023--;--; nasm <dash>f win32 sp4ce_crlf.asm--; link sp4ce_crlf.obj /subsystem:console /defaultlib:32msvcrt.lib /entry:m--;--global m--extern _printf--section .text--m:enter 0,0--mov al,13--mov bl,45--z:lea edx,a--mov cx,666--r:cmp byte[edx],bl--je s--jmp u--s:mov byte[edx],al--cmp al,45--je c--mov byte[edx+1],10--jmp u--c:mov byte[edx+1],45--u:inc edx--dec cx--cmp cx,0--jnz r--push a--push i--call _printf--mov al,13--cmp bl,45--xchg al,bl--je z--push x--push i--call _printf--leave--ret--section .data--x:db 2Ch,32h,37h,68h,2Ch,30h,0--i:db 25h,73h,0--a:db ',27h,0

;
; sulfur16.asm
;
; alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]
; 10/7/2021 .revision 2 = 2/1/2023
;
; nasm <dash>f bin <dash>o sulfur16.com sulfur16.asm
;
org 100h
mov al,13
mov ah,45
z:lea bx,[k]
mov cx,551
r:cmp byte[bx],ah
je s
jmp u
s:mov byte[bx],al
cmp al,45
je c
mov byte[bx+1],10
jmp u
c:mov byte[bx+1],45
u:inc bx
dec cx
cmp cx,0
jnz r
push ax
lea dx,[k]
mov ah,9
int 21h
pop ax
cmp al,13
mov ah,45
xchg al,ah
je z
lea dx,[x]
mov ah,9
int 21h
int 20h
x:db 2Ch,32h,37h,68h,2Ch,32h,34h,68h,24h
k:db ';--; sulfur16.asm--;--; alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]--; 10/7/2021 .revision 2 = 2/1/2023--;--; nasm <dash>f bin <dash>o sulfur16.com sulfur16.asm--;--org 100h--mov al,13--mov ah,45--z:lea bx,[k]--mov cx,551--r:cmp byte[bx],ah--je s--jmp u--s:mov byte[bx],al--cmp al,45--je c--mov byte[bx+1],10--jmp u--c:mov byte[bx+1],45--u:inc bx--dec cx--cmp cx,0--jnz r--push ax--lea dx,[k]--mov ah,9--int 21h--pop ax--cmp al,13--mov ah,45--xchg al,ah--je z--lea dx,[x]--mov ah,9--int 21h--int 20h--x:db 2Ch,32h,37h,68h,2Ch,32h,34h,68h,24h--k:db ',27h,24h

; by alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]
; January 26, 2023 NYC
; ./nasm <dash>f macho64 <dash>o 6GosuIchiban4.o SnowLeopard64.asm
; ld <dash>arch x86_64  <dash>macosx_version_min 10.4 <dash>lc /usr/lib/crt1.o <dash>o 6GesuIchIvan4 6GosuIchiban4.o
global _main
extern _printf
section .text
_main:push rbx
mov cl,10
mov bl,45
z:lea r9,[a]
mov dx,685
r:cmp byte[r9],bl
je s
jmp u
s:mov byte[r9],cl
u:inc r9
dec dx
cmp dx,0
jnz r
lea rdi,[i]
lea rax,[a]
mov rsi,rax
xor rax,rax
call _printf
mov cl,10
cmp bl,45
xchg cl,bl
je z
lea rdi,[i]
lea rax,[x]
mov rsi,rax
xor rax,rax
call _printf
pop rbx
ret
section .data
default rel
x:db 2Ch,32h,37h,68h,2Ch,30h,0
i:db 25h,73h,0
a:db '; by alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]-; January 26, 2023 NYC-; ./nasm <dash>f macho64 <dash>o 6GosuIchiban4.o SnowLeopard64.asm-; ld <dash>arch x86_64  <dash>macosx_version_min 10.4 <dash>lc /usr/lib/crt1.o <dash>o 6GesuIchIvan4 6GosuIchiban4.o-global _main-extern _printf-section .text-_main:push rbx-mov cl,10-mov bl,45-z:lea r9,[a]-mov dx,685-r:cmp byte[r9],bl-je s-jmp u-s:mov byte[r9],cl-u:inc r9-dec dx-cmp dx,0-jnz r-lea rdi,[i]-lea rax,[a]-mov rsi,rax-xor rax,rax-call _printf-mov cl,10-cmp bl,45-xchg cl,bl-je z-lea rdi,[i]-lea rax,[x]-mov rsi,rax-xor rax,rax-call _printf-pop rbx-ret-section .data-default rel-x:db 2Ch,32h,37h,68h,2Ch,30h,0-i:db 25h,73h,0-a:db ',27h,0

; by alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]
; January 25, 2023 NYC
; nasm <dash>f macho <dash>o GosuIchiban.o SnowLeopard.asm
; ld <dash>arch i386 <dash>macosx_version_min 10.4 <dash>lc /usr/lib/crt1.o <dash>o GesuIchIvan GosuIchiban.o
global _main
extern _printf
section .text
_main:
enter 0,0
mov al,10
mov bl,45
z:lea edx,[a]
mov cx,596
r:cmp byte [edx],bl
je s
jmp u
s:mov byte [edx],al
u:inc edx
dec cx
cmp cx,0
jnz r
push a
push i
call _printf
mov al,10
cmp bl,45
xchg al,bl
je z
push x
push i
call _printf
leave
ret
section .data
x:db 2Ch,32h,37h,68h,2Ch,30h,0
i:db 25h,73h,0
a:db '; by alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]-; January 25, 2023 NYC-; nasm <dash>f macho <dash>o GosuIchiban.o SnowLeopard.asm-; ld <dash>arch i386 <dash>macosx_version_min 10.4 <dash>lc /usr/lib/crt1.o <dash>o GesuIchIvan GosuIchiban.o-global _main-extern _printf-section .text-_main:-enter 0,0-mov al,10-mov bl,45-z:lea edx,[a]-mov cx,596-r:cmp byte [edx],bl-je s-jmp u-s:mov byte [edx],al-u:inc edx-dec cx-cmp cx,0-jnz r-push a-push i-call _printf-mov al,10-cmp bl,45-xchg al,bl-je z-push x-push i-call _printf-leave-ret-section .data-x:db 2Ch,32h,37h,68h,2Ch,30h,0-i:db 25h,73h,0-a:db ',27h,0

Friday, January 27, 2023

Win64 & Win32 Assembly Language Quines (Updated)

;
; spc.asm
;
; alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]
; 10/5/2021 .revision = 1/27/2023
;
; nasm -f win64 spc.asm
; link spc.obj /subsystem:console /defaultlib:msvcrt64.lib /entry:m /largeaddressaware:no
;
global m
extern printf
section .text
m:sub rsp,28h
mov al,10
mov bl,95
z:lea r9,a
mov dx,567
r:cmp byte[r9],bl
je s
jmp u
s:mov byte[r9],al
u:inc r9
dec dx
cmp dx,0
jnz r
lea rdx,a
lea rcx,i
call printf
mov al,10
cmp bl,95
xchg al,bl
je z
lea rdx,x
lea rcx,i
call printf
add rsp,28h
ret
section .data
x:db 2Ch,32h,37h,68h,2Ch,30h,0
i:db 25h,73h,0
a:db ';_; spc.asm_;_; alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]_; 10/5/2021 .revision = 1/27/2023_;_; nasm -f win64 spc.asm_; link spc.obj /subsystem:console /defaultlib:msvcrt64.lib /entry:m /largeaddressaware:no_;_global m_extern printf_section .text_m:sub rsp,28h_mov al,10_mov bl,95_z:lea r9,a_mov dx,567_r:cmp byte[r9],bl_je s_jmp u_s:mov byte[r9],al_u:inc r9_dec dx_cmp dx,0_jnz r_lea rdx,a_lea rcx,i_call printf_mov al,10_cmp bl,95_xchg al,bl_je z_lea rdx,x_lea rcx,i_call printf_add rsp,28h_ret_section .data_x:db 2Ch,32h,37h,68h,2Ch,30h,0_i:db 25h,73h,0_a:db ',27h,0

;
; sp4ce.asm
;
; alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]
; 10/6/2021 .revision = 1/27/2023
;
; nasm <dash>f win32 sp4ce.asm
; link sp4ce.obj /subsystem:console /defaultlib:32msvcrt.lib /entry:m
;
global m
extern _printf
section .text
m:enter 0,0
mov al,10
mov bl,45
z:lea edx,a
mov cx,543
r:cmp byte[edx],bl
je s
jmp u
s:mov byte[edx],al
u:inc edx
dec cx
cmp cx,0
jnz r
push a
push i
call _printf
mov al,10
cmp bl,45
xchg al,bl
je z
push x
push i
call _printf
leave
ret
section .data
x:db 2Ch,32h,37h,68h,2Ch,30h,0
i:db 25h,73h,0
a:db ';-; sp4ce.asm-;-; alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]-; 10/6/2021 .revision = 1/27/2023-;-; nasm <dash>f win32 sp4ce.asm-; link sp4ce.obj /subsystem:console /defaultlib:32msvcrt.lib /entry:m-;-global m-extern _printf-section .text-m:enter 0,0-mov al,10-mov bl,45-z:lea edx,a-mov cx,543-r:cmp byte[edx],bl-je s-jmp u-s:mov byte[edx],al-u:inc edx-dec cx-cmp cx,0-jnz r-push a-push i-call _printf-mov al,10-cmp bl,45-xchg al,bl-je z-push x-push i-call _printf-leave-ret-section .data-x:db 2Ch,32h,37h,68h,2Ch,30h,0-i:db 25h,73h,0-a:db ',27h,0

MacOSX Assembly Language Quines (x64, 32-bit)

; by alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]
; January 26, 2023 NYC
; ./nasm <dash>f macho64 <dash>o 6GosuIchiban4.o SnowLeopard64.asm
; ld <dash>arch x86_64  <dash>macosx_version_min 10.4 <dash>lc /usr/lib/crt1.o <dash>o 6GesuIchIvan4 6GosuIchiban4.o
global _main
extern _printf
section .text
_main:push rbx
mov cl,10
mov bl,45
z:lea r9,[a]
mov dx,685
r:cmp byte[r9],bl
je s
jmp u
s:mov byte[r9],cl
u:inc r9
dec dx
cmp dx,0
jnz r
lea rdi,[i]
lea rax,[a]
mov rsi,rax
xor rax,rax
call _printf
mov cl,10
cmp bl,45
xchg cl,bl
je z
lea rdi,[i]
lea rax,[x]
mov rsi,rax
xor rax,rax
call _printf
pop rbx
ret
section .data
default rel
x:db 2Ch,32h,37h,68h,2Ch,30h,0
i:db 25h,73h,0
a:db '; by alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]-; January 26, 2023 NYC-; ./nasm <dash>f macho64 <dash>o 6GosuIchiban4.o SnowLeopard64.asm-; ld <dash>arch x86_64  <dash>macosx_version_min 10.4 <dash>lc /usr/lib/crt1.o <dash>o 6GesuIchIvan4 6GosuIchiban4.o-global _main-extern _printf-section .text-_main:push rbx-mov cl,10-mov bl,45-z:lea r9,[a]-mov dx,685-r:cmp byte[r9],bl-je s-jmp u-s:mov byte[r9],cl-u:inc r9-dec dx-cmp dx,0-jnz r-lea rdi,[i]-lea rax,[a]-mov rsi,rax-xor rax,rax-call _printf-mov cl,10-cmp bl,45-xchg cl,bl-je z-lea rdi,[i]-lea rax,[x]-mov rsi,rax-xor rax,rax-call _printf-pop rbx-ret-section .data-default rel-x:db 2Ch,32h,37h,68h,2Ch,30h,0-i:db 25h,73h,0-a:db ',27h,0

; by alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]
; January 25, 2023 NYC
; nasm <dash>f macho <dash>o GosuIchiban.o SnowLeopard.asm
; ld <dash>arch i386 <dash>macosx_version_min 10.4 <dash>lc /usr/lib/crt1.o <dash>o GesuIchIvan GosuIchiban.o
global _main
extern _printf
section .text
_main:
enter 0,0
mov al,10
mov bl,45
z:lea edx,[a]
mov cx,596
r:cmp byte [edx],bl
je s
jmp u
s:mov byte [edx],al
u:inc edx
dec cx
cmp cx,0
jnz r
push a
push i
call _printf
mov al,10
cmp bl,45
xchg al,bl
je z
push x
push i
call _printf
leave
ret
section .data
x:db 2Ch,32h,37h,68h,2Ch,30h,0
i:db 25h,73h,0
a:db '; by alCoPaUL [GIMO][As][aBrA][NPA][b8][BCVG][rRlf]-; January 25, 2023 NYC-; nasm <dash>f macho <dash>o GosuIchiban.o SnowLeopard.asm-; ld <dash>arch i386 <dash>macosx_version_min 10.4 <dash>lc /usr/lib/crt1.o <dash>o GesuIchIvan GosuIchiban.o-global _main-extern _printf-section .text-_main:-enter 0,0-mov al,10-mov bl,45-z:lea edx,[a]-mov cx,596-r:cmp byte [edx],bl-je s-jmp u-s:mov byte [edx],al-u:inc edx-dec cx-cmp cx,0-jnz r-push a-push i-call _printf-mov al,10-cmp bl,45-xchg al,bl-je z-push x-push i-call _printf-leave-ret-section .data-x:db 2Ch,32h,37h,68h,2Ch,30h,0-i:db 25h,73h,0-a:db ',27h,0