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: 优化代码结构 · VVeakee/SKRoot-linuxKernelRoot@62c7f56

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • patch_kernel_root
    • analyze
      • symbol_analyze.cpp
      • symbol_analyze.h
    • patch_avc_denied.cpp
    • patch_avc_denied.h
    • patch_base.cpp
    • patch_base.h
    • patch_do_execve.cpp
    • patch_do_execve.h
    • patch_filldir64.cpp
    • patch_filldir64.h
    • patch_freeze_task.cpp
    • patch_freeze_task.h
    • patch_kernel_root.cpp
    • patch_kernel_root.vcxproj.filters
    • patch_kernel_root.vcxproj.user
    • patch_kernel_root.vcxproj
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎…h_kernel_root/analyze/analyze_kernel.cpp‎ ‎…h_kernel_root/analyze/symbol_analyze.cpp‎patch_kernel_root/analyze/analyze_kernel.cpp renamed to patch_kernel_root/analyze/symbol_analyze.cpp patch_kernel_root/analyze/analyze_kernel.cpp renamed to patch_kernel_root/analyze/symbol_analyze.cpp

Copy file name to clipboardExpand all lines: patch_kernel_root/analyze/symbol_analyze.cpp
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
#include "analyze_kernel.h"
1+
#include "symbol_analyze.h"
22

3-
AnalyzeKernel::AnalyzeKernel(const std::vector<char>& file_buf) : m_file_buf(file_buf), m_kernel_sym_parser(file_buf)
3+
SymbolAnalyze::SymbolAnalyze(const std::vector<char>& file_buf) : m_file_buf(file_buf), m_kernel_sym_parser(file_buf)
44
{
55
}
66

7-
AnalyzeKernel::~AnalyzeKernel()
7+
SymbolAnalyze::~SymbolAnalyze()
88
{
99
}
1010

