This commit is contained in:
2025-04-09 08:55:55 +02:00
parent b9c451e95c
commit 9d4e1a79f5
24 changed files with 499 additions and 11 deletions

BIN
SCR2.1/ARM/TP16/a.out Executable file

Binary file not shown.

BIN
SCR2.1/ARM/TP16/printHW.o Normal file

Binary file not shown.

24
SCR2.1/ARM/TP16/printHW.s Normal file
View File

@@ -0,0 +1,24 @@
/*
Lines enclosed here are comments
A small program: prints "Hello World!"
*/
// From // to the end of this line is a comment: next are directives to the assembler
.equ SYS_EXIT, 93
.equ SYS_WRITE, 64
.data // tells assembler to assemble the following in the data section
msg: .asciz "Hello World!\n" //msg retains the address of the string
.text // tells assembler to assemble the following
// in the text (code) section
.globl _start // _start is there where the program starts,
// .globl makes it visible to the linker
_start:
mov x0,#1 // value 1 is placed in register x0
adr x1,msg // the address retained by label msg is placed in register x1
mov x2,#13
mov w8, #SYS_WRITE // svc must find the syscall number in w8
// and the syscall arguments in x0,x1,x2
svc #0 // invoke syscall: displays on the screen
mov x0, #0 // in x0 put the value you want to exit with
mov w8,#SYS_EXIT
svc #0
.end

View File

