mirror of
https://github.com/nganhkhoa/CTF-All-In-One.git
synced 2025-06-29 14:15:04 +07:00
fix
This commit is contained in:
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