11-
bool AnalyzeKernel::analyze_kernel_symbol() {
11+
bool SymbolAnalyze::analyze_kernel_symbol() {
1212
if (!m_kernel_sym_parser.init_kallsyms_lookup_name()) {
1313
std::cout << "Failed to initialize kallsyms lookup name" << std::endl;
1414
return false;
@@ -20,15 +20,15 @@ bool AnalyzeKernel::analyze_kernel_symbol() {
2020
return true;
2121
}
2222

23-
KernelSymbolOffset AnalyzeKernel::get_symbol_offset() {
23+
KernelSymbolOffset SymbolAnalyze::get_symbol_offset() {
2424
return m_kernel_sym_offset;
2525
}
2626

27-
bool AnalyzeKernel::is_kernel_version_less(const std::string& ver) const {
27+
bool SymbolAnalyze::is_kernel_version_less(const std::string& ver) const {
2828
return m_kernel_sym_parser.is_kernel_version_less(ver);
2929
}
3030

31-
bool AnalyzeKernel::find_symbol_offset() {
31+
bool SymbolAnalyze::find_symbol_offset() {
3232
m_kernel_sym_offset._text = m_kernel_sym_parser.kallsyms_lookup_name("_text");
3333
m_kernel_sym_offset._stext = m_kernel_sym_parser.kallsyms_lookup_name("_stext");
3434

Collapse file

‎…tch_kernel_root/analyze/analyze_kernel.h‎ ‎…tch_kernel_root/analyze/symbol_analyze.h‎patch_kernel_root/analyze/analyze_kernel.h renamed to patch_kernel_root/analyze/symbol_analyze.h patch_kernel_root/analyze/analyze_kernel.h renamed to patch_kernel_root/analyze/symbol_analyze.h

Copy file name to clipboardExpand all lines: patch_kernel_root/analyze/symbol_analyze.h
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ struct KernelSymbolOffset {
3333
size_t report_cfi_failure = 0;
3434
};
3535

36-
class AnalyzeKernel
36+
class SymbolAnalyze
3737
{
3838
public:
39-
AnalyzeKernel(const std::vector<char> & file_buf);
40-
~AnalyzeKernel();
39+
SymbolAnalyze(const std::vector<char> & file_buf);
40+
~SymbolAnalyze();
4141

4242
public:
4343
bool analyze_kernel_symbol();
Collapse file

‎patch_kernel_root/patch_avc_denied.cpp‎

Copy file name to clipboardExpand all lines: patch_kernel_root/patch_avc_denied.cpp
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "patch_avc_denied.h"
22
#include "analyze/ARM_asm.h"
33
PatchAvcDenied::PatchAvcDenied(const std::vector<char>& file_buf, const KernelSymbolOffset& sym,
4-
const AnalyzeKernel& analyze_kernel) : PatchBase(file_buf, sym, analyze_kernel) {
4+
const SymbolAnalyze& symbol_analyze) : PatchBase(file_buf, sym, symbol_analyze) {
55

66
}
77

Collapse file

‎patch_kernel_root/patch_avc_denied.h‎

Copy file name to clipboardExpand all lines: patch_kernel_root/patch_avc_denied.h
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class PatchAvcDenied : public PatchBase
66
{
77
public:
88
PatchAvcDenied(const std::vector<char>& file_buf, const KernelSymbolOffset& sym,
9-
const AnalyzeKernel& analyze_kernel);
9+
const SymbolAnalyze& symbol_analyze);
1010
~PatchAvcDenied();
1111

1212
size_t patch_avc_denied(size_t hook_func_start_addr, const std::vector<size_t>& task_struct_offset_cred,
Collapse file

‎patch_kernel_root/patch_base.cpp‎

Copy file name to clipboardExpand all lines: patch_kernel_root/patch_base.cpp
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "patch_base.h"
22
#include "analyze/ARM_asm.h"
33
PatchBase::PatchBase(const std::vector<char>& file_buf, const KernelSymbolOffset& sym,
4-
const AnalyzeKernel& analyze_kernel) : m_file_buf(file_buf), m_sym(sym), m_analyze_kernel(analyze_kernel) {
4+
const SymbolAnalyze& symbol_analyze) : m_file_buf(file_buf), m_sym(sym), m_symbol_analyze(symbol_analyze) {
55

66
}
77

@@ -11,7 +11,7 @@ PatchBase::~PatchBase()
1111

1212
int PatchBase::get_cred_atomic_usage_len() {
1313
int len = 8;
14-
if (m_analyze_kernel.is_kernel_version_less("6.6.0")) {
14+
if (m_symbol_analyze.is_kernel_version_less("6.6.0")) {
1515
len = 4;
1616
}
1717
return len;
@@ -26,10 +26,10 @@ int PatchBase::get_cred_securebits_padding() {
2626

2727
std::string PatchBase::get_cap_ability_max() {
2828
std::string cap;
29-
if (m_analyze_kernel.is_kernel_version_less("5.8.0")) {
29+
if (m_symbol_analyze.is_kernel_version_less("5.8.0")) {
3030
cap = "0x3FFFFFFFFF";
3131
}
32-
else if (m_analyze_kernel.is_kernel_version_less("5.9.0")) {
32+
else if (m_symbol_analyze.is_kernel_version_less("5.9.0")) {
3333
cap = "0xFFFFFFFFFF";
3434
}
3535
else {
@@ -40,7 +40,7 @@ std::string PatchBase::get_cap_ability_max() {
4040

4141
int PatchBase::get_cap_cnt() {
4242
int cnt = 0;
43-
if (m_analyze_kernel.is_kernel_version_less("4.3.0")) {
43+
if (m_symbol_analyze.is_kernel_version_less("4.3.0")) {
4444
cnt = 4;
4545
} else {
4646
cnt = 5;
Collapse file

‎patch_kernel_root/patch_base.h‎

Copy file name to clipboardExpand all lines: patch_kernel_root/patch_base.h
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
#include <iostream>
33
#include <vector>
44
#include "patch_kernel_root.h"
5-
#include "analyze/analyze_kernel.h"
5+
#include "analyze/symbol_analyze.h"
66
class PatchBase
77
{
88
public:
99
PatchBase(const std::vector<char>& file_buf, const KernelSymbolOffset& sym,
10-
const AnalyzeKernel& analyze_kernel);
10+
const SymbolAnalyze& symbol_analyze);
1111
~PatchBase();
1212
protected:
1313
int get_cred_atomic_usage_len();
@@ -16,5 +16,5 @@ class PatchBase
1616
int get_cap_cnt();
1717
const std::vector<char>& m_file_buf;
1818
const KernelSymbolOffset& m_sym;
19-
const AnalyzeKernel& m_analyze_kernel;
19+
const SymbolAnalyze& m_symbol_analyze;
2020
};
Collapse file

‎patch_kernel_root/patch_do_execve.cpp‎

Copy file name to clipboardExpand all lines: patch_kernel_root/patch_do_execve.cpp
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
#include "patch_do_execve.h"
33
#include "analyze/ARM_asm.h"
44
PatchDoExecve::PatchDoExecve(const std::vector<char>& file_buf, const KernelSymbolOffset& sym,
5-
const AnalyzeKernel& analyze_kernel) : PatchBase(file_buf, sym, analyze_kernel) {
5+
const SymbolAnalyze& symbol_analyze) : PatchBase(file_buf, sym, symbol_analyze) {
66

77
}
88
PatchDoExecve::~PatchDoExecve() {}
99

1010
std::pair<size_t, size_t> PatchDoExecve::get_do_execve_param() {
1111
size_t do_execve_addr = 0;
1212
size_t do_execve_key_reg;
13-
if (m_analyze_kernel.is_kernel_version_less("3.19.0")) {
13+
if (m_symbol_analyze.is_kernel_version_less("3.19.0")) {
1414
do_execve_addr = m_sym.do_execve_common;
1515
do_execve_key_reg = 0;
1616
}
17-
else if (m_analyze_kernel.is_kernel_version_less("4.18.0")) {
17+
else if (m_symbol_analyze.is_kernel_version_less("4.18.0")) {
1818
do_execve_addr = m_sym.do_execveat_common;
1919
do_execve_key_reg = 1;
2020
}
21-
else if (m_analyze_kernel.is_kernel_version_less("5.9.0")) {
21+
else if (m_symbol_analyze.is_kernel_version_less("5.9.0")) {
2222
do_execve_addr = m_sym.__do_execve_file;
2323
do_execve_key_reg = 1;
2424
}
Collapse file

‎patch_kernel_root/patch_do_execve.h‎

Copy file name to clipboardExpand all lines: patch_kernel_root/patch_do_execve.h
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class PatchDoExecve : public PatchBase
66
{
77
public:
88
PatchDoExecve(const std::vector<char>& file_buf, const KernelSymbolOffset& sym,
9-
const AnalyzeKernel& analyze_kernel);
9+
const SymbolAnalyze& symbol_analyze);
1010
~PatchDoExecve();
1111

1212
size_t patch_do_execve(const std::string& str_root_key, size_t hook_func_start_addr,
Collapse file

‎patch_kernel_root/patch_filldir64.cpp‎

Copy file name to clipboardExpand all lines: patch_kernel_root/patch_filldir64.cpp
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "patch_filldir64.h"
22
#include "analyze/ARM_asm.h"
33
PatchFilldir64::PatchFilldir64(const std::vector<char>& file_buf, const KernelSymbolOffset& sym,
4-
const AnalyzeKernel& analyze_kernel) : PatchBase(file_buf, sym, analyze_kernel) {
4+
const SymbolAnalyze& symbol_analyze) : PatchBase(file_buf, sym, symbol_analyze) {
55

66
}
77

Collapse file

‎patch_kernel_root/patch_filldir64.h‎

Copy file name to clipboardExpand all lines: patch_kernel_root/patch_filldir64.h
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class PatchFilldir64 : public PatchBase
66
{
77
public:
88
PatchFilldir64(const std::vector<char>& file_buf, const KernelSymbolOffset& sym,
9-
const AnalyzeKernel& analyze_kernel);
9+
const SymbolAnalyze& symbol_analyze);
1010
~PatchFilldir64();
1111

1212
size_t patch_filldir64(size_t root_key_addr_offset, size_t hook_func_start_addr, std::vector<patch_bytes_data>& vec_out_patch_bytes_data);

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.