From f79c6ad58b74b07e9a244527558c58c665b23952 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=9CM=C3=9C=C5=9E?= <96421894+Tahinli@users.noreply.github.com> Date: Sun, 7 Jan 2024 14:35:49 +0300 Subject: [PATCH] feat: reboot_system --- 006-reboot_system.s | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 006-reboot_system.s diff --git a/006-reboot_system.s b/006-reboot_system.s new file mode 100644 index 0000000..f88bb8f --- /dev/null +++ b/006-reboot_system.s @@ -0,0 +1,40 @@ +.global _start +.intel_syntax noprefix +.data + magic_1: + .int 0xfee1dead + magic_2: + .int 0x28121969 + cmd: + .int 0x1234567 +.text + _start: + //hello world + lea rsi, [hello_world] + mov rdx, 13 + call printf + + //sync + mov rax, 162 + syscall + + //reboot + mov rax, 169 + mov rdi, [magic_1] + mov rsi, [magic_2] + mov rdx, [cmd] + syscall + + //exit + mov rax, 60 + xor rdi, rdi + syscall + + hello_world: + .asciz "Hello World\n" + printf: + mov rax, 1 + mov rdi, 1 + syscall + xor rdi, rdi + ret