mirror of
https://github.com/opa334/TrollStore.git
synced 2025-04-12 23:33:11 +08:00
Add safeguards to jithelper
This commit is contained in:
parent
5e96d9d7dc
commit
bbee70cd69
@ -15,10 +15,19 @@
|
|||||||
int ptrace(int _request, pid_t _pid, caddr_t _addr, int _data);
|
int ptrace(int _request, pid_t _pid, caddr_t _addr, int _data);
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main(int argc, const char* argv[]) {
|
||||||
RBSProcessPredicate *predicate = [RBSProcessPredicate predicateMatchingBundleIdentifier:@(argv[1])];
|
if (argc != 2)
|
||||||
RBSProcessHandle* process = [RBSProcessHandle handleForPredicate:predicate error:nil];
|
{
|
||||||
|
//NSLog(@"trollstorejithelper invoked with unexpected number of arguments");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int pid;
|
||||||
|
@autoreleasepool {
|
||||||
|
RBSProcessPredicate *predicate = [RBSProcessPredicate predicateMatchingBundleIdentifier:@(argv[1])];
|
||||||
|
RBSProcessHandle* process = [RBSProcessHandle handleForPredicate:predicate error:nil];
|
||||||
|
pid = process.rbs_pid;
|
||||||
|
}
|
||||||
|
|
||||||
int pid = process.rbs_pid;
|
|
||||||
if (!pid)
|
if (!pid)
|
||||||
{
|
{
|
||||||
return ESRCH;
|
return ESRCH;
|
||||||
|
Loading…
Reference in New Issue
Block a user