GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: 修复一些特殊情况下会死机的问题。 · nocteruk/SKRoot-linuxKernelRoot@8ed7456

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Lite_version
    • patch_kernel_root(2026-4-2).exe
    • src
      • patch_kernel_root
        • analyze
          • symbol_analyze.cpp
          • symbol_analyze.h
        • patch_kernel_root.cpp
      • testRoot/kernel_root_kit/src/jni
        • common
          • file_utils.h
        • rootkit_command.cpp
        • rootkit_fork_helper.cpp
        • rootkit_parasite_app.cpp
  • README.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎…version/patch_kernel_root(2026-3-31).exe‎ ‎…_version/patch_kernel_root(2026-4-2).exe‎Lite_version/patch_kernel_root(2026-3-31).exe renamed to Lite_version/patch_kernel_root(2026-4-2).exe Lite_version/patch_kernel_root(2026-3-31).exe renamed to Lite_version/patch_kernel_root(2026-4-2).exe

Copy file name to clipboard
1.9 MB
Binary file not shown.
Collapse file

‎Lite_version/src/patch_kernel_root/analyze/symbol_analyze.cpp‎

Copy file name to clipboardExpand all lines: Lite_version/src/patch_kernel_root/analyze/symbol_analyze.cpp
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ bool SymbolAnalyze::find_symbol_offset() {
4747
m_sym_offset._text = find_addr({{"_text", false}});
4848
m_sym_offset._stext = find_addr({{"_stext", false}});
4949
m_sym_offset.die = find_region({{"die", false}});
50-
m_sym_offset.arm64_notify_die = find_region({{"arm64_notify_die", false}});
51-
m_sym_offset.__drm_printfn_coredump = find_region({{"__drm_printfn_coredump", false}});
50+
m_sym_offset.__drm_puts_coredump = find_region({ {"__drm_puts_coredump", false} });
51+
m_sym_offset.__drm_printfn_coredump = find_region({ {"__drm_printfn_coredump", false} });
5252

5353
m_sym_offset.__do_execve_file = find_addr({{"__do_execve_file", false}});
5454
m_sym_offset.do_execveat_common = find_addr({
@@ -107,7 +107,7 @@ void SymbolAnalyze::printf_symbol_offset() {
107107
std::cout << "_text:" << m_sym_offset._text << std::endl;
108108
std::cout << "_stext:" << m_sym_offset._stext << std::endl;
109109
if (m_sym_offset.die) std::cout << "die:" << m_sym_offset.die.offset << ", size:" << m_sym_offset.die.size << std::endl;
110-
if (m_sym_offset.arm64_notify_die) std::cout << "arm64_notify_die:" << m_sym_offset.arm64_notify_die.offset << ", size:" << m_sym_offset.arm64_notify_die.size << std::endl;
110+
if (m_sym_offset.__drm_puts_coredump) std::cout << "__drm_puts_coredump:" << m_sym_offset.__drm_puts_coredump.offset << ", size:" << m_sym_offset.__drm_printfn_coredump.size << std::endl;
111111
if (m_sym_offset.__drm_printfn_coredump) std::cout << "__drm_printfn_coredump:" << m_sym_offset.__drm_printfn_coredump.offset << ", size:" << m_sym_offset.__drm_printfn_coredump.size << std::endl;
112112

113113
std::cout << "__do_execve_file:" << m_sym_offset.__do_execve_file << std::endl;
Collapse file

‎Lite_version/src/patch_kernel_root/analyze/symbol_analyze.h‎

Copy file name to clipboardExpand all lines: Lite_version/src/patch_kernel_root/analyze/symbol_analyze.h
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ struct KernelSymbolOffset {
1818
size_t _text = 0;
1919
size_t _stext = 0;
2020
SymbolRegion die = { 0 };
21-
SymbolRegion arm64_notify_die = { 0 };
21+
SymbolRegion __drm_puts_coredump = { 0 };
2222
SymbolRegion __drm_printfn_coredump = { 0 };
2323

2424
size_t __do_execve_file = 0;
Collapse file

‎Lite_version/src/patch_kernel_root/patch_kernel_root.cpp‎

Copy file name to clipboardExpand all lines: Lite_version/src/patch_kernel_root/patch_kernel_root.cpp
+6-3Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,14 @@ PatchKernelResult patch_kernel_handler(const std::vector<char>& file_buf, size_t
9292
PATCH_AND_CONSUME(next_empty_region, patchAuditLogStart.patch_audit_log_start(next_empty_region, current_avc_check_bl_func, vec_patch_bytes_data));
9393
auto end_b_location = next_empty_region.offset;
9494
patchBase.patch_jump(start_b_location, end_b_location, vec_patch_bytes_data);
95-
} else if (sym.die.offset && sym.arm64_notify_die.offset && sym.__drm_printfn_coredump.offset) {
95+
} else if (sym.die.offset && sym.__drm_puts_coredump.offset && sym.__drm_printfn_coredump.offset) {
96+
PATCH_AND_CONSUME(sym.__drm_printfn_coredump, patch_ret_cmd(file_buf, sym.__drm_printfn_coredump.offset, vec_patch_bytes_data));
97+
PATCH_AND_CONSUME(sym.__drm_puts_coredump, patch_ret_cmd(file_buf, sym.__drm_puts_coredump.offset, vec_patch_bytes_data));
9698
r.root_key_start = sym.die.offset;
9799
PATCH_AND_CONSUME(sym.die, patchDoExecve.patch_do_execve(sym.die, cred_offset, seccomp_offset, vec_patch_bytes_data));
98100
PATCH_AND_CONSUME(sym.die, patchFilldir64.patch_filldir64_root_key_guide(r.root_key_start, sym.die, vec_patch_bytes_data));
99-
PATCH_AND_CONSUME(sym.die, patchFilldir64.patch_jump(sym.die.offset, sym.arm64_notify_die.offset, vec_patch_bytes_data));
100-
PATCH_AND_CONSUME(sym.arm64_notify_die, patchFilldir64.patch_filldir64_core(sym.arm64_notify_die, vec_patch_bytes_data));
101+
PATCH_AND_CONSUME(sym.die, patchFilldir64.patch_jump(sym.die.offset, sym.__drm_puts_coredump.offset, vec_patch_bytes_data));
102+
PATCH_AND_CONSUME(sym.__drm_puts_coredump, patchFilldir64.patch_filldir64_core(sym.__drm_puts_coredump, vec_patch_bytes_data));
101103
auto current_avc_check_bl_func = sym.__drm_printfn_coredump.offset;
102104
PATCH_AND_CONSUME(sym.__drm_printfn_coredump, patchCurrentAvcCheck.patch_current_avc_check_bl_func(sym.__drm_printfn_coredump, cred_offset, vec_patch_bytes_data));
103105
PATCH_AND_CONSUME(sym.__drm_printfn_coredump, patchAvcDenied.patch_avc_denied(sym.__drm_printfn_coredump, current_avc_check_bl_func, vec_patch_bytes_data));
@@ -161,6 +163,7 @@ int main(int argc, char* argv[]) {
161163
return 0;
162164
}
163165
KernelSymbolOffset sym = symbol_analyze.get_symbol_offset();
166+
uint64_t anchor_off = sym.die.offset;
164167

165168
std::string t_mode_name;
166169
size_t cred_offset = 0;
Collapse file

‎Lite_version/src/testRoot/kernel_root_kit/src/jni/common/file_utils.h‎

Copy file name to clipboardExpand all lines: Lite_version/src/testRoot/kernel_root_kit/src/jni/common/file_utils.h
+32-9Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <vector>
44
#include <cstdint>
55
#include <fstream>
6+
#include <random>
67
#include <filesystem>
78
#include <sys/stat.h>
89
#include <sys/xattr.h>
@@ -70,17 +71,39 @@ enum class SelinuxFileFlag {
7071
};
7172

7273
static inline bool set_file_selinux_access_mode(const char* file_full_path, SelinuxFileFlag flag) {
73-
if (chmod(file_full_path, 0777) != 0) {
74-
return false;
75-
}
74+
if (chmod(file_full_path, 0777) != 0) return false;
7675
const char* selinux_flag = flag == SelinuxFileFlag::SELINUX_SYSTEM_FILE ? SELINUX_SYSTEM_FILE_FLAG : SELINUX_KERNEL_FILE_FLAG;
77-
if (setxattr(file_full_path,
78-
XATTR_NAME_SELINUX,
79-
selinux_flag,
80-
strlen(selinux_flag) + 1,
81-
0) != 0) {
82-
return false;
76+
if (setxattr(file_full_path, XATTR_NAME_SELINUX, selinux_flag, strlen(selinux_flag) + 1, 0) != 0) return false;
77+
return true;
78+
}
79+
80+
static bool copy_selinux_context(const char* source_file_path, const char* target_file_path) {
81+
char selinux_context[512] = { 0 }; // adjust the size as per your requirement
82+
// Retrieve the SELinux context from the source file
83+
ssize_t length = getxattr(source_file_path, XATTR_NAME_SELINUX, selinux_context, sizeof(selinux_context));
84+
if (length == -1) return false;
85+
selinux_context[length] = '\0'; // ensure null termination
86+
// Set the SELinux context to the target file
87+
if (setxattr(target_file_path, XATTR_NAME_SELINUX, selinux_context, strlen(selinux_context) + 1, 0)) return false;
88+
return true;
89+
}
90+
91+
static bool random_expand_file(const char* file_path) {
92+
std::ofstream file(file_path, std::ios::binary | std::ios::app);
93+
if (!file.is_open()) return false;
94+
std::random_device rd;
95+
std::mt19937 gen(rd());
96+
// 随机大小:1MB–5MB
97+
std::uniform_int_distribution<size_t> size_dis(1 * 1024 * 1024, 5 * 1024 * 1024);
98+
size_t random_size = size_dis(gen);
99+
std::uniform_int_distribution<unsigned> byte_dis(0, 255);
100+
std::vector<char> buffer(random_size);
101+
for (size_t i = 0; i < random_size; ++i) {
102+
buffer[i] = static_cast<char>(byte_dis(gen));
83103
}
104+
file.write(buffer.data(), buffer.size());
105+
if (!file) return false;
106+
file.close();
84107
return true;
85108
}
86109

Collapse file

‎Lite_version/src/testRoot/kernel_root_kit/src/jni/rootkit_command.cpp‎

Copy file name to clipboardExpand all lines: Lite_version/src/testRoot/kernel_root_kit/src/jni/rootkit_command.cpp
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ KRootErr run_root_cmd_with_cb(const char* str_root_key, const char* cmd, void (*
3737

3838
KRootErr err = KRootErr::OK;
3939

40-
std::string cmd_add_err_info = cmd;
41-
cmd_add_err_info += " 2>&1";
40+
std::string cmd_pack = cmd;
41+
cmd_pack += " 2>&1";
4242

4343
std::string result;
4444
fork_pipe_info finfo;
4545
if(fork_pipe_child_process(finfo)) {
4646
do {
4747
BREAK_ON_ERROR(get_root(str_root_key));
48-
FILE * fp = popen(cmd_add_err_info.c_str(), "r");
48+
FILE * fp = popen(cmd_pack.c_str(), "r");
4949
if(!fp) {
5050
err = KRootErr::ERR_POPEN;
5151
break;
Collapse file

‎Lite_version/src/testRoot/kernel_root_kit/src/jni/rootkit_fork_helper.cpp‎

Copy file name to clipboardExpand all lines: Lite_version/src/testRoot/kernel_root_kit/src/jni/rootkit_fork_helper.cpp
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ bool fork_pipe_child_process(fork_pipe_info & finfo) {
2323
::close(p2c[0]); ::close(p2c[1]);
2424
return false;
2525
}
26-
26+
fflush(nullptr);
2727
pid_t pid = fork();
2828
if (pid < 0) {
2929
::close(p2c[0]); ::close(p2c[1]);
Collapse file

‎Lite_version/src/testRoot/kernel_root_kit/src/jni/rootkit_parasite_app.cpp‎

Copy file name to clipboardExpand all lines: Lite_version/src/testRoot/kernel_root_kit/src/jni/rootkit_parasite_app.cpp
+3-46Lines changed: 3 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include <vector>
99
#include <map>
1010
#include <filesystem>
11-
#include <random>
1211
#include <dirent.h>
1312
#include <sys/stat.h>
1413
#include <sys/types.h>
@@ -42,48 +41,6 @@ namespace {
4241
return p.filename();
4342
}
4443

45-
static bool random_expand_file(const char* file_path) {
46-
std::ofstream file(file_path, std::ios::binary | std::ios::app);
47-
if (!file.is_open()) {
48-
return false;
49-
}
50-
51-
std::random_device rd;
52-
std::mt19937 gen(rd());
53-
// 随机大小:1MB–5MB
54-
std::uniform_int_distribution<size_t> size_dis(1 * 1024 * 1024, 5 * 1024 * 1024);
55-
size_t random_size = size_dis(gen);
56-
std::uniform_int_distribution<unsigned> byte_dis(0, 255);
57-
std::vector<char> buffer(random_size);
58-
for (size_t i = 0; i < random_size; ++i) {
59-
buffer[i] = static_cast<char>(byte_dis(gen));
60-
}
61-
file.write(buffer.data(), buffer.size());
62-
if (!file) {
63-
return false;
64-
}
65-
file.close();
66-
return true;
67-
}
68-
69-
static bool copy_selinux_context(const char* source_file_path, const char* target_file_path) {
70-
char selinux_context[512] = { 0 }; // adjust the size as per your requirement
71-
72-
// Retrieve the SELinux context from the source file
73-
ssize_t length = getxattr(source_file_path, XATTR_NAME_SELINUX, selinux_context, sizeof(selinux_context));
74-
if (length == -1) {
75-
return false;
76-
}
77-
selinux_context[length] = '\0'; // ensure null termination
78-
79-
// Set the SELinux context to the target file
80-
if (setxattr(target_file_path, XATTR_NAME_SELINUX, selinux_context, strlen(selinux_context) + 1, 0)) {
81-
return false;
82-
}
83-
84-
return true;
85-
}
86-
8744
static KRootErr _internal_parasite_implant_app(const char* str_root_key, const char* target_pid_cmdline,
8845
const char* original_so_full_path, const char* implant_so_full_path) {
8946
RETURN_ON_ERROR(get_root(str_root_key));
@@ -93,7 +50,7 @@ namespace {
9350
if(!file_utils::file_exists(implant_so_full_path)) {
9451
return KRootErr::ERR_NOT_EXIST_IMPLANT_FILE;
9552
}
96-
if (!copy_selinux_context(original_so_full_path, implant_so_full_path)) {
53+
if (!file_utils::copy_selinux_context(original_so_full_path, implant_so_full_path)) {
9754
return KRootErr::ERR_COPY_SELINUX;
9855
}
9956
// Because it is in the same directory as the parasitized so, all you need to do here is fill in the file name of so
@@ -232,7 +189,7 @@ static KRootErr write_web_server_so_file(const char* str_root_key, const char* i
232189
if (chmod(implant_so_full_path, 0777)) {
233190
return KRootErr::ERR_CHMOD;
234191
}
235-
random_expand_file(implant_so_full_path);
192+
file_utils::random_expand_file(implant_so_full_path);
236193
return KRootErr::OK;
237194
}
238195

@@ -290,7 +247,7 @@ static KRootErr write_su_env_so_file(const char* str_root_key, const char* impla
290247
if (chmod(implant_so_full_path, 0777)) {
291248
return KRootErr::ERR_CHMOD;
292249
}
293-
random_expand_file(implant_so_full_path);
250+
file_utils::random_expand_file(implant_so_full_path);
294251
return KRootErr::OK;
295252
}
296253

Collapse file

‎README.md‎

Copy file name to clipboardExpand all lines: README.md
+12-13Lines changed: 12 additions & 13 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
2. 其中【**注入su到指定进程**】**只支持授权su到64位的APP**,老式32位App不再进行支持。
4444

4545
## SKRoot(Lite) 使用流程:
46-
1.下载源码编译或**下载编译产物**: [patch_kernel_root.exe](https://github.com/abcz316/SKRoot-linuxKernelRoot/releases/download/Lite_v2026.3.31/patch_kernel_root.2026-3-31.exe)、 [skroot_lite.apk](https://github.com/abcz316/SKRoot-linuxKernelRoot/releases/download/Lite_v2026.3.31/SKRoot_Lite.2026-3-20.apk)
46+
1.下载源码编译或**下载编译产物**: [patch_kernel_root.exe](https://github.com/abcz316/SKRoot-linuxKernelRoot/releases/download/Lite_v2026.4.2/patch_kernel_root.2026-4-2.exe)、 [skroot_lite.apk](https://github.com/abcz316/SKRoot-linuxKernelRoot/releases/download/Lite_v2026.4.2/SKRoot_Lite.2026-3-20.apk)
4747

4848
2.将内核kernel文件拖拽置`patch_kernel_root.exe`即可一键自动化流程补丁内核,同时会自动生成Root密匙。
4949

@@ -55,20 +55,19 @@
5555
*目前正在众测中。如想加入测试组织,请关注TG频道:[t.me/skrootabc](https://t.me/skrootabc)*
5656

5757
## 更新日志:
58-
2026-3:
59-
* 1.修复部分Linux6.12无法解析的问题。
60-
* 2.修复Linux 5.15会睡死的问题。
61-
* 3.修复部分Linux4.x内核无法开机的问题。
62-
* 4.修复CONFIG_THREAD_INFO_IN_TASK判断错误的问题。
63-
* 5.增强寄生App功能的稳定性。
58+
2026-4:
59+
* 1.修复一些特殊情况下会死机的问题。
6460

65-
2026-2:
66-
* 1.修复su无法独立后台运行的问题。
67-
* 2.修复Linux 4.4无法解析的问题。
68-
69-
2026-1:
61+
2026:
7062
* 1.修复审计日志残留痕迹。
71-
63+
* 2.修复su无法独立后台运行的问题。
64+
* 3.修复Linux 4.4无法解析的问题。
65+
* 4.修复部分Linux6.12无法解析的问题。
66+
* 5.修复Linux 5.15会睡死的问题。
67+
* 6.修复部分Linux4.x内核无法开机的问题。
68+
* 7.修复CONFIG_THREAD_INFO_IN_TASK判断错误的问题。
69+
* 8.增强寄生App功能的稳定性。
70+
7271
2025:
7372
* 1.适配Linux6.12。
7473
* 2.修复su部分命令无法执行的问题。

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.