/* * nOnOSDumper v1.0 * * Copyright (C) 2013 Excale * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include static const int addr_dump[] = {0x100B14B8, 0x100B1778, 0x100B0BB0, 0x100B0E98}; #define DUMP nl_osvalue((int*)addr_dump, sizeof(addr_dump)/sizeof(addr_dump[0])) HOOK_DEFINE(hook) { if( !rename((char *) HOOK_SAVED_REGS(hook)[0], "/documents/TI-Nspire.tns")) { show_msgbox("nOnOSDumper", "What a dump!\nCheck /documents/TI-Nspire.tns fer ye prize."); } else { show_msgbox("nOnOSDumper", "Dump failed :(\nDid you forget t' move out t' previous /documents/TI-Nspire.tns ?"); } HOOK_RESTORE_RETURN(hook); } int main(void) { HOOK_INSTALL(DUMP, hook); nl_set_resident(); show_msgbox("nOnOSDumper", "Hook installed. Ready t' dump t' upcomin' OS Capt'ain!"); return 0; }