@@ -0,0 +1,32 @@
On commence le tp on faisant ssh 172.16.3.178
1.
on peut utiliser la commande uname -a
ou
On utilise la commande file /lib/systemd/* .
/lib/systemd/systemd-user-sessions: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, BuildID[sha1]=0f2486b01f56eccc8508f57e5368a85596b5def8, for GNU/Linux 3.7.0, stripped
/lib/systemd/systemd-veritysetup: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, BuildID[sha1]=490eef8732d10f68818f236f5ae07aac17d36f32, for GNU/Linux 3.7.0, stripped
/lib/systemd/systemd-volatile-root: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, BuildID[sha1]=2527638aa270e6db3bdc5f0ca199da65450a120d, for GNU/Linux 3.7.0, stripped
/lib/systemd/systemd-xdg-autostart-condition: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, BuildID[sha1]=35a2d9040992e606a16b0674c8ae1c602a308f78, for GNU/Linux 3.7.0, stripped
Nous pouvons constater que tous le exécutables correspondants sont 64 bits, donc c'est un 64-bit OS
2.
On peut utilisé la commande lscpu .
Nous pouvons voir si l'Architecture est aarch64
Rappel :
Le descripteur de fichier associé a :
-> la sortie standard des erreurs est le numéro 2.
-> la sortie standard des résultat est le numéro 1.
-> l'entrée sandard est le numéro 0.
Write ( (on met ici le descripteur de fichier qu'il faut) , buf,(nbr_doctets_a_partir_de_buf) );
On peux utiliser la commande less /usr/include/asm-generic/unistd.h pour savoir quel est la sortie par exemple en fait /write on sait que c'est 64.
j'utilise la commande as -gstabs -o printHW.o printfHW.s
puis ld -O0 printHW.o

View File

@@ -0,0 +1,24 @@
+.equ SYS_EXIT, 93
.data
int:.quad 0x11223344aabbccdd
int32:.word 0x887766ee
.text
.globl _start
_start:
adr x1,int
ldr x0,[x1]
adr x1,int32
ldr w0,[x1]
sxtw x1,w0
mov w8,#SYS_EXIT
mov x0,#0
svc #0
.end

BIN
SCR2.1/ARM/TP17/a.out Executable file

Binary file not shown.

BIN
SCR2.1/ARM/TP17/add-int.o Normal file

Binary file not shown.

24
SCR2.1/ARM/TP17/add-int.s Normal file
View File

@@ -0,0 +1,24 @@
.equ SYS_EXIT, 93
.data
int1: .quad 1
int2: .quad 2
.text
.globl _start
_start:
adr x0,int1
adr x1,int2
ldr x2,[x0]
ldr x3,[x1]
add x4,x2,x3
mov w8,#SYS_EXIT
mov x0,#0
svc #0
.end

BIN
SCR2.1/ARM/TP17/add-int32.o Normal file

Binary file not shown.

View File

@@ -0,0 +1,24 @@
.equ SYS_EXIT, 93
.data
int1: .word 1
int2: .word 2
.text
.globl _start
_start:
adr x0,int1
adr x1,int2
ldr w2,[x0]
ldr w3,[x1]
add w4,w2,w3
mov w8,#SYS_EXIT
mov x0,#0
svc #0
.end

Binary file not shown.

View File

@@ -0,0 +1,25 @@
.equ SYS_EXIT, 93
.data
int1: .word 1
int2: .word 2
.text
.globl _start
_start:
adr x0,int1
adr x1,int2
ldr w2,[x0]
ldr w3,[x1]
adds w4,w2,w3
MRS x0,NZCV
mov w8,#SYS_EXIT
mov x0,#0
svc #0
.end

View File

@@ -0,0 +1,305 @@
ssh 172.16.3.178
1.
as -gstabs -o w-vs-x-and-extension.o w-vs-x-and-extension.s
ld -O0 w-vs-x-and-extension.o
(gdb) l 14
9 .globl _start
10
11 _start:
12 ldr x0,#int
13 ldr w0,#int32
14 mov w8,#SYS_EXIT
15 mov x0,#0
16 svc #0
17
18 .end
(gdb) b 12
Breakpoint 1 at 0x4000b0: file w-vs-x-and-extension.s, line 12.
(gdb) run
Starting program: /export/home/an23/solar/SCR/SCR2.1/ARM/TP17/a.out
Breakpoint 1, _start () at w-vs-x-and-extension.s:12
12 ldr x0,#int
(gdb) i r x0 w0 w8
x0 0x0 0
w0 0x0 0
w8 0x0 0
(gdb) step
13 ldr w0,#int32
(gdb) i r x0 w0 w8
x0 0x11223344aabbccdd 1234605617868164317
w0 0x11223344aabbccdd 1234605617868164317
w8 0x0 0
2)
(gdb) l 14
9 .globl _start
10
11 _start:
12 adr x1,int
13 ldr x0,[x1]
14
15 adr x1,int32
16 ldr w0,[x1]
17
18 sxtw x1,w0
(gdb) b 12
Breakpoint 1 at 0x4000b0: file w-vs-x-and-extension.s, line 12.
(gdb) i r w0 x0 x1
The program has no registers now.
(gdb) run
Starting program: /export/home/an23/solar/SCR/SCR2.1/ARM/TP17/a.out
Breakpoint 1, _start () at w-vs-x-and-extension.s:12
12 adr x1,int
(gdb) i r w0 x0 x1
w0 0x0 0
x0 0x0 0
x1 0x0 0
(gdb) s
13 ldr x0,[x1]
(gdb) i r w0 x0 x1
w0 0x0 0
x0 0x0 0
x1 0x4100d0 4260048
(gdb) s
15 adr x1,int32
(gdb) i r w0 x0 x1
w0 0x11223344aabbccdd 1234605617868164317
x0 0x11223344aabbccdd 1234605617868164317
x1 0x4100d0 4260048
(gdb) s
16 ldr w0,[x1]
(gdb) i r w0 x0 x1
w0 0x11223344aabbccdd 1234605617868164317
x0 0x11223344aabbccdd 1234605617868164317
x1 0x4100d8 4260056
(gdb) s
18 sxtw x1,w0
(gdb) i r w0 x0 x1
w0 0x887766ee 2289526510
x0 0x887766ee 2289526510
x1 0x4100d8 4260056
(gdb)
II)
1)
(gdb) l
1 .equ SYS_EXIT, 93
2
3 .data
4
5 int1: .quad 1
6 int2: .quad 2
7
8 .text
9 .globl _start
10
(gdb) b 9
Breakpoint 1 at 0x4000b0: file add-int.s, line 13.
(gdb) run
Starting program: /export/home/an23/solar/SCR/SCR2.1/ARM/TP17/a.out
Breakpoint 1, _start () at add-int.s:13
13 adr x0,int1
(gdb) i r w x0 x1 x2 x3 x4
Invalid register `w'
(gdb) i r x0 x1 x2 x3 x4
x0 0x0 0
x1 0x0 0
x2 0x0 0
x3 0x0 0
x4 0x0 0
(gdb) s
14 adr x1,int2
(gdb) i r x0 x1 x2 x3 x4
x0 0x4100d0 4260048
x1 0x0 0
x2 0x0 0
x3 0x0 0
x4 0x0 0
(gdb) s
15 ldr x2,[x0]
(gdb) i r x0 x1 x2 x3 x4
x0 0x4100d0 4260048
x1 0x4100d8 4260056
x2 0x0 0
x3 0x0 0
x4 0x0 0
(gdb) s
16 ldr x3,[x1]
(gdb) i r x0 x1 x2 x3 x4
x0 0x4100d0 4260048
x1 0x4100d8 4260056
x2 0x1 1
x3 0x0 0
x4 0x0 0
(gdb) s
18 add x4,x2,x3
(gdb) i r x0 x1 x2 x3 x4
x0 0x4100d0 4260048
x1 0x4100d8 4260056
x2 0x1 1
x3 0x2 2
x4 0x0 0
(gdb) s
20 mov w8,#SYS_EXIT
(gdb) i r x0 x1 x2 x3 x4
x0 0x4100d0 4260048
x1 0x4100d8 4260056
x2 0x1 1
x3 0x2 2
x4 0x3 3
2.
(gdb) l
1 .equ SYS_EXIT, 93
2
3 .data
4
5 int1: .word 1
6 int2: .word 2
7
8 .text
9 .globl _start
10
(gdb) b 9
Breakpoint 1 at 0x4000b0: file add-int32.s, line 13.
(gdb) i r w4 w2 w3
The program has no registers now.
(gdb) run
Starting program: /export/home/an23/solar/SCR/SCR2.1/ARM/TP17/a.out
Breakpoint 1, _start () at add-int32.s:13
13 adr x0,int1
(gdb) i r w4 w2 w3
w4 0x0 0
w2 0x0 0
w3 0x0 0
(gdb) s
14 adr x1,int2
(gdb) i r w4 w2 w3
w4 0x0 0
w2 0x0 0
w3 0x0 0
(gdb) i r w4 w2 w3s
w4 0x0 0
w2 0x0 0
Invalid register `w3s'
(gdb) s
15 ldr w2,[x0]
(gdb) i r w4 w2 w3s
w4 0x0 0
w2 0x0 0
Invalid register `w3s'
(gdb) i r w4 w2 w3
w4 0x0 0
w2 0x0 0
w3 0x0 0
(gdb) s
16 ldr w3,[x1]
(gdb) i r w4 w2 w3
w4 0x0 0
w2 0x1 1
w3 0x0 0
(gdb) s && i r w4 w2 w3
A syntax error in expression, near `&& i r w4 w2 w3'.
(gdb) s
18 add w4,w2,w3
(gdb) i r w4 w2 w3
w4 0x0 0
w2 0x1 1
w3 0x2 2
(gdb) s
20 mov w8,#SYS_EXIT
(gdb) i r w4 w2 w3
w4 0x3 3
w2 0x1 1
w3 0x2 2
3)
(gdb) l
1 .equ SYS_EXIT, 93
2
3 .data
4
5 int1: .word 1
6 int2: .word 2
7
8 .text
9 .globl _start
10
(gdb) b 9
Breakpoint 1 at 0x4000b0: file adds-int32.s, line 13.
(gdb) s
The program is not being run.
(gdb) run
Starting program: /export/home/an23/solar/SCR/SCR2.1/ARM/TP17/a.out
Breakpoint 1, _start () at adds-int32.s:13
13 adr x0,int1
(gdb) i r w3 w2 w1 x0
w3 0x0 0
w2 0x0 0
w1 0x0 0
x0 0x0 0
(gdb) s
14 adr x1,int2
(gdb) i r w3 w2 w1 x0
w3 0x0 0
w2 0x0 0
w1 0x0 0
x0 0x4100d4 4260052
(gdb) s
15 ldr w2,[x0]
(gdb) s
16 ldr w3,[x1]
(gdb) s
18 adds w4,w2,w3
(gdb) i r w3 w2 w1 x0
w3 0x2 2
w2 0x1 1
w1 0x4100d8 4260056
x0 0x4100d4 4260052
(gdb) s
19 MRS x0,NZCV
(gdb) i r w3 w2 w1 x0
w3 0x2 2
w2 0x1 1
w1 0x4100d8 4260056
x0 0x4100d4 4260052
(gdb) s
21 mov w8,#SYS_EXIT
(gdb) i r w3 w2 w1 x0
w3 0x2 2
w2 0x1 1
w1 0x4100d8 4260056
x0 0x0 0
(gdb) i r w3 w2 w1 x0 w4
w3 0x2 2
w2 0x1 1
w1 0x4100d8 4260056
x0 0x0 0
w4 0x3 3

Binary file not shown.

View File

@@ -0,0 +1,24 @@
.equ SYS_EXIT, 93
.data
int:.quad 0x11223344aabbccdd
int32:.word 0x887766ee
.text
.globl _start
_start:
adr x1,int
ldr x0,[x1]
adr x1,int32
ldr w0,[x1]
sxtw x1,w0
mov w8,#SYS_EXIT
mov x0,#0
svc #0
.end

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -85,6 +85,23 @@ Le serveur a l'authorité sur le domain quand on a le aa si nous n'avons pas de
Le temps de vie (TTL) est de 64 cela permet de ne pas avoit de paquet zombie, tournant à l'infini dans le réseaux.
7)
tcpdump -i eno1 -vvv -l -f "port 53" | tee tcpdump.txt
III)
1)
Le TTL jusqu'a vintage.com est de 60
; ANSWER SECTION:
vintage.com. 60 IN A 86.105.245.69
Puis on constate que le dig 1 seconde a près a perdu 1 de TTL.
; ANSWER SECTION:
vintage.com. 59 IN A 86.105.245.69

0
SCR2.1/TP15/tcpdump.txt Normal file
View File

View File

@@ -1,11 +0,0 @@
ssh 172.16.3.170
lscpu
less /proc/cpuinfo
1.
le système d'exploitation est 64 bits.
2.
aarch64
CPU architectuer:8