Ok so I am trying to assemble some code in assembly using nasm -f elf final.asm
:
xor eax,eax
push eax
push dword(0x75792273)
push dword(0x70742027)
push dword(0x77777875)
push dword(0x20237678)
push dword(0x76727827)
push dword(0x27797175)
push dword(0x75711225)
push dword(0x72747676)
push dword(0x74231476)
push dword(0x70707470)
push dword(0x23247077)
push dword(0x78707822)
push dword(0x24711174)
push dword(0x22707373)
push dword(0x78717974)
push dword(0x75771777)
push dword(0x70777125)
push dword(0x73731472)
push dword(0x71277377)
push dword(0x79251822)
push dword(0x79707478)
push dword(0x78742779)
push dword(0x72727871)
push dword(0x71251475)
push dword(0x27247772)
push dword(0x79757479)
push dword(0x70227071)
push dword(0x77737420)
push dword(0x70251970)
push dword(0x74747127)
push dword(0x23277677)
push dword(0x79712024)
push esp
pop esi
mov edi,esi
mov edx,edi
cld
mov ecx,0x80
mov ebx,0x41
xor eax,eax
push eax
lods byte[esi]
xor eax,ebx
stos byte[es:edi]
loop 0xb7
push esp
pop esi
int 0x3
Which results in the following error:
final.asm:44: error: parser: instruction expected
final.asm:46: error: parser: instruction expected
I found the answer to these errors at: NASM: parser: instruction expected rep movs
Basically, this says that the lods and stos instructions are not recognized by NASM. Which means I need to convert them into something NASM does recognize so that I get the same result.
My question is, what can I change these two lines to so that NASM can compile it so that I can ultimately debug it.
lodsb
andstosb
(no operands). – Jesterlodsb
andstosb
notlodsb byte [esi]
. – Jesterlodsb
the syntax in NASM isss lodsb
(I was curious myself, as I didn't needed it yet, so I had to search a while to find NASM syntax).stos
family of instructions is fixed toes
and can't be overridden. – Ped7g