Linux host2.homegym.sg 4.18.0-553.8.1.el8_10.x86_64 #1 SMP Tue Jul 2 07:26:33 EDT 2024 x86_64
Apache
Server IP : 159.223.38.192 & Your IP : 159.223.38.192
Domains : 20 Domain
User : eachadea
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Lock Shell
Lock File++
Readme
/
usr /
src /
file_protector-1.1-1583 /
Delete
Unzip
Name
Size
Permission
Date
Action
common
[ DIR ]
drwxr-xr-x
2025-10-28 18:03
ftrace_hooks
[ DIR ]
drwxr-xr-x
2025-10-28 18:03
lsm_hooks
[ DIR ]
drwxr-xr-x
2025-10-28 18:03
syscall_hooks
[ DIR ]
drwxr-xr-x
2025-10-28 18:03
transport
[ DIR ]
drwxr-xr-x
2025-10-28 18:03
Kbuild
10.29
KB
-rw-r--r--
2025-10-28 18:03
Makefile
2.23
KB
-rw-r--r--
2025-10-28 18:03
compat.c
8.42
KB
-rw-r--r--
2025-10-28 18:03
compat.h
11.98
KB
-rw-r--r--
2025-10-28 18:03
debug.h
3.56
KB
-rw-r--r--
2025-10-28 18:03
dkms.conf
146
B
-rw-r--r--
2025-10-28 18:03
file_contexts.c
60.43
KB
-rw-r--r--
2025-10-28 18:03
file_contexts.h
6.21
KB
-rw-r--r--
2025-10-28 18:03
file_contexts_priv.h
5.48
KB
-rw-r--r--
2025-10-28 18:03
file_handle_tools.h
2.53
KB
-rw-r--r--
2025-10-28 18:03
file_key_tools.h
950
B
-rw-r--r--
2025-10-28 18:03
file_path_tools.h
2.09
KB
-rw-r--r--
2025-10-28 18:03
hashtable_compat.h
2.73
KB
-rw-r--r--
2025-10-28 18:03
hook_trampoline_common.h
4.29
KB
-rw-r--r--
2025-10-28 18:03
interval_tree.h
779
B
-rw-r--r--
2025-10-28 18:03
memory.c
3.31
KB
-rw-r--r--
2025-10-28 18:03
memory.h
2.99
KB
-rw-r--r--
2025-10-28 18:03
module.c
2.67
KB
-rw-r--r--
2025-10-28 18:03
module_ref.h
421
B
-rw-r--r--
2025-10-28 18:03
module_rundown_protection.c
3.64
KB
-rw-r--r--
2025-10-28 18:03
module_rundown_protection.h
743
B
-rw-r--r--
2025-10-28 18:03
path_tools.h
6.06
KB
-rw-r--r--
2025-10-28 18:03
rundown_protection.c
4.2
KB
-rw-r--r--
2025-10-28 18:03
rundown_protection.h
2.83
KB
-rw-r--r--
2025-10-28 18:03
safe_kobject.h
1.28
KB
-rw-r--r--
2025-10-28 18:03
si_common.h
4.3
KB
-rw-r--r--
2025-10-28 18:03
si_fp_properties.h
858
B
-rw-r--r--
2025-10-28 18:03
si_fp_properties_x.h
18.53
KB
-rw-r--r--
2025-10-28 18:03
si_fp_value_types.h
515
B
-rw-r--r--
2025-10-28 18:03
si_fp_value_types_x.h
1.25
KB
-rw-r--r--
2025-10-28 18:03
si_size.h
4.26
KB
-rw-r--r--
2025-10-28 18:03
si_templates.h
2.99
KB
-rw-r--r--
2025-10-28 18:03
si_writer.h
7.52
KB
-rw-r--r--
2025-10-28 18:03
si_writer_common.h
14.63
KB
-rw-r--r--
2025-10-28 18:03
stringify.h
261
B
-rw-r--r--
2025-10-28 18:03
task_info_map.c
17.1
KB
-rw-r--r--
2025-10-28 18:03
task_info_map.h
6.33
KB
-rw-r--r--
2025-10-28 18:03
task_tools.h
1.34
KB
-rw-r--r--
2025-10-28 18:03
tracepoints.c
3.58
KB
-rw-r--r--
2025-10-28 18:03
tracepoints.h
299
B
-rw-r--r--
2025-10-28 18:03
write_protection.h
2.2
KB
-rw-r--r--
2025-10-28 18:03
Save
Rename
/** @file write_protection.h @brief Disable/Enable write protection @details Copyright (c) 2024 Acronis International GmbH @author Denis Kopyrin (Denis.Kopyrin@acronis.com) @since $Id: $ */ #pragma once #include "compat.h" #ifndef X86_CR4_CET # define X86_CR4_CET (1UL << 23) #endif #ifndef __FORCE_ORDER # define __FORCE_ORDER "m"(*(unsigned int *)0x1000UL) #endif static inline unsigned long fp_read_cr4(void) { #ifndef KERNEL_MOCK // cr4 is protected register in userspace unsigned long val; asm volatile("mov %%cr4, %0\n" : "=r" (val) : __FORCE_ORDER); return val; #else return gCR4; #endif } static inline void fp_write_cr4(unsigned long val) { #ifndef KERNEL_MOCK // cr0 is protected register in userspace asm volatile("mov %0, %%cr4\n": "+r" (val) : : "memory"); #else gCR4 = val; #endif } // On 5.3.0 using the legal 'write_cp0' causes panic because WP is not disabled. // So let's just use out own 'write_cp0' that avoid silly checks. static inline void wp_cr0(unsigned long cr0) { #ifndef KERNEL_MOCK // cr0 is protected register in userspace __asm__ __volatile__ ("mov %0, %%cr0": "+r"(cr0)); #else gCR0 = cr0; #endif } typedef struct { unsigned long saved_cr0; unsigned long written_cr0; unsigned long saved_cr4; unsigned long written_cr4; bool was_written_cr0; bool was_written_cr4; } cr0_write_protect_t; static inline cr0_write_protect_t disable_write_protect(void) { cr0_write_protect_t wp; wp.saved_cr0 = read_cr0(); wp.saved_cr4 = fp_read_cr4(); wp.written_cr0 = wp.saved_cr0; wp.written_cr4 = wp.saved_cr4; wp.was_written_cr0 = false; wp.was_written_cr4 = false; if (wp.saved_cr4 & X86_CR4_CET) { wp.was_written_cr4 = true; wp.written_cr4 &= ~X86_CR4_CET; fp_write_cr4(wp.written_cr4); } if (wp.saved_cr0 & X86_CR0_WP) { wp.was_written_cr0 = true; wp.written_cr0 &= ~X86_CR0_WP; wp_cr0(wp.written_cr0); } return wp; } static inline void restore_write_protect(cr0_write_protect_t wp) { if (wp.was_written_cr0) wp_cr0(wp.saved_cr0); if (wp.was_written_cr4) fp_write_cr4(wp.saved_cr4); } static inline void redisable_write_protect(cr0_write_protect_t wp) { if (wp.was_written_cr4) fp_write_cr4(wp.written_cr4); if (wp.was_written_cr0) wp_cr0(wp.written_cr0); }