-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.c
56 lines (46 loc) · 1.58 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* kEIPM (kerenl ELF Integrity Protection Module)
* Copyright (C) 2020 cassuto <[email protected]> & KingOfSmail
*
* This project is free edition; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License(GPL) as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This project is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include "keipm.h"
#include "watcher.h"
#include "validator.h"
MODULE_AUTHOR ("cassuto <[email protected]>");
MODULE_DESCRIPTION ("kernel ELF Integrity Protection Module");
MODULE_LICENSE("GPL");
MODULE_VERSION("1.0.0");
static void trace_error(keipm_err_t err);
static int __init keipm_init(void)
{
/* banner */
printk(KERN_INFO kEIPM "module loaded.\n");
validator_init();
trace_error(watcher_init());
return 0;
}
static void __exit keipm_exit(void)
{
printk(KERN_INFO kEIPM "%s\n", __func__);
watcher_uninit();
}
module_init(keipm_init);
module_exit(keipm_exit);
static void trace_error(keipm_err_t err)
{
if(err.errn != kEIPM_OK) {
printk(KERN_ERR kEIPM "%s", err.reason);
}
}