Last active
June 14, 2024 08:33
-
-
Save hym3242/7b7431b2fe3c78ff6d967120f3ab1335 to your computer and use it in GitHub Desktop.
Create and switch WindowServer sessions with SkyLight private functions (no need for Fast User Switching, hooray!!!), compile with `cc xxx.c -g -o xxx -framework Carbon -undefined dynamic_lookup`.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int SLSCreateLoginSession(int *outSession); //courtesy of NUIKit/CGSInternal | |
int main(){ | |
int outsession; | |
int ret = SLSCreateLoginSession(&outsession); | |
printf("login session created: %d\n",outsession); | |
return ret; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
int SLSSessionSwitchToSessionID(int); // original discovery by dumping EXT symbols of SkyLight and trial&error | |
int main(int argc, char** argv){ | |
return SLSSessionSwitchToSessionID(atoi(argv[1])); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tested pass on Ventura 13.4 22F66