]> git.cameronkatri.com Git - apple_cmds.git/commitdiff
adv_cmds: Update to 176.100.1
authorCameron Katri <me@cameronkatri.com>
Thu, 20 May 2021 20:21:11 +0000 (16:21 -0400)
committerCameron Katri <me@cameronkatri.com>
Thu, 20 May 2021 20:21:11 +0000 (16:21 -0400)
adv_cmds/.apple_version
adv_cmds/ps/entitlements.plist
adv_cmds/ps/tasks.c

index 1057e9a27306e3e5567c601c522f00dc5ed6698e..054f7a2e543219d78f200360a4922511d03f1ccb 100644 (file)
@@ -1 +1 @@
-176
+176.100.1
index eaaf1dedb53e913a2f9005f0afdb339aab7ed7a2..cdf0e9eaa532973fa2dd28ccd1061aacb9fe8c30 100644 (file)
@@ -2,9 +2,7 @@
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
-       <key>com.apple.system-task-ports</key>
-       <true/>
-       <key>task_for_pid-allow</key>
+       <key>com.apple.system-task-ports.read</key>
        <true/>
 </dict>
 </plist>
index 4548b5615f62c99b81275bdec59be7baab08e847..d2fcb07b422cfbb12718f048856e0575eb0237d0 100644 (file)
@@ -1,3 +1,4 @@
+#include <System/sys/proc.h>
 #include <sys/param.h>
 #include <sys/user.h>
 #include <sys/time.h>
@@ -22,8 +23,9 @@
 
 #include "ps.h"
 #include <mach/shared_memory_server.h>
+#include <mach/mach_vm.h>
 
-extern kern_return_t task_for_pid(task_port_t task, pid_t pid, task_port_t *target);
+extern kern_return_t task_read_for_pid(task_port_t task, pid_t pid, task_port_t *target);
 
 #define STATE_MAX       7 
                 
@@ -96,7 +98,11 @@ int get_task_info (KINFO *ki)
        ki->state = STATE_MAX;
 
        pid = KI_PROC(ki)->p_pid;
-       if (task_for_pid(mach_task_self(), pid, &ki->task) != KERN_SUCCESS) {
+    error = task_read_for_pid(mach_task_self(), pid, &ki->task);
+       if (error != KERN_SUCCESS) {
+#ifdef DEBUG
+        mach_error("Error calling task_read_for_pid()", error);
+#endif
                 return(1);
        }
        info_count = TASK_BASIC_INFO_COUNT;
@@ -110,8 +116,8 @@ int get_task_info (KINFO *ki)
        }
        {
                vm_region_basic_info_data_64_t    b_info;
-               vm_address_t                      address = GLOBAL_SHARED_TEXT_SEGMENT;
-               vm_size_t                         size;
+               mach_vm_address_t                 address = GLOBAL_SHARED_TEXT_SEGMENT;
+               mach_vm_size_t                    size;
                mach_port_t                       object_name;
 
                /*
@@ -120,7 +126,7 @@ int get_task_info (KINFO *ki)
                 * the 2 segments that are used for split libraries
                 */
                info_count = VM_REGION_BASIC_INFO_COUNT_64;
-               error = vm_region_64(ki->task, &address, &size, VM_REGION_BASIC_INFO,
+               error = mach_vm_region(ki->task, &address, &size, VM_REGION_BASIC_INFO,
                                     (vm_region_info_t)&b_info, &info_count, &object_name);
                if (error == KERN_SUCCESS) {
                        if (b_info.reserved && size == (SHARED_TEXT_REGION_SIZE) &&