Skip to content

Commit

Permalink
unset envvars
Browse files Browse the repository at this point in the history
  • Loading branch information
jjolano committed Feb 19, 2023
1 parent 446ca1a commit 72454b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Shadow.dylib/dylib.x
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@ ShadowService* _srv = nil;
if([prefs_load[@"Hook_EnvVars"] boolValue]) {
NSLog(@"%@", @"+ envvars");

unsetenv("DYLD_INSERT_LIBRARIES");
unsetenv("_MSSafeMode");
unsetenv("_SafeMode");
unsetenv("_SubstituteSafeMode");
setenv("SHELL", "/bin/sh", 1);

shadowhook_libc_envvar(substitutor);
shadowhook_NSProcessInfo(substitutor);
}
Expand Down
1 change: 1 addition & 0 deletions Shadow.dylib/hooks/dyld.x
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ static kern_return_t replaced_task_info(task_name_t target_task, task_flavor_t f
struct task_dyld_info *task_info = (struct task_dyld_info *) task_info_out;
struct dyld_all_image_infos *dyld_info = (struct dyld_all_image_infos *) task_info->all_image_info_addr;
dyld_info->infoArrayCount = 1;
dyld_info->uuidArrayCount = 1;

// todo: improve this
}
Expand Down

0 comments on commit 72454b0

Please sign in to comment.