Created
September 18, 2015 05:11
-
-
Save smealum/528dbb10d90c1577bdc4 to your computer and use it in GitHub Desktop.
aptExit
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
void _aptExit() | |
{ | |
Handle _srvHandle; | |
Handle* srvHandle = &_srvHandle; | |
Handle aptLockHandle = 0; | |
Handle aptuHandle=0x00; | |
_initSrv(srvHandle); | |
_aptSessionInit(); | |
#ifndef OTHERAPP | |
aptLockHandle=*((Handle*)CN_APTLOCKHANDLE_ADR); | |
#else | |
_aptOpenSession(); | |
_APT_GetLockHandle(&aptuHandle, 0x0, &aptLockHandle); | |
_aptCloseSession(); | |
#endif | |
_aptOpenSession(); | |
_APT_CancelLibraryApplet(&aptuHandle, 0x1); | |
_aptCloseSession(); | |
_aptOpenSession(); | |
_APT_NotifyToWait(&aptuHandle, 0x300); | |
_aptCloseSession(); | |
u32 buf1; | |
u8 buf2[4]; | |
_aptOpenSession(); | |
buf1 = 0x00; | |
_APT_AppletUtility(&aptuHandle, NULL, 0x4, 0x1, (u8*)&buf1, 0x1, buf2); | |
_aptCloseSession(); | |
u8 out = 1; | |
while(out) | |
{ | |
_aptOpenSession(); | |
_APT_IsRegistered(&aptuHandle, 0x401, &out); // wait until swkbd is dead | |
_aptCloseSession(); | |
} | |
_aptOpenSession(); | |
buf1 = 0x10; | |
_APT_AppletUtility(&aptuHandle, NULL, 0x7, 0x4, (u8*)&buf1, 0x1, buf2); | |
_aptCloseSession(); | |
_aptOpenSession(); | |
buf1 = 0x00; | |
_APT_AppletUtility(&aptuHandle, NULL, 0x4, 0x1, (u8*)&buf1, 0x1, buf2); | |
_aptCloseSession(); | |
_aptOpenSession(); | |
_APT_PrepareToCloseApplication(&aptuHandle, 0x1); | |
_aptCloseSession(); | |
_aptOpenSession(); | |
_APT_CloseApplication(&aptuHandle, 0x0, 0x0, 0x0); | |
_aptCloseSession(); | |
svc_closeHandle(aptLockHandle); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment