Compare commits

...

2 Commits
nightly ... smh

Author SHA1 Message Date
June
2d17a45ebb smh 2024-12-26 15:34:39 +09:00
June
aca81321bf smh 2024-12-26 15:33:48 +09:00
5 changed files with 53 additions and 0 deletions

View File

@@ -590,6 +590,8 @@
B3C3960F284F53E900DA9E2F /* AltBackup.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AltBackup.xcconfig; sourceTree = "<group>"; };
B3EE16B52925E27D00B3B1F5 /* AnisetteManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnisetteManager.swift; sourceTree = "<group>"; };
BD4513AA2C6FA98C0052BCC0 /* AppExtensionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppExtensionView.swift; sourceTree = "<group>"; };
BD7FFE492D1D2B7F00A9623D /* ptrace.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ptrace.m; sourceTree = "<group>"; };
BD7FFE4A2D1D2B8F00A9623D /* ptrace.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ptrace.h; sourceTree = "<group>"; };
BF02419522F2199300129732 /* RefreshAttemptsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RefreshAttemptsViewController.swift; sourceTree = "<group>"; };
BF08858222DE795100DE9F1E /* MyAppsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyAppsViewController.swift; sourceTree = "<group>"; };
BF08858422DE7EC800DE9F1E /* UpdateCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpdateCollectionViewCell.swift; sourceTree = "<group>"; };
@@ -1307,6 +1309,7 @@
BF66EE7F2501AE50007EE018 /* AltStoreCore */ = {
isa = PBXGroup;
children = (
BD7FFE492D1D2B7F00A9623D /* ptrace.m */,
BF66EE802501AE50007EE018 /* AltStoreCore.h */,
BF66EE8A2501AEB1007EE018 /* Components */,
BF66EEE32501AED0007EE018 /* Extensions */,
@@ -1317,6 +1320,7 @@
BF66EE8D2501AEBC007EE018 /* Types */,
BF66EE812501AE50007EE018 /* Info.plist */,
BFCB9205250AB1FF0057B44E /* Resources */,
BD7FFE4A2D1D2B8F00A9623D /* ptrace.h */,
);
path = AltStoreCore;
sourceTree = "<group>";

View File

@@ -233,6 +233,13 @@ private extension AppDelegate
return true
case "jit":
let queryItems = components.queryItems?.reduce(into: [String: String]()) { $0[$1.name.lowercased()] = $1.value } ?? [:]
guard let pidstr = queryItems["pid"], let pid = Int32(pidstr) else { return false }
return ptrace(14, pid, nil, 0) == 0
default: return false
}
}

View File

@@ -26,3 +26,4 @@ FOUNDATION_EXPORT const unsigned char AltStoreCoreVersionString[];
#import <AltStoreCore/ALTWrappedError.h>
#import <AltStoreCore/NSError+ALTServerError.h>
#import <AltStoreCore/CFNotificationName+AltStore.h>
#import "ptrace.h"

14
AltStoreCore/ptrace.h Normal file
View File

@@ -0,0 +1,14 @@
//
// ptrace.h
// AltStore
//
// Created by June P on 12/26/24.
// Copyright © 2024 SideStore. All rights reserved.
//
#ifndef ptrace_h
#define ptrace_h
int ptrace(int request, pid_t pid, caddr_t addr, int data);
#endif /* ptrace_h */

27
AltStoreCore/ptrace.m Normal file
View File

@@ -0,0 +1,27 @@
//
// ptrace.m
// AltStore
//
// Created by June P on 12/26/24.
// Copyright © 2024 SideStore. All rights reserved.
//
int ptrace(int request, pid_t pid, caddr_t addr, int data) {
int result = 0;
__asm__ (
"MOV x16, #26 \n" // Syscall number for ptrace
"MOV x0, %[request] \n" // Pass request to x0
"MOV x1, %[pid] \n" // Pass pid to x1
"MOV x2, %[addr] \n" // Pass addr to x2
"MOV x3, %[data] \n" // Pass data to x3
"SVC 0 \n" // Make the syscall (0 for ARM64)
: [result] "=r" (result) // No output
: [request] "r" (request), // Input constraints
[pid] "r" (pid),
[addr] "r" (addr),
[data] "r" (data)
: "x0", "x1", "x2", "x3", "x16" // Clobber list
);
return result;
}