Skip to content

Commit

Permalink
Add unrestrict_library_with_fd
Browse files Browse the repository at this point in the history
  • Loading branch information
pwn20wndstuff committed May 31, 2019
1 parent cda002c commit fa7d177
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
22 changes: 22 additions & 0 deletions Undecimus/source/KernelUtilities.c
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions Undecimus/source/KernelUtilities.h
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion patchfinder64

0 comments on commit fa7d177

Please sign in to comment.