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: 细节修复 · sekaiacg/SKRoot-linuxKernelRoot@575a929

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • patch_kernel_root
    • ArmAsmHelper.h
    • patch_kernel_root.cpp
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎patch_kernel_root/ArmAsmHelper.h‎

Copy file name to clipboardExpand all lines: patch_kernel_root/ArmAsmHelper.h
+8-1Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <windows.h>
55
#include <fstream>
66
#include <sstream>
7+
#include <filesystem>
78

89
std::string AsmToBytes(const std::string& strArm64Asm) {
910
//获取汇编文本
@@ -14,6 +15,12 @@ std::string AsmToBytes(const std::string& strArm64Asm) {
1415
std::string strMyPath = szFileName;
1516
strMyPath = strMyPath.substr(0, strMyPath.find_last_of('\\') + 1);
1617

18+
std::string asmFilePath = strMyPath + "aarch64-linux-android-as.exe";
19+
if (!std::filesystem::exists(asmFilePath)) {
20+
std::cerr << "Error: aarch64-linux-android-as.exe not found. Please extract this file from the Android NDK." << std::endl;
21+
exit(EXIT_FAILURE);
22+
}
23+
1724
//写出input.txt
1825
std::ofstream inputFile;
1926
inputFile.open(strMyPath + "input.txt", std::ios_base::out | std::ios_base::trunc);
@@ -76,7 +83,7 @@ const char HEX[16] = {
7683
};
7784

7885
/* Convert byte array to hex string. */
79-
std::string bytesToHexString(const byte* input, size_t length) {
86+
std::string bytesToHexString(const unsigned char* input, size_t length) {
8087

8188
std::string str;
8289
str.reserve(length << 1);
Collapse file

‎patch_kernel_root/patch_kernel_root.cpp‎

Copy file name to clipboardExpand all lines: patch_kernel_root/patch_kernel_root.cpp
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ size_t path_do_execve(const char* file_buf, const string& str_root_key, size_t
6666

6767
size_t do_execve_entry_hook_jump_back_addr = do_execve_entry_addr + 4;
6868

69-
string str_show_root_key_mem_byte = bytesToHexString((const byte*)str_root_key.c_str(), str_root_key.length());
69+
string str_show_root_key_mem_byte = bytesToHexString((const unsigned char*)str_root_key.c_str(), str_root_key.length());
7070
cout << "#生成的ROOT密匙字节集:" << str_show_root_key_mem_byte.c_str() << endl << endl;
7171
vec_out_patch_bytes_data.push_back({ str_show_root_key_mem_byte, hook_func_start_addr });
7272

@@ -161,7 +161,7 @@ size_t path_do_execve(const char* file_buf, const string& str_root_key, size_t
161161
nHookFuncSize = strBytes.length() / 2;
162162
char hookOrigCmd[4] = { 0 };
163163
memcpy(&hookOrigCmd, (void*)((size_t)file_buf + do_execve_entry_addr), sizeof(hookOrigCmd));
164-
string strHookOrigCmd = bytesToHexString((const byte*)hookOrigCmd, sizeof(hookOrigCmd));
164+
string strHookOrigCmd = bytesToHexString((const unsigned char*)hookOrigCmd, sizeof(hookOrigCmd));
165165
strBytes = strHookOrigCmd + strBytes.substr(0x4 * 2);
166166
vec_out_patch_bytes_data.push_back({ strBytes, hook_func_start_addr });
167167
stringstream sstrAsm2;
@@ -212,7 +212,7 @@ size_t path_avc_denied(const char* file_buf, size_t hook_func_start_addr, size_t
212212
size_t nHookFuncSize = strBytes.length() / 2;
213213
char hookOrigCmd[4] = { 0 };
214214
memcpy(&hookOrigCmd, (void*)((size_t)file_buf + avc_denied_entry_addr), sizeof(hookOrigCmd));
215-
string strHookOrigCmd = bytesToHexString((const byte*)hookOrigCmd, sizeof(hookOrigCmd));
215+
string strHookOrigCmd = bytesToHexString((const unsigned char*)hookOrigCmd, sizeof(hookOrigCmd));
216216
strBytes = strBytes.substr(0, (0x6C) * 2) + strHookOrigCmd + strBytes.substr((0x6C + 4) * 2);
217217
vec_out_patch_bytes_data.push_back({ strBytes, hook_func_start_addr });
218218
stringstream sstrAsm2;

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.