mirror of
https://github.com/nganhkhoa/CTF-All-In-One.git
synced 2025-06-24 04:05:03 +07:00
update
This commit is contained in:
14
src/Others/1.5.9_linux_kernel/config-fragment
Normal file
14
src/Others/1.5.9_linux_kernel/config-fragment
Normal file
@ -0,0 +1,14 @@
|
||||
CONFIG_DEBUG_INFO=y
|
||||
CONFIG_DEBUG_INFO_REDUCED=n
|
||||
CONFIG_GDB_SCRIPTS=y
|
||||
|
||||
CONFIG_STRICT_KERNEL_RWX=n
|
||||
CONFIG_FRAME_POINTER=y
|
||||
CONFIG_KGDB=y
|
||||
CONFIG_KGDB_SERIAL_CONSOLE=y
|
||||
|
||||
CONFIG_KGDB_KDB=y
|
||||
CONFIG_KDB_KEYBOARD=y
|
||||
|
||||
CONFIG_RANDOMIZE_BASE=n
|
||||
CONFIG_RANDOMIZE_MEMORY=n
|
19
src/Others/1.5.9_linux_kernel/hello32.S
Normal file
19
src/Others/1.5.9_linux_kernel/hello32.S
Normal file
@ -0,0 +1,19 @@
|
||||
.data
|
||||
|
||||
msg:
|
||||
.ascii "hello 32-bit!\n"
|
||||
len = . - msg
|
||||
|
||||
.text
|
||||
.global _start
|
||||
|
||||
_start:
|
||||
movl $len, %edx
|
||||
movl $msg, %ecx
|
||||
movl $1, %ebx
|
||||
movl $4, %eax
|
||||
int $0x80
|
||||
|
||||
movl $0, %ebx
|
||||
movl $1, %eax
|
||||
int $0x80
|
19
src/Others/1.5.9_linux_kernel/hello64.S
Normal file
19
src/Others/1.5.9_linux_kernel/hello64.S
Normal file
@ -0,0 +1,19 @@
|
||||
.data
|
||||
|
||||
msg:
|
||||
.ascii "Hello 64-bit!\n"
|
||||
len = . - msg
|
||||
|
||||
.text
|
||||
.global _start
|
||||
|
||||
_start:
|
||||
movq $1, %rdi
|
||||
movq $msg, %rsi
|
||||
movq $len, %rdx
|
||||
movq $1, %rax
|
||||
syscall
|
||||
|
||||
xorq %rdi, %rdi
|
||||
movq $60, %rax
|
||||
syscall
|
8
src/Others/4.1_linux_kernel_debug/Makefile
Normal file
8
src/Others/4.1_linux_kernel_debug/Makefile
Normal file
@ -0,0 +1,8 @@
|
||||
BUILDPATH := ~/kernelbuild/linux-4.16.3/
|
||||
obj-m += hello.o
|
||||
|
||||
all:
|
||||
make -C $(BUILDPATH) M=$(PWD) modules
|
||||
|
||||
clean:
|
||||
make -C $(BUILDPATH) M=$(PWD) clean
|
4
src/Others/4.1_linux_kernel_debug/create_initramfs.sh
Normal file
4
src/Others/4.1_linux_kernel_debug/create_initramfs.sh
Normal file
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd ./initramfs/
|
||||
find . -print0 | cpio --null -ov --format=newc | gzip -9 > ../initramfs.cpio.gz
|
20
src/Others/4.1_linux_kernel_debug/hello.c
Normal file
20
src/Others/4.1_linux_kernel_debug/hello.c
Normal file
@ -0,0 +1,20 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
|
||||
static int hello_init(void)
|
||||
{
|
||||
printk(KERN_ALERT "Hello module!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void hello_exit(void)
|
||||
{
|
||||
printk(KERN_ALERT "Goodbye module!\n");
|
||||
}
|
||||
|
||||
module_init(hello_init);
|
||||
module_exit(hello_exit);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("A simple module.");
|
Reference in New Issue
Block a user