Init project
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,33 @@
|
||||
format ELF
|
||||
public _start
|
||||
|
||||
extrn print.int
|
||||
extrn print.bin
|
||||
extrn print.str
|
||||
extrn print.nl
|
||||
extrn exit
|
||||
|
||||
macro nl {
|
||||
call print.nl
|
||||
}
|
||||
|
||||
|
||||
section '.strtab'
|
||||
str1 db "Hello world!", 0
|
||||
|
||||
|
||||
section '.text' executable
|
||||
_start:
|
||||
push dword 123
|
||||
call print.int
|
||||
nl
|
||||
|
||||
push dword 123
|
||||
call print.bin
|
||||
nl
|
||||
|
||||
push str1
|
||||
call print.str
|
||||
nl
|
||||
|
||||
call exit
|
||||
Binary file not shown.
@@ -0,0 +1,11 @@
|
||||
all: main
|
||||
|
||||
main: ../../std.o
|
||||
fasm main.asm
|
||||
ld -m elf_i386 main.o ../../std.o --output main
|
||||
|
||||
../../std.o:
|
||||
make -C ../../ std.o
|
||||
|
||||
clear:
|
||||
rm main.o main
|
||||
Binary file not shown.
@@ -0,0 +1,39 @@
|
||||
format ELF
|
||||
public _start
|
||||
|
||||
extrn file.open
|
||||
extrn file.content
|
||||
extrn file.close
|
||||
extrn print.str
|
||||
extrn print.nl
|
||||
extrn exit
|
||||
|
||||
|
||||
section '.strtab'
|
||||
filename db "/home/sweetbread/headers", 0
|
||||
|
||||
|
||||
section '.bss' writeable
|
||||
file_ rd 1
|
||||
|
||||
|
||||
section '.text' executable
|
||||
_start:
|
||||
push filename
|
||||
call file.open
|
||||
pop eax
|
||||
mov [file_], eax
|
||||
|
||||
push dword [file_]
|
||||
call print.str
|
||||
call print.nl
|
||||
call print.nl
|
||||
|
||||
push dword [file_]
|
||||
call file.content
|
||||
call print.str
|
||||
|
||||
push dword [file_]
|
||||
call file.close
|
||||
|
||||
call exit
|
||||
Binary file not shown.
@@ -0,0 +1,24 @@
|
||||
all: main
|
||||
|
||||
main: ../../file.o ../../std.o ../../path.o ../../string.o
|
||||
fasm main.asm
|
||||
ld -m elf_i386 main.o ../../file.o ../../std.o ../../path.o ../../string.o --output main
|
||||
|
||||
# ../../string.o:
|
||||
# make -C ../.. string.o
|
||||
|
||||
../../std.o:
|
||||
make -C ../.. std.o
|
||||
|
||||
../../file.o:
|
||||
make -C ../.. file.o
|
||||
|
||||
../../path.o:
|
||||
make -C ../.. path.o
|
||||
|
||||
../../string.o:
|
||||
make -C ../.. string.o
|
||||
|
||||
clear:
|
||||
rm main.o main
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,28 @@
|
||||
format ELF
|
||||
public _start
|
||||
|
||||
extrn network.IP_to_str
|
||||
extrn network.get_ip
|
||||
extrn dnstoys.myip
|
||||
extrn print.str
|
||||
extrn print.nl
|
||||
extrn exit
|
||||
|
||||
|
||||
section '.strtab'
|
||||
hostname db "google.com", 0
|
||||
|
||||
|
||||
section '.text' executable
|
||||
_start:
|
||||
call dnstoys.myip
|
||||
call print.str
|
||||
call print.nl
|
||||
|
||||
push hostname
|
||||
call network.get_ip
|
||||
call network.IP_to_str
|
||||
call print.str
|
||||
call print.nl
|
||||
|
||||
call exit
|
||||
Binary file not shown.
@@ -0,0 +1,24 @@
|
||||
all: main
|
||||
|
||||
main: ../../std.o ../../string.o ../../network.o ../../dns.o ../../dnstoys.o
|
||||
fasm main.asm
|
||||
ld -m elf_i386 main.o ../../std.o ../../string.o ../../network.o ../../dns.o ../../dnstoys.o --output main
|
||||
|
||||
../../std.o:
|
||||
make -C ../.. std.o
|
||||
|
||||
../../string.o:
|
||||
make -C ../.. string.o
|
||||
|
||||
../../network.o:
|
||||
make -C ../.. network.o
|
||||
|
||||
../../dns.o:
|
||||
make -C ../.. dns.o
|
||||
|
||||
../../dnstoys.o:
|
||||
make -C ../.. dnstoys.o
|
||||
|
||||
clear:
|
||||
rm main.o main
|
||||
|
||||
Reference in New Issue
Block a user