├── icon.jpg ├── romfs ├── boot.dat ├── imkvdb.arc ├── TegraExplorer.bin └── startup.te ├── stuff ├── Howto.gif ├── iconD.jpg ├── iconUP.jpeg ├── mariko.jpg ├── icon-bum.jpg └── Haku33.te ├── source ├── led.hpp ├── reboot.h ├── spl.hpp ├── service_guard.h ├── reboot.c ├── spl.cpp ├── lang.hpp ├── led.cpp └── main.cpp ├── .gitignore ├── compile.cmd ├── .github └── workflows │ └── Homebrew.yml ├── README.md ├── Makefile └── LICENSE /icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StarDustCFW/Haku33/HEAD/icon.jpg -------------------------------------------------------------------------------- /romfs/boot.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StarDustCFW/Haku33/HEAD/romfs/boot.dat -------------------------------------------------------------------------------- /romfs/imkvdb.arc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StarDustCFW/Haku33/HEAD/romfs/imkvdb.arc -------------------------------------------------------------------------------- /stuff/Howto.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StarDustCFW/Haku33/HEAD/stuff/Howto.gif -------------------------------------------------------------------------------- /stuff/iconD.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StarDustCFW/Haku33/HEAD/stuff/iconD.jpg -------------------------------------------------------------------------------- /stuff/iconUP.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StarDustCFW/Haku33/HEAD/stuff/iconUP.jpeg -------------------------------------------------------------------------------- /stuff/mariko.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StarDustCFW/Haku33/HEAD/stuff/mariko.jpg -------------------------------------------------------------------------------- /stuff/icon-bum.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StarDustCFW/Haku33/HEAD/stuff/icon-bum.jpg -------------------------------------------------------------------------------- /romfs/TegraExplorer.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StarDustCFW/Haku33/HEAD/romfs/TegraExplorer.bin -------------------------------------------------------------------------------- /source/led.hpp: -------------------------------------------------------------------------------- 1 | void flash_led_connect(); 2 | void flash_led_disconnect(); 3 | void led_on(int inter); -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/* 2 | *.elf 3 | *.nro 4 | *.pfs0 5 | *.nso 6 | *.nacp 7 | *.nsp 8 | *.npdm 9 | img 10 | *.rar 11 | Haku33--88/* 12 | libnx/* 13 | romfs/*.ini 14 | -------------------------------------------------------------------------------- /source/reboot.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | void reboot_to_payload(const char* payload); 9 | bool init_slp(void); 10 | void exit_spl(bool can_reboot); -------------------------------------------------------------------------------- /compile.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | set /p IP=<%temp%/My-Switch-ip.txt 4 | 5 | dir /b *.nro>%temp%\filete.txt 6 | set /p File=<%temp%\filete.txt 7 | del "%temp%\filete.txt" 8 | title -%IP% - %File% 9 | ::make clean 10 | make -j7 11 | set a=%errorlevel% 12 | echo ------------------------------------------ 13 | if %a% neq 0 color 04 14 | if %a% equ 0 color 0a 15 | 16 | echo ----------------------------------- 17 | "C:\devkitPro\tools\bin\nxlink.exe" %File% 18 | "C:\devkitPro\tools\bin\nxlink.exe" %File% -a %IP% 19 | %systemroot%\system32\timeout.exe 55 20 | 21 | -------------------------------------------------------------------------------- /.github/workflows/Homebrew.yml: -------------------------------------------------------------------------------- 1 | 2 | name: Build Homebrew 3 | 4 | on: [push,workflow_dispatch] 5 | jobs: 6 | build: 7 | 8 | runs-on: ubuntu-latest 9 | container: 10 | image: d3fau4/nx-dev:latest 11 | steps: 12 | - uses: actions/checkout@v1 13 | - name: Update repo. 14 | run: | 15 | git submodule update --init --recursive 16 | 17 | - name: Make app 18 | run: | 19 | make -j$(nproc) 20 | 21 | - uses: actions/upload-artifact@master 22 | with: 23 | name: Homebrew 24 | path: Haku33.nro 25 | -------------------------------------------------------------------------------- /source/spl.hpp: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2020 D3fau4 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE.*/ 20 | 21 | #pragma once 22 | 23 | namespace spl { 24 | char *GetHardwareType(void); 25 | bool HasRCMbugPatched(void); 26 | bool HasEmummc(void); 27 | } -------------------------------------------------------------------------------- /source/service_guard.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | typedef struct ServiceGuard { 9 | Mutex mutex; 10 | u32 refCount; 11 | } ServiceGuard; 12 | 13 | NX_INLINE bool serviceGuardBeginInit(ServiceGuard* g) 14 | { 15 | mutexLock(&g->mutex); 16 | return (g->refCount++) == 0; 17 | } 18 | 19 | NX_INLINE Result serviceGuardEndInit(ServiceGuard* g, Result rc, void (*cleanupFunc)(void)) 20 | { 21 | if (R_FAILED(rc)) { 22 | cleanupFunc(); 23 | --g->refCount; 24 | } 25 | mutexUnlock(&g->mutex); 26 | return rc; 27 | } 28 | 29 | NX_INLINE void serviceGuardExit(ServiceGuard* g, void (*cleanupFunc)(void)) 30 | { 31 | mutexLock(&g->mutex); 32 | if (g->refCount && (--g->refCount) == 0) 33 | cleanupFunc(); 34 | mutexUnlock(&g->mutex); 35 | } 36 | 37 | #define NX_GENERATE_SERVICE_GUARD_PARAMS(name, _paramdecl, _parampass) \ 38 | \ 39 | static ServiceGuard g_##name##Guard; \ 40 | NX_INLINE Result _##name##Initialize _paramdecl; \ 41 | static void _##name##Cleanup(void); \ 42 | \ 43 | Result name##Initialize _paramdecl \ 44 | { \ 45 | Result rc = 0; \ 46 | if (serviceGuardBeginInit(&g_##name##Guard)) \ 47 | rc = _##name##Initialize _parampass; \ 48 | return serviceGuardEndInit(&g_##name##Guard, rc, _##name##Cleanup); \ 49 | } \ 50 | \ 51 | void name##Exit(void) \ 52 | { \ 53 | serviceGuardExit(&g_##name##Guard, _##name##Cleanup); \ 54 | } 55 | 56 | #define NX_GENERATE_SERVICE_GUARD(name) NX_GENERATE_SERVICE_GUARD_PARAMS(name, (void), ()) -------------------------------------------------------------------------------- /source/reboot.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | #include "reboot.h" 7 | 8 | #define IRAM_PAYLOAD_MAX_SIZE 0x2F000 9 | #define IRAM_PAYLOAD_BASE 0x40010000 10 | 11 | static alignas(0x1000) u8 g_reboot_payload[IRAM_PAYLOAD_MAX_SIZE]; 12 | static alignas(0x1000) u8 g_ff_page[0x1000]; 13 | static alignas(0x1000) u8 g_work_page[0x1000]; 14 | bool can_reboot = true; 15 | 16 | void do_iram_dram_copy(void *buf, uintptr_t iram_addr, size_t size, int option) { 17 | memcpy(g_work_page, buf, size); 18 | 19 | SecmonArgs args = {0}; 20 | args.X[0] = 0xF0000201; /* smcAmsIramCopy */ 21 | args.X[1] = (uintptr_t)g_work_page; /* DRAM Address */ 22 | args.X[2] = iram_addr; /* IRAM Address */ 23 | args.X[3] = size; /* Copy size */ 24 | args.X[4] = option; /* 0 = Read, 1 = Write */ 25 | svcCallSecureMonitor(&args); 26 | 27 | memcpy(buf, g_work_page, size); 28 | } 29 | 30 | void copy_to_iram(uintptr_t iram_addr, void *buf, size_t size) { 31 | do_iram_dram_copy(buf, iram_addr, size, 1); 32 | } 33 | 34 | void copy_from_iram(void *buf, uintptr_t iram_addr, size_t size) { 35 | do_iram_dram_copy(buf, iram_addr, size, 0); 36 | } 37 | 38 | static void clear_iram(void) { 39 | memset(g_ff_page, 0xFF, sizeof(g_ff_page)); 40 | for (size_t i = 0; i < IRAM_PAYLOAD_MAX_SIZE; i += sizeof(g_ff_page)) { 41 | copy_to_iram(IRAM_PAYLOAD_BASE + i, g_ff_page, sizeof(g_ff_page)); 42 | } 43 | } 44 | 45 | void reboot_to_payload(const char* payload) { 46 | clear_iram(); 47 | 48 | FILE *f = fopen(payload, "rb"); 49 | if (f == NULL) { 50 | can_reboot = false; 51 | return; 52 | } else { 53 | can_reboot = true; 54 | fread(g_reboot_payload, 1, sizeof(g_reboot_payload), f); 55 | fclose(f); 56 | } 57 | 58 | for (size_t i = 0; i < IRAM_PAYLOAD_MAX_SIZE; i += 0x1000) { 59 | copy_to_iram(IRAM_PAYLOAD_BASE + i, &g_reboot_payload[i], 0x1000); 60 | } 61 | 62 | splSetConfig((SplConfigItem)65001, 2); 63 | } 64 | 65 | bool init_slp() 66 | { 67 | Result rc = splInitialize(); 68 | if (R_FAILED(rc)) { 69 | can_reboot = false; 70 | } else { 71 | can_reboot = true; 72 | } 73 | return can_reboot; 74 | } 75 | 76 | void exit_spl(bool can_reboot) 77 | { 78 | if (can_reboot) { 79 | splExit(); 80 | } 81 | return; 82 | } -------------------------------------------------------------------------------- /source/spl.cpp: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2020 D3fau4 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE.*/ 20 | 21 | #include 22 | #include 23 | 24 | #include "spl.hpp" 25 | 26 | namespace spl 27 | { 28 | 29 | static constexpr u32 ExosphereHasRcmBugPatch = 65004; 30 | static constexpr u32 ExosphereEmummcType = 65007; 31 | 32 | char *GetHardwareType(void) 33 | { 34 | Result ret = 0; 35 | u64 hardware_type = 4; 36 | char *hardware[] = { 37 | "Icosa", // Erista normal 38 | "Copper", // Erista prototype 39 | "Hoag", // Mariko lite 40 | "Iowa", // Mariko retail 41 | "Calcio", // Mariko prototype 42 | "Aula", // nx-abcd board 43 | "Unknown"}; 44 | 45 | if (R_FAILED(ret = splGetConfig(SplConfigItem_HardwareType, &hardware_type))) 46 | { 47 | return hardware[6]; 48 | } 49 | else 50 | return hardware[hardware_type]; 51 | } 52 | 53 | bool HasRCMbugPatched(void) 54 | { 55 | Result ret = 0; 56 | u64 has_rcm_bug_patch; 57 | if (R_SUCCEEDED(ret = splGetConfig(static_cast(ExosphereHasRcmBugPatch), &has_rcm_bug_patch))) 58 | { 59 | return has_rcm_bug_patch; 60 | } 61 | else 62 | { 63 | return has_rcm_bug_patch; 64 | } 65 | } 66 | 67 | bool HasEmummc(void) 68 | { 69 | Result ret = 0; 70 | u64 IsEmummc; 71 | 72 | if (R_SUCCEEDED(ret = splGetConfig(static_cast(ExosphereEmummcType), &IsEmummc))) 73 | { 74 | return IsEmummc; 75 | } 76 | else 77 | { 78 | return IsEmummc; 79 | } 80 | } 81 | 82 | } // namespace spl -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Discord Server 2 | 3 | ## Haku33 4 | * Perform a Hard Reset of the switch, and leave it as if it had just left the box 5 | 6 | ## Reason 7 | * In case you don't have a clean copy of the nand, clean it and start using all original or use emunand 8 | 9 | ## Disclaimer 10 | * It is advisable to make a backup before using it, since despite being well tested, failures can occur. 11 | * I am not responsable of bricks, melted switch, nuclear explotions or full aniquilation 12 | * The premise is elimination. Can it be the lack of information that makes you get banned? So far the case has not happened. 13 | * It is true that it is not 100% safe, but the people who have tested it have not been banned yet [Reference](https://youtu.be/9jV8iN7LJPY?list=PLNawpCFHdbXY-ZgF43vEJBk2IoweJfAlm) 14 | * Haku33 is a simplification of this [method of clean](https://youtu.be/9jV8iN7LJPY?list=PLNawpCFHdbXY-ZgF43vEJBk2IoweJfAlm) 15 | * If you have a clean backup of the Nand, it is better use that, 16 | 17 | * If your console is Banned there is nothing to do 18 | * This will completely clean your switch, so you will lose everything 19 | 20 | ## Ipatched(Mariko) Are supported but used under your own risk. 21 | Mariko consoles cannot reboot to the payload , so to load the payload Haku33 have to Overwrite some files on sd 22 | * Haku33 Support Mariko in part and not suport clean emummc 23 | * * I don't have a Mariko console to test, be sure of report any bug 24 | * * Always make a bakup before clean and only if all is green the make another backup and delete the old one. 25 | 26 | ### Note: 27 | Keep in mind that this program will not UNBAN you, or will it make you immune to BAN. 28 | You will have a console as just out of the box, that's it. 29 | So you can go online as long as you keep the console clean of cfw. 30 | * * I recommend always have a backup of the nand for security reasons. 31 | 32 | ### Credits 33 | * devkitPro for the devkitA64 toolchain. 34 | * [TegraExplorer](https://github.com/suchmememanyskill/TegraExplorer) for his powerfull tool and script 35 | 36 | 37 | ### Known Bugs 38 | * black screen after 17.0.0 39 | ```ini 40 | We found 3 solution for the problem 41 | 42 | Never use this solutions on Mariko without the console prod.keys you can brick the console. 43 | 44 | 1 just run atmosphere on Sysnand 45 | 2 delete system:/saves/8000000000000120 using tegra explorer.bin 46 | And then run atmosphere to rebuild db 47 | Or 48 | 3 delete system:/saves completely using tegra explorer.bin an the run atmosphere (this will make a full factory restart) 49 | ``` 50 | Discord Server 51 | 52 | 53 | ## [Support](https://discord.io/myrincon). 54 | 55 | # [Demostration video](https://youtu.be/X1VpT3DwN-E) 56 | # [Manual Method](https://youtu.be/9jV8iN7LJPY?list=PLNawpCFHdbXY-ZgF43vEJBk2IoweJfAlm) 57 | # [Support Chat](https://discord.io/myrincon) 58 | -------------------------------------------------------------------------------- /stuff/Haku33.te: -------------------------------------------------------------------------------- 1 | checkIfImportantSave = { 2 | importantSaves = ["8000000000000120", "80000000000000d1", "8000000000000047"] 3 | j = 0 4 | important = 0 5 | while (j < len(importantSaves)){ 6 | if (importantSaves[j] == save){ 7 | important = 1 8 | } 9 | 10 | j = j + 1 11 | } 12 | } 13 | 14 | ver = version() 15 | 16 | println("Haku33 v-.- Kronos2308 Hard Reset, Kronos2308") 17 | println("Running on TE ", ver) 18 | println("Running...") 19 | println() 20 | 21 | BTN_X = 0x2 22 | 23 | if (_EMU) { 24 | menuOptions = ["Exit", "Sysmmc", "Emummc"] 25 | } 26 | else() { 27 | menuOptions = ["Exit", "Sysmmc"] 28 | } 29 | 30 | print("Wipe from: ") 31 | res = menu(menuOptions, 0) 32 | 33 | clearscreen() 34 | 35 | if (res == 0){ 36 | exit() 37 | } 38 | 39 | if (res == 1){ 40 | println("Mounting Sysmmc") 41 | mount = mmcConnect("SYSMMC") 42 | } 43 | 44 | if (res == 2){ 45 | println("Mounting Emummc") 46 | mount = mmcConnect("EMUMMC") 47 | } 48 | 49 | if (mount){ 50 | println("Error connecting mmc!") 51 | pause() 52 | exit() 53 | } 54 | 55 | if (mmcMount("SYSTEM")) { 56 | println("Failed to mount SYSTEM") 57 | pause() 58 | exit() 59 | } 60 | 61 | color("RED") 62 | println("Are you sure you want to wipe everything?\nThis includes:\n- Saves\n- Game Data\n- All other data on the system\n\nUse this only as a last resort!") 63 | color("YELLOW") 64 | wait(10000) 65 | 66 | println("Press X to continue\nPress any other button to exit") 67 | 68 | start = pause() & BTN_X 69 | if (!start){ 70 | color("WHITE") 71 | exit() 72 | } 73 | 74 | color("WHITE") 75 | println("Deleting SYSTEM saves") 76 | files = dirRead("bis:/save") 77 | 78 | i = 0 79 | color("RED") 80 | while (i < len(files)) { 81 | if (!fileProperties[i]){ # checks if it's not a file 82 | save = files[i] 83 | checkIfImportantSave() 84 | if (!important){ 85 | print("\rDeleting ", save) 86 | res = fileDel(pathCombine("bis:/save", save)) 87 | if (res) { 88 | println("\nFile deletion failed!") 89 | pause() 90 | exit() 91 | } 92 | } 93 | } 94 | 95 | i = i + 1 96 | } 97 | 98 | color("WHITE") 99 | println("\n\nDeleting USER\n") 100 | color("RED") 101 | 102 | if (mmcMount("USER")){ 103 | println("Failed to mount USER") 104 | pause() 105 | exit() 106 | } 107 | 108 | toDel = ["Album", "Contents", "save", "saveMeta", "temp"] 109 | 110 | i = 0 111 | while (i < len(toDel)){ 112 | dirDel(pathCombine("bis:/", toDel[i])) 113 | mkdir(pathCombine("bis:/", toDel[i])) 114 | 115 | i = i + 1 116 | } 117 | 118 | mkdir("bis:/Contents/placehld") 119 | mkdir("bis:/Contents/registered") 120 | 121 | color("GREEN") 122 | println("\n\nDone!") 123 | println("\n\nCleaning!") 124 | 125 | fileMove("sd:/Nintendo", "sd:/Hamburgesa_Nintendo") 126 | fileMove("sd:/Nintendo", "sd:/Hamburgesa_Nintendo_1") 127 | 128 | fileDel("sd:/startup.te") 129 | fileDel("sd:/Haku33.nro") 130 | fileDel("sd:/Switch/Haku33.nro") 131 | fileDel("sd:/Switch/Haku33/Haku33.nro") 132 | 133 | pause() 134 | launchPayload("sd:/poweroff.bin") -------------------------------------------------------------------------------- /source/lang.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | // Define a map to hold the language translations 9 | std::map LG; 10 | 11 | void set_LANG() { 12 | setInitialize(); 13 | u64 lcode = 0; 14 | SetLanguage lang; 15 | setGetSystemLanguage(&lcode); 16 | setMakeLanguage(lcode, &lang); 17 | 18 | switch(lang) { 19 | case 5: 20 | case 14: // Spanish 21 | LG["WARNING1"] = "\n\x1b[30;1m TU CONSOLA SERA COMPLETAMENTE LIMPIADA: SAVES, JUEGOS, ETC \x1b[0m\n"; 22 | LG["WARNING2"] = "\n\x1b[30;1m SE REALIZARA UN HARD RESET LUEGO SE APAGARA LA CONSOLA \x1b[0m\n"; 23 | LG["WARNING3"] = "\n\x1b[30;1m SI NO SABES LO QUE HACES, PRESIONA B PARA ABORTAR \x1b[0m\n"; 24 | LG["MESSAGE1"] = "\n\n\x1b[30;1m-------- LO DEVORARE TODO --------\x1b[0m\n\n"; 25 | LG["PROMPT1"] = "\n\nPULSA A PARA LIMPIAR\n\n"; 26 | LG["REMINDER1"] = "\x1b[33;1m*\x1b[0m Recuerda Desinstalar Incognito Desde Incognito-RCM\n\n"; 27 | LG["REMINDER2"] = "\x1b[33;1m*\x1b[0m Luego del Reinicio ve a Hekate -> More configs -> Haku33\n\n"; 28 | LG["INFO0"] = " No se puede Reiniciar al Payload en una consola Mariko\n"; 29 | LG["ERROR2"] = "\n\x1b[33;1m*\x1b[0m Si se congela mucho tiempo, Es que ha fallado. Pulsa POWER 15s \n\ny haslo de nuevo\n\n"; 30 | LG["STATUS1"] = "\x1b[32;1m*\x1b[0m Deshabilitando FTP de SXOS\n"; 31 | LG["INFO1"] = "\x1b[32;1m*\x1b[0m Esto no esta pensado para usarse en EMU\n"; 32 | LG["ERROR1"] = "\x1b[32;1m*\x1b[0m NO Existe /switch/prod.keys, usa LockPick_RCM\n"; 33 | LG["CONFIRM1"] = "\x1b[33;1m*\x1b[0m ESTAS SEGURO??\n"; 34 | break; 35 | default: // English (default) 36 | LG["WARNING1"] = "\n\x1b[30;1m YOUR CONSOLE WILL BE COMPLETELY CLEANED: SAVES, GAMES, ETC \x1b[0m\n"; 37 | LG["WARNING2"] = "\n\x1b[30;1m A HARD RESET WILL BE PERFORMED AFTER THE CONSOLE WILL BE OFF \x1b[0m\n"; 38 | LG["WARNING3"] = "\n\x1b[30;1m IF YOU DON'T KNOW WHAT YOU DO, PRESS B FOR ABORT \x1b[0m\n"; 39 | LG["MESSAGE1"] = "\n\n\x1b[30;1m-------- I WILL CONSUME EVERYTHING --------\x1b[0m\n\n"; 40 | LG["PROMPT1"] = "\n\nPRESS A TO CLEAN\n\n"; 41 | LG["REMINDER1"] = "\x1b[33;1m*\x1b[0m Remember Uninstall Incognito from Incognito-RCM\n\n"; 42 | LG["REMINDER2"] = "\x1b[33;1m*\x1b[0m After the Reboot go to Hekate -> More configs -> Haku33\n\n"; 43 | LG["INFO0"] = " Reboot to payload cannot be used on a Mariko system\n"; 44 | LG["ERROR2"] = "\n\x1b[33;1m*\x1b[0m If it freezes for a long time, It has failed. Press POWER 15s \n\nand try again \n\n"; 45 | LG["STATUS1"] = "\x1b[32;1m*\x1b[0m Disabling SXOS FTP\n"; 46 | LG["INFO1"] = "\x1b[32;1m*\x1b[0m This is not intended to be used at EMU\n"; 47 | LG["ERROR1"] = "\x1b[32;1m*\x1b[0m NO Existe /switch/prod.keys, usa LockPick_RCM\n"; 48 | LG["CONFIRM1"] = "\x1b[33;1m*\x1b[0m ARE YOU SURE??\n"; 49 | break; 50 | } 51 | setsysExit(); 52 | } 53 | -------------------------------------------------------------------------------- /romfs/startup.te: -------------------------------------------------------------------------------- 1 | #REQUIRE KEYS 2 | is=["8000000000000120","8000000000000053","8000000000000000"] 3 | p=println 4 | pr=print 5 | hwfly={if(fsexists("sd:/payload.bin.bak")){copyfile("sd:/payload.bin.bak", "sd:/payload.bin")delfile("sd:/payload.bin.bak")}} 6 | 7 | pe={hwfly() pause() exit()} 8 | p("System wiper\n") 9 | op=["Exit","Wipe sysmmc"].copy() 10 | if (emu()){op+"Wipe emummc"} 11 | r=menu(op,0)clear() 12 | if(r==0){exit()} 13 | if(r==1){ 14 | mount=mountsys 15 | selected_target = "sysmmc" 16 | } 17 | if(r==2){ 18 | mount=mountemu 19 | selected_target = "emummc" 20 | } 21 | if(mount("SYSTEM")){p("Mount failed!")pe()} 22 | clear() 23 | 24 | border = { 25 | setpixels(0,0,1279,19,border_color) 26 | setpixels(0,700,1279,719,border_color) 27 | setpixels(0,20,19,699,border_color) 28 | setpixels(1260,20,1279,699,border_color) 29 | } 30 | 31 | i = 10 32 | x_pos = 10 33 | y_pos = 12 34 | 35 | ["WARNING!!!", 36 | "", 37 | "Do you really want to wipe your system?", 38 | "This will remove:", 39 | "- Your Save Data", 40 | "- Your Game Data", 41 | "- Your User Data", 42 | "", 43 | "Restoring an emmc backup is always preferable over wiping.", 44 | "Please only use this as a last resort.", 45 | "This script is intended to be used in aid of unbricking." 46 | ].foreach("line") 47 | { 48 | printpos(x_pos, y_pos) 49 | y_pos = y_pos + 1 50 | print(line) 51 | } 52 | 53 | if (!fsexists("bis:/save/"+is[1])) 54 | { 55 | [ 56 | "", 57 | "DeviceSettings save (8000000000000053) is missing!!!", 58 | "This script cannot recover lost battery calibration data.", 59 | "The system will initialize with default values.", 60 | "These values are unsafe for lite systems!" 61 | ].foreach("line") 62 | { 63 | printpos(x_pos, y_pos) 64 | y_pos = y_pos + 1 65 | print(line) 66 | } 67 | } 68 | 69 | time = 5000 70 | y_pos = y_pos + 4 71 | 72 | while (i > 0) 73 | { 74 | i = i - 1 75 | 76 | if (i % 2 == 0){ 77 | border_color = 0xFF0000 78 | }.else() { 79 | border_color = 0x000000 80 | } 81 | 82 | border() 83 | sleep(500) 84 | time = time - 500 85 | printpos(x_pos, y_pos) 86 | print("Waiting for", time / 1000, "seconds") 87 | } 88 | 89 | printpos(x_pos, y_pos) 90 | print("Ready to wipe", selected_target, " ") 91 | y_pos = y_pos + 1 92 | printpos(x_pos, y_pos) 93 | print("Press the power button to wipe, any other key to exit") 94 | 95 | result = pause(0x70F000F) 96 | 97 | if (!result.power) 98 | { 99 | hwfly() 100 | exit() 101 | } 102 | 103 | clear() 104 | color(0xFF0000) 105 | pr("Deleting system saves... ") 106 | f=readdir("bis:/save") 107 | if(f.folders.len()!=0){p("Folders in save dir???")pe()} 108 | f.files.foreach("x"){if(!is.contains(x)){if(delfile("bis:/save/"+x)){p("File deletion failed: ", x)pe()}}} 109 | pr("Done!\nSetting up indexer save...") 110 | 111 | if(fsexists("bis:/save/"+is[0])) 112 | { 113 | ba0=["BYTE[]",0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00] 114 | ba120=["BYTE[]",0x20,0x01,0x00,0x00,0x00,0x00,0x00,0x80] 115 | ba53=["BYTE[]",0x53,0x00,0x00,0x00,0x00,0x00,0x00,0x80] 116 | imen=["BYTE[]",0x49,0x4D,0x45,0x4E,0x40,0x00,0x00,0x00,0x40,0x00,0x00,0x00] 117 | 118 | idb=["BYTE[]",0x49,0x4D,0x4B,0x56,0x00,0x00,0x00,0x00].copy() # imkv 119 | 120 | skip53 = !fsexists("bis:/save/"+is[1]) 121 | 122 | if(skip53) 123 | { 124 | idb.add(0x01) # 0x01 imen 125 | pr("053 save not found!!! Skip indexing it...") 126 | }.else() 127 | { 128 | idb.add(0x02) # 0x02 imens 129 | } 130 | 131 | idb.add(0x00) 132 | idb.add(0x00) 133 | idb.add(0x00) 134 | 135 | if(!skip53) 136 | { 137 | # 53 save 138 | s=getfilesize("bis:/save/"+is[1]) 139 | s1=s&0xFF 140 | s2=(s>>8)&0xFF 141 | s3=(s>>16)&0xFF 142 | s4=(s>>24)&0xFF 143 | idb.addrange(imen) 144 | idb.addrange(ba0) 145 | idb.addrange(ba0) 146 | idb.addrange(ba0) 147 | idb.addrange(ba53) 148 | idb.addrange(ba0) 149 | idb.addrange(ba0) 150 | idb.addrange(ba0) 151 | idb.addrange(ba0) 152 | idb.addrange(ba53) 153 | idb.add(s1) 154 | idb.add(s2) 155 | idb.add(s3) 156 | idb.add(s4) 157 | idb.add(0x00) 158 | idb.add(0x00) 159 | idb.add(0x00) 160 | idb.add(0x00) 161 | idb.addrange(ba0) 162 | idb.addrange(ba0) 163 | idb.addrange(ba0) 164 | idb.addrange(ba0) 165 | idb.addrange(ba0) 166 | idb.addrange(ba0) 167 | } 168 | 169 | # 120 save 170 | s=getfilesize("bis:/save/"+is[0]) 171 | s1=s&0xFF 172 | s2=(s>>8)&0xFF 173 | s3=(s>>16)&0xFF 174 | s4=(s>>24)&0xFF 175 | idb.addrange(imen) 176 | idb.addrange(ba0) 177 | idb.addrange(ba0) 178 | idb.addrange(ba0) 179 | idb.addrange(ba120) 180 | idb.addrange(ba0) 181 | idb.addrange(ba0) 182 | idb.addrange(ba0) 183 | idb.addrange(ba0) 184 | idb.addrange(ba120) 185 | idb.add(s1) 186 | idb.add(s2) 187 | idb.add(s3) 188 | idb.add(s4) 189 | idb.add(0x00) 190 | idb.add(0x00) 191 | idb.add(0x00) 192 | idb.add(0x00) 193 | idb.addrange(ba0) 194 | idb.addrange(ba0) 195 | idb.addrange(ba0) 196 | idb.addrange(ba0) 197 | idb.addrange(ba0) 198 | idb.addrange(ba0) 199 | 200 | idxs=readsave("bis:/save/"+is[2]) 201 | if(idxs.resize("/imkvdb.arc",idb.len())){p("imkvdb resize failed")pe()} 202 | if(idxs.write("/imkvdb.arc",idb)){p("imkvdb write failed")pe()} 203 | if(idxs.resize("/lastPublishedId",ba0.len())){p("lastPublishedId resize failed")pe()} 204 | if(idxs.write("/lastPublishedId",ba0)){p("lastPublishedId write failed")pe()} 205 | if(idxs.commit()){p("Indexer save commit failed")pe()} 206 | idxs=0 207 | pr("Done!") 208 | }.else() 209 | { 210 | pr("120 save not found!!! Skip editing indexer save!!!") 211 | } 212 | 213 | pr("\nDeleting user dirs...")ud=["Album","Contents","save","saveMeta","temp"] 214 | if(mount("USER")){p("Mount failed!")pe()} 215 | ud.foreach("x"){pr("\n"+x,"")if(deldir("bis:/"+x)){p("Dir deletion failed")pe()}mkdir("bis:/"+x)} 216 | mkdir("bis:/Contents/placehld")mkdir("bis:/Contents/registered") 217 | color(0x00FF00)p("\n\nDone!") 218 | 219 | color(0x00FF00) 220 | p("\n\nCleaning!") 221 | 222 | movefile("sd:/Nintendo", "sd:/Hamburgesa_Nintendo") 223 | movefile("sd:/Nintendo", "sd:/Hamburgesa_Nintendo_1") 224 | 225 | delfile("sd:/TegraExplorer.bin") 226 | delfile("sd:/startup.te") 227 | delfile("sd:/Haku33.nro") 228 | delfile("sd:/Switch/Haku33.nro") 229 | delfile("sd:/Switch/Haku33/Haku33.nro") 230 | hwfly() 231 | 232 | p("\n\nDone!") 233 | power(3) -------------------------------------------------------------------------------- /source/led.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | void led_on(int inter) 6 | { 7 | // Configure our supported input layout: a single player with standard controller styles 8 | 9 | Result rc=0; 10 | s32 i; 11 | s32 total_entries; 12 | HidsysUniquePadId unique_pad_ids[2]={0}; 13 | HidsysNotificationLedPattern pattern; 14 | 15 | rc = hidsysInitialize(); 16 | if (R_FAILED(rc)) { 17 | printf("hidsysInitialize(): 0x%x\n", rc); 18 | } 19 | // Scan the gamepad. This should be done once for each frame 20 | PadState pad; 21 | padInitializeDefault(&pad); 22 | padUpdate(&pad); 23 | 24 | // padGetButtonsDown returns the set of buttons that have been 25 | // newly pressed in this frame compared to the previous one 26 | //u64 kDown = padGetButtonsDown(&pad); 27 | 28 | switch(inter) 29 | { 30 | case 1: 31 | 32 | memset(&pattern, 0, sizeof(pattern)); 33 | // Setup Breathing effect pattern data. 34 | pattern.baseMiniCycleDuration = 0x8; // 100ms. 35 | pattern.totalMiniCycles = 0x2; // 3 mini cycles. Last one 12.5ms. 36 | pattern.totalFullCycles = 0x0; // Repeat forever. 37 | pattern.startIntensity = 0x2; // 13%. 38 | 39 | pattern.miniCycles[0].ledIntensity = 0xF; // 100%. 40 | pattern.miniCycles[0].transitionSteps = 0xF; // 15 steps. Transition time 1.5s. 41 | pattern.miniCycles[0].finalStepDuration = 0x0; // Forced 12.5ms. 42 | pattern.miniCycles[1].ledIntensity = 0x2; // 13%. 43 | pattern.miniCycles[1].transitionSteps = 0xF; // 15 steps. Transition time 1.5s. 44 | pattern.miniCycles[1].finalStepDuration = 0x0; // Forced 12.5ms. 45 | 46 | break; 47 | 48 | 49 | case 2: 50 | memset(&pattern, 0, sizeof(pattern)); 51 | // Setup Heartbeat effect pattern data. 52 | pattern.baseMiniCycleDuration = 0x1; // 12.5ms. 53 | pattern.totalMiniCycles = 0xF; // 16 mini cycles. 54 | pattern.totalFullCycles = 0x0; // Repeat forever. 55 | pattern.startIntensity = 0x0; // 0%. 56 | 57 | // First beat. 58 | pattern.miniCycles[0].ledIntensity = 0xF; // 100%. 59 | pattern.miniCycles[0].transitionSteps = 0xF; // 15 steps. Total 187.5ms. 60 | pattern.miniCycles[0].finalStepDuration = 0x0; // Forced 12.5ms. 61 | pattern.miniCycles[1].ledIntensity = 0x0; // 0%. 62 | pattern.miniCycles[1].transitionSteps = 0xF; // 15 steps. Total 187.5ms. 63 | pattern.miniCycles[1].finalStepDuration = 0x0; // Forced 12.5ms. 64 | 65 | // Second beat. 66 | pattern.miniCycles[2].ledIntensity = 0xF; 67 | pattern.miniCycles[2].transitionSteps = 0xF; 68 | pattern.miniCycles[2].finalStepDuration = 0x0; 69 | pattern.miniCycles[3].ledIntensity = 0x0; 70 | pattern.miniCycles[3].transitionSteps = 0xF; 71 | pattern.miniCycles[3].finalStepDuration = 0x0; 72 | 73 | // Led off wait time. 74 | for(i=2; i<4; i++) { 75 | pattern.miniCycles[i].ledIntensity = 0x0; // 0%. 76 | pattern.miniCycles[i].transitionSteps = 0xF; // 15 steps. Total 187.5ms. 77 | pattern.miniCycles[i].finalStepDuration = 0xF; // 187.5ms. 78 | } 79 | break; 80 | 81 | case 3: 82 | memset(&pattern, 0, sizeof(pattern)); 83 | // Setup Beacon effect pattern data. 84 | pattern.baseMiniCycleDuration = 0x1; // 12.5ms. 85 | pattern.totalMiniCycles = 0xF; // 16 mini cycles. 86 | pattern.totalFullCycles = 0x0; // Repeat forever. 87 | pattern.startIntensity = 0x0; // 0%. 88 | 89 | // First beat. 90 | pattern.miniCycles[0].ledIntensity = 0xF; // 100%. 91 | pattern.miniCycles[0].transitionSteps = 0xF; // 15 steps. Total 187.5ms. 92 | pattern.miniCycles[0].finalStepDuration = 0x0; // Forced 12.5ms. 93 | pattern.miniCycles[1].ledIntensity = 0x0; // 0%. 94 | pattern.miniCycles[1].transitionSteps = 0xF; // 15 steps. Total 187.5ms. 95 | pattern.miniCycles[1].finalStepDuration = 0x0; // Forced 12.5ms. 96 | 97 | // Second beat. 98 | pattern.miniCycles[2].ledIntensity = 0xF; 99 | pattern.miniCycles[2].transitionSteps = 0xF; 100 | pattern.miniCycles[2].finalStepDuration = 0x0; 101 | pattern.miniCycles[3].ledIntensity = 0x0; 102 | pattern.miniCycles[3].transitionSteps = 0xF; 103 | pattern.miniCycles[3].finalStepDuration = 0x0; 104 | 105 | // Led off wait time. 106 | for(i=4; i<4; i++) { 107 | pattern.miniCycles[i].ledIntensity = 0x0; // 0%. 108 | pattern.miniCycles[i].transitionSteps = 0xF; // 15 steps. Total 187.5ms. 109 | pattern.miniCycles[i].finalStepDuration = 0xF; // 187.5ms. 110 | } 111 | break; 112 | case 0: 113 | default: 114 | memset(&pattern, 0, sizeof(pattern)); 115 | break; 116 | } 117 | 118 | total_entries = 0; 119 | memset(unique_pad_ids, 0, sizeof(unique_pad_ids)); 120 | 121 | // Get the UniquePadIds for the specified controller, which will then be used with hidsysSetNotificationLedPattern*. 122 | // If you want to get the UniquePadIds for all controllers, you can use hidsysGetUniquePadIds instead. 123 | rc = hidsysGetUniquePadsFromNpad(padIsHandheld(&pad) ? HidNpadIdType_Handheld : HidNpadIdType_No1, unique_pad_ids, 2, &total_entries); 124 | printf("hidsysGetUniquePadsFromNpad(): 0x%x", rc); 125 | if (R_SUCCEEDED(rc)) printf(", %d", total_entries); 126 | printf("\n"); 127 | 128 | if (R_SUCCEEDED(rc)) { 129 | for(i=0; i/devkitpro") 7 | endif 8 | 9 | TOPDIR ?= $(CURDIR) 10 | include $(DEVKITPRO)/libnx/switch_rules 11 | 12 | #--------------------------------------------------------------------------------- 13 | # TARGET is the name of the output 14 | # BUILD is the directory where object files & intermediate files will be placed 15 | # SOURCES is a list of directories containing source code 16 | # DATA is a list of directories containing data files 17 | # INCLUDES is a list of directories containing header files 18 | # EXEFS_SRC is the optional input directory containing data copied into exefs, if anything this normally should only contain "main.npdm". 19 | # ROMFS is the directory containing data to be added to RomFS, relative to the Makefile (Optional) 20 | # 21 | # NO_ICON: if set to anything, do not use icon. 22 | # NO_NACP: if set to anything, no .nacp file is generated. 23 | # APP_TITLE is the name of the app stored in the .nacp file (Optional) 24 | # APP_AUTHOR is the author of the app stored in the .nacp file (Optional) 25 | # APP_VERSION is the version of the app stored in the .nacp file (Optional) 26 | # APP_TITLEID is the titleID of the app stored in the .nacp file (Optional) 27 | # ICON is the filename of the icon (.jpg), relative to the project folder. 28 | # If not set, it attempts to use one of the following (in this order): 29 | # - .jpg 30 | # - icon.jpg 31 | # - /default_icon.jpg 32 | #--------------------------------------------------------------------------------- 33 | TARGET := Haku33 34 | BUILD := build 35 | SOURCES := source 36 | DATA := data 37 | INCLUDES := include 38 | EXEFS_SRC := exefs_src 39 | APP_TITLE := Haku33 40 | APP_AUTHOR := Kronos2308 41 | APP_VERSION := 7.2 42 | ROMFS := romfs 43 | 44 | #--------------------------------------------------------------------------------- 45 | # options for code generation 46 | #--------------------------------------------------------------------------------- 47 | ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE 48 | 49 | CFLAGS := -g -O2 -ffunction-sections \ 50 | $(ARCH) $(DEFINES) 51 | 52 | CFLAGS += $(INCLUDE) -D__SWITCH__ -DVERSION='"$(APP_VERSION)"' -DTITLE='"$(APP_TITLE)"' 53 | 54 | CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions 55 | 56 | ASFLAGS := -g $(ARCH) 57 | LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) 58 | 59 | LIBS := -lnx 60 | 61 | #--------------------------------------------------------------------------------- 62 | # list of directories containing libraries, this must be the top level containing 63 | # include and lib 64 | #--------------------------------------------------------------------------------- 65 | LIBDIRS := $(PORTLIBS) $(LIBNX) 66 | 67 | 68 | #--------------------------------------------------------------------------------- 69 | # no real need to edit anything past this point unless you need to add additional 70 | # rules for different file extensions 71 | #--------------------------------------------------------------------------------- 72 | ifneq ($(BUILD),$(notdir $(CURDIR))) 73 | #--------------------------------------------------------------------------------- 74 | 75 | export OUTPUT := $(CURDIR)/$(TARGET) 76 | export TOPDIR := $(CURDIR) 77 | 78 | export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \ 79 | $(foreach dir,$(DATA),$(CURDIR)/$(dir)) 80 | 81 | export DEPSDIR := $(CURDIR)/$(BUILD) 82 | 83 | CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) 84 | CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) 85 | SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) 86 | BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) 87 | 88 | #--------------------------------------------------------------------------------- 89 | # use CXX for linking C++ projects, CC for standard C 90 | #--------------------------------------------------------------------------------- 91 | ifeq ($(strip $(CPPFILES)),) 92 | #--------------------------------------------------------------------------------- 93 | export LD := $(CC) 94 | #--------------------------------------------------------------------------------- 95 | else 96 | #--------------------------------------------------------------------------------- 97 | export LD := $(CXX) 98 | #--------------------------------------------------------------------------------- 99 | endif 100 | #--------------------------------------------------------------------------------- 101 | 102 | export OFILES_BIN := $(addsuffix .o,$(BINFILES)) 103 | export OFILES_SRC := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) 104 | export OFILES := $(OFILES_BIN) $(OFILES_SRC) 105 | export HFILES_BIN := $(addsuffix .h,$(subst .,_,$(BINFILES))) 106 | 107 | export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ 108 | $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ 109 | -I$(CURDIR)/$(BUILD) 110 | 111 | export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) 112 | 113 | export BUILD_EXEFS_SRC := $(TOPDIR)/$(EXEFS_SRC) 114 | 115 | ifeq ($(strip $(ICON)),) 116 | icons := $(wildcard *.jpg) 117 | ifneq (,$(findstring $(TARGET).jpg,$(icons))) 118 | export APP_ICON := $(TOPDIR)/$(TARGET).jpg 119 | else 120 | ifneq (,$(findstring icon.jpg,$(icons))) 121 | export APP_ICON := $(TOPDIR)/icon.jpg 122 | endif 123 | endif 124 | else 125 | export APP_ICON := $(TOPDIR)/$(ICON) 126 | endif 127 | 128 | ifeq ($(strip $(NO_ICON)),) 129 | export NROFLAGS += --icon=$(APP_ICON) 130 | endif 131 | 132 | ifeq ($(strip $(NO_NACP)),) 133 | export NROFLAGS += --nacp=$(CURDIR)/$(TARGET).nacp 134 | endif 135 | 136 | ifneq ($(APP_TITLEID),) 137 | export NACPFLAGS += --titleid=$(APP_TITLEID) 138 | endif 139 | 140 | ifneq ($(ROMFS),) 141 | export NROFLAGS += --romfsdir=$(CURDIR)/$(ROMFS) 142 | endif 143 | 144 | .PHONY: $(BUILD) clean all 145 | 146 | #--------------------------------------------------------------------------------- 147 | all: $(BUILD) 148 | 149 | $(BUILD): 150 | @[ -d $@ ] || mkdir -p $@ 151 | @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile 152 | 153 | #--------------------------------------------------------------------------------- 154 | clean: 155 | @echo clean ... 156 | @rm -fr $(BUILD) $(TARGET).pfs0 $(TARGET).nso $(TARGET).nro $(TARGET).nacp $(TARGET).elf 157 | 158 | 159 | #--------------------------------------------------------------------------------- 160 | else 161 | .PHONY: all 162 | 163 | DEPENDS := $(OFILES:.o=.d) 164 | 165 | #--------------------------------------------------------------------------------- 166 | # main targets 167 | #--------------------------------------------------------------------------------- 168 | all : $(OUTPUT).pfs0 $(OUTPUT).nro 169 | 170 | $(OUTPUT).pfs0 : $(OUTPUT).nso 171 | 172 | $(OUTPUT).nso : $(OUTPUT).elf 173 | 174 | ifeq ($(strip $(NO_NACP)),) 175 | $(OUTPUT).nro : $(OUTPUT).elf $(OUTPUT).nacp 176 | else 177 | $(OUTPUT).nro : $(OUTPUT).elf 178 | endif 179 | 180 | $(OUTPUT).elf : $(OFILES) 181 | 182 | $(OFILES_SRC) : $(HFILES_BIN) 183 | 184 | #--------------------------------------------------------------------------------- 185 | # you need a rule like this for each extension you use as binary data 186 | #--------------------------------------------------------------------------------- 187 | %.bin.o %_bin.h : %.bin 188 | #--------------------------------------------------------------------------------- 189 | @echo $(notdir $<) 190 | @$(bin2o) 191 | 192 | -include $(DEPENDS) 193 | 194 | #--------------------------------------------------------------------------------------- 195 | endif 196 | #--------------------------------------------------------------------------------------- 197 | -------------------------------------------------------------------------------- /source/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include "led.hpp" 25 | #include "lang.hpp" 26 | #include "spl.hpp" 27 | #include 28 | #include 29 | #include 30 | #include "spl.hpp" 31 | 32 | #define IRAM_PAYLOAD_MAX_SIZE 0x24000 33 | static u8 g_reboot_payload[IRAM_PAYLOAD_MAX_SIZE]; 34 | char Logs[2024]; 35 | bool isXSOS; 36 | int verM = 0; 37 | 38 | 39 | extern "C" { 40 | #include "reboot.h" 41 | } 42 | /// HidControllerKeys 43 | typedef enum { 44 | KEY_A = BIT(0), ///< A 45 | KEY_B = BIT(1), ///< B 46 | KEY_X = BIT(2), ///< X 47 | KEY_Y = BIT(3), ///< Y 48 | KEY_LSTICK = BIT(4), ///< Left Stick Button 49 | KEY_RSTICK = BIT(5), ///< Right Stick Button 50 | KEY_L = BIT(6), ///< L 51 | KEY_R = BIT(7), ///< R 52 | KEY_ZL = BIT(8), ///< ZL 53 | KEY_ZR = BIT(9), ///< ZR 54 | KEY_PLUS = BIT(10), ///< Plus 55 | KEY_MINUS = BIT(11), ///< Minus 56 | KEY_DLEFT = BIT(12), ///< D-Pad Left 57 | KEY_DUP = BIT(13), ///< D-Pad Up 58 | KEY_DRIGHT = BIT(14), ///< D-Pad Right 59 | KEY_DDOWN = BIT(15), ///< D-Pad Down 60 | KEY_LSTICK_LEFT = BIT(16), ///< Left Stick Left 61 | KEY_LSTICK_UP = BIT(17), ///< Left Stick Up 62 | KEY_LSTICK_RIGHT = BIT(18), ///< Left Stick Right 63 | KEY_LSTICK_DOWN = BIT(19), ///< Left Stick Down 64 | KEY_RSTICK_LEFT = BIT(20), ///< Right Stick Left 65 | KEY_RSTICK_UP = BIT(21), ///< Right Stick Up 66 | KEY_RSTICK_RIGHT = BIT(22), ///< Right Stick Right 67 | KEY_RSTICK_DOWN = BIT(23), ///< Right Stick Down 68 | KEY_SL_LEFT = BIT(24), ///< SL on Left Joy-Con 69 | KEY_SR_LEFT = BIT(25), ///< SR on Left Joy-Con 70 | KEY_SL_RIGHT = BIT(26), ///< SL on Right Joy-Con 71 | KEY_SR_RIGHT = BIT(27), ///< SR on Right Joy-Con 72 | 73 | KEY_HOME = BIT(18), ///< HOME button, only available for use with HiddbgHdlsState::buttons. 74 | KEY_CAPTURE = BIT(19), ///< Capture button, only available for use with HiddbgHdlsState::buttons. 75 | 76 | // Pseudo-key for at least one finger on the touch screen 77 | KEY_TOUCH = BIT(28), 78 | 79 | // Buttons by orientation (for single Joy-Con), also works with Joy-Con pairs, Pro Controller 80 | KEY_JOYCON_RIGHT = BIT(0), 81 | KEY_JOYCON_DOWN = BIT(1), 82 | KEY_JOYCON_UP = BIT(2), 83 | KEY_JOYCON_LEFT = BIT(3), 84 | 85 | // Generic catch-all directions, also works for single Joy-Con 86 | KEY_UP = KEY_DUP | KEY_LSTICK_UP | KEY_RSTICK_UP, ///< D-Pad Up or Sticks Up 87 | KEY_DOWN = KEY_DDOWN | KEY_LSTICK_DOWN | KEY_RSTICK_DOWN, ///< D-Pad Down or Sticks Down 88 | KEY_LEFT = KEY_DLEFT | KEY_LSTICK_LEFT | KEY_RSTICK_LEFT, ///< D-Pad Left or Sticks Left 89 | KEY_RIGHT = KEY_DRIGHT | KEY_LSTICK_RIGHT | KEY_RSTICK_RIGHT, ///< D-Pad Right or Sticks Right 90 | KEY_SL = KEY_SL_LEFT | KEY_SL_RIGHT, ///< SL on Left or Right Joy-Con 91 | KEY_SR = KEY_SR_LEFT | KEY_SR_RIGHT, ///< SR on Left or Right Joy-Con 92 | } HidControllerKeys; 93 | 94 | using namespace std; 95 | Result Init_Services(void) 96 | { 97 | Result ret = 0; 98 | if (R_FAILED(ret = setsysInitialize())) {return 1;} 99 | if (R_FAILED(ret = splInitialize())) {return 1;} 100 | if (R_FAILED(ret = hiddbgInitialize())) {return 1;} 101 | if (R_FAILED(ret = psmInitialize())) {return 1;} 102 | return ret; 103 | } 104 | 105 | void close_Services() 106 | { 107 | setsysExit(); 108 | splExit(); 109 | smExit(); 110 | hiddbgExit(); 111 | psmExit(); 112 | } 113 | 114 | bool IsExist(std::string Path) 115 | { 116 | std::ifstream ifs(Path); 117 | bool ex = ifs.good(); 118 | ifs.close(); 119 | return ex; 120 | } 121 | 122 | void copy_me(string origen, string destino) { 123 | ifstream source(origen, ios::binary); 124 | ofstream dest(destino, ios::binary); 125 | dest << source.rdbuf(); 126 | source.close(); 127 | dest.close(); 128 | } 129 | 130 | bool getindex (string &index){ 131 | string Dsize = "00118000"; //default size 132 | //get 8000000000000120 size 133 | /* 134 | 135 | if(R_SUCCEEDED(fsOpen_SystemSaveData (&dataW,FsSaveDataSpaceId_System,uidsave,uid))) { 136 | fsdevMountDevice("bro", dataW); 137 | copy_me("romfs:/imkvdb.arc", "bro:/imkvdb.arc"); 138 | fsdevCommitDevice("bro"); 139 | fsdevUnmountDevice("bro"); 140 | cout << "Data Cleared... " << uidsave <= 17){ 309 | NewClean(); 310 | } else { 311 | SetupClean(); 312 | } 313 | } 314 | sure = true; 315 | 316 | //break; 317 | } 318 | 319 | //exit 320 | if (kDown & KEY_B) 321 | { 322 | break; 323 | } 324 | } 325 | 326 | //cansel 327 | close_Services(); 328 | consoleExit(NULL); 329 | return 0; 330 | } 331 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | --------------------------------------------------------------------------------