with `gcc` and `nasm` installed, you can simply run
```
-make
+sudo make install
```
to build the project
-### COMMANDS
+### USAGE/COMMANDS
+
+**sped** takes a single command line argument, the file you wish to open.
+```
+sped [file]
+```
**p** - prints the contents of the current line
+; sped - the stupidly pointless editor
+; written by pinosaur
+; fileutils.asm: file i/o
%include "macros.S"
cmp DWORD [ebp-IS_EOF], 1
je _readFile_exit
-
- ; push esi
- ; call printf
-
; make string buffer bigger
mov eax, DWORD [ebp-LINES_READ]
add eax, 1
add ecx, [ebp-CHAR_COUNT]
mov edx, 1
int 0x80
-
- ; mov eax, 4
- ; mov ebx, 1
- ; mov ecx, [ebp-STR_PTR]
- ; add ecx, [ebp-CHAR_COUNT]
- ; mov edx, 1
- ; int 0x80
; check for eof
cmp eax, 0 ; eax has zero on eof
CFLAGS=-m32 -no-pie
ASM=nasm
ASMFLAGS=-f elf32 -g
+PREFIX=/usr/bin
-.PHONY: clean
+.PHONY: clean install uninstall
make: sped
sped: sped.o fileutils.o repl.o utils.o
$(CC) $(CFLAGS) -o $@ $^
+install: sped
+ mkdir -p $(PREFIX)
+ cp -f sped $(PREFIX)
+ chmod 775 $(PREFIX)/sped
+
+uninstall:
+ rm -f $(PREFIX)/sped
+
clean:
rm sped *.o
+; sped - the stupidly pointless editor
+; written by pinosaur
+; repl.asm: user interactions
extern printf
extern fflush
section .data
prompt_str db `sped > `, 0x00
- invalidcmd_str db `invalid command\n`, 0x00
- invalidaddr_str db `invalid address\n`, 0x00
- oneline_str db `cannot delete line, as there is only one line\n`, 0x00
- charcount_str db `read %i chars\n`, 0x00
+ invalidcmd_str db `invalid command.\n`, 0x00
+ invalidaddr_str db `invalid address.\n`, 0x00
+ oneline_str db `cannot delete line, as there is only one line.\n`, 0x00
currentline_str db `current line: %i\n`, 0x00
echo_str db `%s`, 0x00 ; print strings without format exploit
; sped - the stupidly pointless editor
+; written by pinosaur
+; sped.asm: main file
%include "macros.S"
section .data
banner_str db `SPED - the stupidly pointless editor\n`, 0x00
- nofile_str db `no file provided\n`, 0x00
- readlines_str db `opened file with %i lines\n`, 0x00
+ nofile_str db `no file provided.\n`, 0x00
+ readlines_str db `opened file with %i lines.\n`, 0x00
section .text
main:
+; sped - the stupidly pointless editor
+; written by pinosaur
+; utils.asm: some buffer utilities
%include "macros.S"