Add unrestrict_library_with_fd

This commit is contained in:
Pwn20wnd
2019-06-01 00:25:37 +03:00
parent cda002cc07
commit fa7d177a14
3 changed files with 25 additions and 1 deletions
+22
View File
@@ -2067,6 +2067,28 @@ out:;
return ret;
}
bool unrestrict_library(const char *path) {
bool ret = false;
_assert(path != NULL);
_assert(enable_mapping_for_library(path));
ret = true;
out:;
return ret;
}
bool unrestrict_library_with_fd(int fd) {
bool ret = false;
char *path = NULL;
_assert(fd > 0);
path = get_path_for_fd(fd);
_assert(path != NULL);
_assert(unrestrict_library(path));
ret = true;
out:;
SafeFreeNULL(path);
return ret;
}
bool revalidate_process(pid_t pid) {
bool ret = true;
kptr_t proc = KPTR_NULL;
+2
View File
@@ -168,6 +168,8 @@ bool set_kernel_task_info(void);
int issue_extension_for_mach_service(kptr_t sb, kptr_t ctx, const char *entry_name, void *desc);
bool unrestrict_process(pid_t pid);
bool unrestrict_process_with_task_port(task_t task_port);
bool unrestrict_library(const char *path);
bool unrestrict_library_with_fd(int fd);
bool revalidate_process(pid_t pid);
bool revalidate_process_with_task_port(task_t task_port);
bool enable_mapping_for_library(const char *lib);