├── host ├── osx │ └── dslink ├── linux-x86 │ └── dslink ├── windows │ └── dslink.exe └── linux-x86_64 │ └── dslink ├── installDSiLink.bmp ├── .gitmodules ├── .gitignore ├── tblhack ├── Makefile ├── TBLdslink.s └── COPYING ├── cookhack ├── overflow.bin ├── Makefile ├── cooksum.c ├── cookhack.s └── COPYING ├── classichack ├── Makefile ├── cwgsum.c ├── cwghack.s └── COPYING ├── source └── installDSiLink.c ├── Makefile ├── README.html ├── bootstub └── bootstub.s └── COPYING /host/osx/dslink: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devkitPro/install-dsilink/HEAD/host/osx/dslink -------------------------------------------------------------------------------- /installDSiLink.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devkitPro/install-dsilink/HEAD/installDSiLink.bmp -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "dslink"] 2 | path = dslink 3 | url = git@github.com:devkitPro/dslink.git 4 | -------------------------------------------------------------------------------- /host/linux-x86/dslink: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devkitPro/install-dsilink/HEAD/host/linux-x86/dslink -------------------------------------------------------------------------------- /host/windows/dslink.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devkitPro/install-dsilink/HEAD/host/windows/dslink.exe -------------------------------------------------------------------------------- /host/linux-x86_64/dslink: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devkitPro/install-dsilink/HEAD/host/linux-x86_64/dslink -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.elf 3 | *.SAV 4 | build 5 | data 6 | savefiles 7 | installDSiLink.nds 8 | classichack/cwgsum* 9 | cookhack/cooksum* 10 | *.bz2 11 | *.nds 12 | -------------------------------------------------------------------------------- /tblhack/Makefile: -------------------------------------------------------------------------------- 1 | include $(DEVKITARM)/base_tools 2 | 3 | ifeq ($(strip $(COUNTRY)),USA) 4 | ID:=E 5 | endif 6 | 7 | ifeq ($(strip $(COUNTRY)),EU) 8 | ID:=V 9 | endif 10 | 11 | 12 | BASENAME := VBL$(ID) 13 | 14 | TARGET := $(BASENAME).SAV 15 | 16 | $(TARGET): $(BASENAME).elf 17 | $(OBJCOPY) -O binary $< $@ 18 | 19 | $(BASENAME).elf: TBLdslink.s 20 | $(CC) -Ttext=0 -x assembler-with-cpp -D$(COUNTRY) -nostartfiles -nostdlib $< -o $@ 21 | 22 | clean: 23 | rm -f *.SAV *.elf -------------------------------------------------------------------------------- /cookhack/overflow.bin: -------------------------------------------------------------------------------- 1 | __COOK_HACK__AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA+------------------------------+| WinterMute || || http://www.devkitpro.org || || http://drunkencoders.com || || irc.blitzed.org #dsdev || || || || |+------------------------------+ -------------------------------------------------------------------------------- /classichack/Makefile: -------------------------------------------------------------------------------- 1 | include $(DEVKITARM)/base_tools 2 | 3 | UNAME := $(shell uname -s) 4 | 5 | ifneq (,$(findstring MINGW,$(UNAME))) 6 | EXEEXT := .exe 7 | endif 8 | 9 | ifeq ($(strip $(COUNTRY)),USA) 10 | ID:=E 11 | endif 12 | 13 | ifeq ($(strip $(COUNTRY)),UK) 14 | ID:=V 15 | endif 16 | 17 | ifeq ($(strip $(COUNTRY)),FR) 18 | ID:=F 19 | endif 20 | 21 | TARGET := VCW$(ID).SAV 22 | 23 | .PHONY: cwghack.elf 24 | 25 | $(TARGET): cwghack.elf cwgsum$(EXEEXT) 26 | $(OBJCOPY) -O binary $< $@ 27 | ./cwgsum $@ 28 | 29 | cwgsum$(EXEEXT): cwgsum.c 30 | gcc -Wall -O2 $< -o $@ 31 | 32 | cwghack.elf: cwghack.s 33 | $(CC) -Ttext=0 -x assembler-with-cpp -nostartfiles -nostdlib -D$(COUNTRY) $< -o $@ 34 | 35 | clean: 36 | rm -f cwgsum$(EXEEXT) cwghack.elf cwghack.o *.SAV 37 | -------------------------------------------------------------------------------- /cookhack/Makefile: -------------------------------------------------------------------------------- 1 | include $(DEVKITARM)/base_tools 2 | 3 | UNAME := $(shell uname -s) 4 | 5 | ifneq (,$(findstring MINGW,$(UNAME))) 6 | EXEEXT := .exe 7 | endif 8 | 9 | ifeq ($(strip $(COUNTRY)),USA) 10 | ID:=E 11 | endif 12 | 13 | ifeq ($(strip $(COUNTRY)),UK) 14 | ID:=V 15 | endif 16 | 17 | ifeq ($(strip $(COUNTRY)),ES) 18 | ID:=S 19 | endif 20 | 21 | ifeq ($(strip $(COUNTRY)),FR) 22 | ID:=F 23 | endif 24 | 25 | ifeq ($(strip $(COUNTRY)),ITA) 26 | ID:=I 27 | endif 28 | 29 | ifeq ($(strip $(COUNTRY)),GER) 30 | ID:=D 31 | endif 32 | 33 | .PHONY: cookhack.elf 34 | 35 | TARGET := VCK$(ID).SAV 36 | 37 | $(TARGET): cookhack.elf cooksum$(EXEEXT) 38 | $(OBJCOPY) -O binary cookhack.elf $@ 39 | ./cooksum $@ 40 | 41 | cooksum$(EXEEXT): cooksum.c 42 | gcc -Wall -O2 $< -o $@ 43 | 44 | cookhack.elf: cookhack.s overflow.bin Makefile 45 | $(CC) -Ttext=0 -x assembler-with-cpp -D$(COUNTRY) -nostartfiles -nostdlib $< -o $@ 46 | 47 | clean: 48 | rm -f *.SAV cookhack.elf cooksum$(EXEEXT) -------------------------------------------------------------------------------- /classichack/cwgsum.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2009 Dave Murphy (WinterMute) 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | 17 | */ 18 | 19 | // TODO 20 | // make endian safe, assumes little endian 21 | // add checksums for other regions 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | struct saveSlot { 28 | uint32_t id; 29 | uint16_t checksum; 30 | uint16_t flags; 31 | uint8_t data[0xf30]; 32 | }; 33 | 34 | int main(int argc, char *argv[]) { 35 | int i; 36 | struct saveSlot buffer[2]; 37 | 38 | if (argc<2) { 39 | printf("Usage: cwgsum \n"); 40 | exit(1); 41 | } 42 | 43 | 44 | FILE *inputsave = fopen(argv[1],"rb+"); 45 | 46 | if (inputsave==NULL) { 47 | printf("can't open file %s\n",argv[2]); 48 | exit(1); 49 | } 50 | 51 | fread(buffer, sizeof(buffer), 1, inputsave); 52 | 53 | if ( buffer[0].id != 0x800354 && buffer[0].id != 0x400810 && buffer[0].id != 0x800355) { 54 | printf("Not classic word games save file!\n"); 55 | fclose(inputsave); 56 | exit(1); 57 | } 58 | 59 | uint16_t startsum; 60 | 61 | if (buffer[0].id == 0x800354) startsum = 0xfcab; 62 | if (buffer[0].id == 0x800355) startsum = 0xfcaa; 63 | if (buffer[0].id == 0x400810) startsum = 0xf7ef; 64 | 65 | int slot; 66 | uint16_t currentsum,sum; 67 | 68 | for(slot=0;slot<2;slot++) { 69 | currentsum = buffer[slot].checksum; 70 | 71 | sum=startsum; 72 | uint8_t *b = buffer[slot].data; 73 | 74 | for (i = 0; i < sizeof(buffer[0].data); i++) { 75 | sum -= b[i]; 76 | } 77 | 78 | if (sum != currentsum) { 79 | printf("Fixing checksum - %04X\n",sum); 80 | buffer[slot].checksum = sum; 81 | fseek(inputsave,sizeof(buffer[0])*slot+4,SEEK_SET); 82 | fwrite(&sum,2,1,inputsave); 83 | } else { 84 | printf("SUM OK!\n"); 85 | } 86 | } 87 | 88 | fclose(inputsave); 89 | 90 | return 0; 91 | } 92 | -------------------------------------------------------------------------------- /cookhack/cooksum.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2009 Dave Murphy (WinterMute) 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | 17 | */ 18 | 19 | // TODO 20 | // make endian safe, assumes little endian 21 | // add checksums for other regions 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | struct saveSlotHeader { 28 | uint32_t id; 29 | uint16_t checksum; 30 | uint16_t flags; 31 | }; 32 | 33 | 34 | int main(int argc, char *argv[]) { 35 | int i; 36 | if (argc<2) { 37 | printf("Usage: cooksum \n"); 38 | exit(1); 39 | } 40 | 41 | FILE *f = fopen(argv[1], "rb+"); 42 | 43 | if (f==NULL) { 44 | printf("can't open file %s\n",argv[1]); 45 | exit(1); 46 | } 47 | 48 | uint8_t buffer[8192]; 49 | 50 | fread(buffer, sizeof(buffer), 1, f); 51 | 52 | struct saveSlotHeader *slotHeader = (struct saveSlotHeader *)buffer; 53 | 54 | if ( (slotHeader->id >> 8)!= 0x56434B ) { 55 | printf("Not cooking coach save file!\n"); 56 | exit(1); 57 | } 58 | 59 | int slot=0; 60 | unsigned short currentsum,sum,startsum=0; 61 | 62 | int country = slotHeader->id & 0xff; 63 | 64 | startsum = 0xb4ff - country; 65 | 66 | int slotOffset[] = { 67 | 0, 68 | 0x378, 69 | 0xBD0, 70 | 0xF04, 71 | 0x1238, 72 | 0x1F77 73 | }; 74 | 75 | for(slot=0;slot<5;slot++) { 76 | 77 | int offset = slotOffset[slot]; 78 | 79 | slotHeader = (struct saveSlotHeader *)&buffer[offset]; 80 | currentsum = slotHeader->checksum; 81 | printf("Slot %d Current checksum: %04X -- ",slot, currentsum); 82 | 83 | sum = startsum; 84 | for (i = 0; i < (slotOffset[slot+1] - (offset + 8)); i++) { 85 | sum -= buffer[offset + 8 + i]; 86 | } 87 | 88 | if (sum != currentsum) { 89 | printf("Fixing checksum - %04X\n",sum); 90 | fseek(f, slotOffset[slot]+0x04, SEEK_SET); 91 | fwrite(&sum, 2, 1, f); 92 | } else { 93 | printf("SUM OK!\n"); 94 | } 95 | } 96 | 97 | fclose(f); 98 | 99 | 100 | return 0; 101 | } 102 | -------------------------------------------------------------------------------- /source/installDSiLink.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Dave Murphy (WinterMute) 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | 17 | */ 18 | #include 19 | 20 | #include 21 | #include 22 | 23 | #include "dslink_nds.h" 24 | #include "bootstub_bin.h" 25 | 26 | 27 | struct fwheader { 28 | void *arm7FWaddress; 29 | void *arm7load; 30 | unsigned int arm7size; 31 | void *arm7execute; 32 | 33 | void *arm9FWaddress; 34 | void *arm9load; 35 | unsigned int arm9size; 36 | void *arm9execute; 37 | 38 | }; 39 | 40 | char booter[2048]; 41 | char *fwbase = (char *)0x10000; 42 | 43 | 44 | char readbuf[256]; 45 | 46 | bool fwWriteBinary(void *address, void *buffer, int size) { 47 | 48 | int blocks = (size + 255) /256; 49 | 50 | int i; 51 | 52 | for ( i = 0; i < blocks; i++ ) { 53 | 54 | iprintf("writing block %d of %d\r", i+1, blocks); 55 | 56 | readFirmware((u32)address, readbuf, 256); 57 | 58 | if (memcmp(readbuf,buffer,256)) { 59 | writeFirmware((u32)address,buffer,256); 60 | readFirmware((u32)address, readbuf, 256); 61 | if (memcmp(readbuf,buffer,256)) break; 62 | } 63 | 64 | address += 256; 65 | buffer += 256; 66 | } 67 | iprintf("\n"); 68 | return (i == blocks); 69 | } 70 | 71 | 72 | void installDSiLink() { 73 | 74 | tNDSHeader *ndsfile = (tNDSHeader *)dslink_nds; 75 | 76 | memcpy(booter,bootstub_bin,bootstub_bin_size); 77 | 78 | struct fwheader *fwhdr = (struct fwheader*)(&booter[4]); 79 | 80 | fwhdr->arm7load = ndsfile->arm7destination; 81 | fwhdr->arm7execute = ndsfile->arm7executeAddress; 82 | fwhdr->arm7size = ndsfile->arm7binarySize; 83 | 84 | fwhdr->arm9load = ndsfile->arm9destination; 85 | fwhdr->arm9execute = ndsfile->arm9executeAddress; 86 | fwhdr->arm9size = ndsfile->arm9binarySize; 87 | 88 | fwhdr->arm7FWaddress = fwbase + 2048; 89 | fwhdr->arm9FWaddress = fwbase + 2048 + ((fwhdr->arm7size + 255) & ~255); 90 | 91 | u8 *arm7bin = (u8 *)(ndsfile->arm7romOffset + (u32)ndsfile); 92 | 93 | u8 *arm9bin = (u8 *)(ndsfile->arm9romOffset + (u32)ndsfile); 94 | 95 | if (!fwWriteBinary(fwhdr->arm7FWaddress,arm7bin,fwhdr->arm7size)) { 96 | iprintf ("failed writing arm7 code\n"); 97 | return; 98 | } 99 | 100 | if (!fwWriteBinary(fwhdr->arm9FWaddress,arm9bin,fwhdr->arm9size)) { 101 | iprintf ("failed writing arm9 code\n"); 102 | return; 103 | } 104 | 105 | if (!fwWriteBinary(fwbase,booter,2048)) { 106 | iprintf ("failed writing boot code\n"); 107 | return; 108 | } 109 | } 110 | 111 | char firmware_buffer[512]; 112 | 113 | int main(int argc, char ** argv) { 114 | 115 | 116 | consoleDemoInit(); 117 | iprintf("DSi dslink installer.\n\n"); 118 | 119 | readFirmware(0, firmware_buffer, 512); 120 | // FIXME first read is blank on DSi 121 | readFirmware(0, firmware_buffer, 512); 122 | 123 | bool onDSi = (firmware_buffer[29] == 0x57); 124 | 125 | if (onDSi) { 126 | iprintf("Press A,B,X,Y to install.\n\n"); 127 | } else { 128 | iprintf("Can't install on this console!\n"); 129 | } 130 | 131 | iprintf("Press start to exit.\n"); 132 | 133 | int buttonseq[] = { KEY_A, KEY_B, KEY_X, KEY_Y, -1}; 134 | 135 | int seq = 0; 136 | 137 | while(1) { 138 | 139 | if(buttonseq[seq] == -1) { 140 | seq = 0; 141 | if (onDSi) installDSiLink(); 142 | } 143 | 144 | swiWaitForVBlank(); 145 | scanKeys(); 146 | 147 | int press = keysDown(); 148 | 149 | if ( press & KEY_START) break; 150 | 151 | if (press) { 152 | if (press&buttonseq[seq]) { 153 | seq++; 154 | } else { 155 | seq = 0; 156 | } 157 | } 158 | 159 | } 160 | return 0; 161 | } -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------------------- 2 | .SUFFIXES: 3 | #--------------------------------------------------------------------------------- 4 | ifeq ($(strip $(DEVKITARM)),) 5 | $(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") 6 | endif 7 | 8 | include $(DEVKITARM)/base_tools 9 | 10 | export TOPDIR := $(CURDIR) 11 | 12 | SAVEFILES := VCKV.SAV VCKE.SAV VCKS.SAV VCKF.SAV VCKI.SAV VCKD.SAV \ 13 | VCWV.SAV VCWE.SAV VCWF.SAV VBLE.SAV VBLV.SAV 14 | 15 | .PHONY: checkdslink 16 | 17 | VERSION := $(shell cd dslink && git describe --abbrev=0 --tags) 18 | 19 | #--------------------------------------------------------------------------------- 20 | # canned command sequence for binary data 21 | #--------------------------------------------------------------------------------- 22 | define bin2o 23 | bin2s $< | $(AS) -o $(@) 24 | echo "extern const u8" `(echo $( `(echo $(@D)/$(> `(echo $(@D)/$(> `(echo $(@D)/$(. 16 | 17 | */#define REG_BASE 0x04000000 18 | 19 | 20 | .global _start 21 | _start: 22 | 23 | .word 0x44495347, 0xa505df1b, 0x00000001, 0x1e03e828 24 | .byte 0x01 25 | 26 | .space _start + 0x00000023 - . , 0x00 @ 18 bytes 27 | 28 | .ascii "A little hack from WinterMute for 2015. Happy new year, one and all!" 29 | 30 | .space _start + 0x00000087 - . , 0x20 31 | 32 | #if defined(USA) 33 | .byte 0x64, 0xe3, 0x11, 0x02, 0 34 | #elif defined(EU) 35 | .byte 0x04, 0xe6, 0x11, 0x02, 0 36 | #else 37 | 38 | #error "Currently unrecognised country" 39 | 40 | #endif 41 | 42 | haxx: 43 | mov r0, #REG_BASE 44 | str r0, [r0, #0x208] @ IME = 0; 45 | 46 | mov r1, #0 47 | strh r1, [r0, #0x6c] 48 | strh r1, [r0, #0x50] 49 | 50 | mov r2, #0x1000 51 | add r3, r2, r0 52 | strh r1, [r3, #0x6c] 53 | strh r1, [r3, #0x50] 54 | 55 | mov r12, r0 56 | 57 | add r2, r2, r0 58 | 59 | mov r3, #0x58 60 | bl memset 61 | 62 | ldr r3, dispcnt 63 | str r3, [r0] 64 | str r3, [r2] 65 | 66 | mov r5, #0x200 67 | str r5, [r0, #0x08] 68 | str r5, [r2, #0x08] 69 | 70 | add r0, r0, #0x240 71 | str r1, [r0] 72 | strh r1, [r0, #0x04] 73 | strb r1, [r0, #0x06] 74 | strb r1, [r0, #0x08] 75 | 76 | mov r1, #0x81 77 | strb r1, [r0] 78 | mov r1, #0x84 79 | strb r1, [r0,#0x02] 80 | 81 | mov r4, #0x05000000 @ engine A palette 82 | 83 | mov r1, #0x1f 84 | str r1, [r4] 85 | str r1, [r4,#0x400] @ engine B palette 86 | 87 | add r0, r4, #0x01000000 88 | add r2, r0, #0x00200000 89 | 90 | mov r1, #0 91 | mov r3, #0x1800 92 | bl memset 93 | 94 | 95 | ldr r0, =0x00002078 @ disable TCM and protection unit 96 | mcr p15, 0, r0, c1, c0 97 | 98 | @ Disable caches 99 | mov r0, #0 100 | mcr p15, 0, r0, c7, c5, 0 @ Instruction cache 101 | mcr p15, 0, r0, c7, c6, 0 @ Data cache 102 | 103 | @ Wait for write buffer to empty 104 | mcr p15, 0, r0, c7, c10, 4 105 | 106 | mov r1, #0x3e0 107 | str r1, [r4] 108 | 109 | mov r0, #0x40000 110 | add r0, #0xC 111 | str r0, [r12, #0x188] 112 | 113 | add r3, r12, #0x180 @ r3 = 4000180 114 | 115 | ldr r5,=0x2fffc24 116 | 117 | ldr r0,=0x4004008 118 | ldr r0,[r0] 119 | ands r0,r0,#0x8000 120 | beq notDSi 121 | 122 | mov r2, #4 123 | strh r2, [r5,#4] 124 | bl wait_dsi7 125 | mov r2, #3 126 | strh r2, [r5,#4] 127 | bl wait_dsi7 128 | 129 | notDSi: 130 | 131 | mov r2, #0xffffffff 132 | str r2, [r4,#0x400] @ engine B palette 133 | 134 | mov r2,#1 135 | bl waitsync 136 | 137 | adr r0,arm7branch 138 | ldr r1,=0x02380000 139 | ldr r2,[r0],#4 140 | str r2,[r1],#4 141 | ldr r2,[r0],#4 142 | str r2,[r1],#4 143 | 144 | mov r2, #0x80 145 | strb r2, [r12,#0x243] 146 | 147 | adr r5,arm7_start 148 | adr r7,arm7_end 149 | ldr r6,=0x6860000 150 | copyloop: 151 | ldr r0,[r5],#4 152 | str r0,[r6],#4 153 | cmp r5,r7 154 | bne copyloop 155 | 156 | mov r2, #0x82 157 | strb r2, [r12,#0x243] 158 | 159 | mov r0, #0x100 160 | strh r0, [r3] 161 | 162 | mov r2,#0 163 | bl waitsync 164 | 165 | mov r0, #0 166 | strh r0, [r3] 167 | 168 | mov r2,#5 169 | bl waitsync 170 | 171 | str r1, [r4,#0x400] @ engine B palette 172 | 173 | ldr r10,=0x02FFFE04 174 | str r10,[r10,#0x20] 175 | ldr r2,=0xE59FF018 176 | str r2,[r10] 177 | 178 | bx r10 179 | 180 | .pool 181 | 182 | dispcnt: 183 | .word 0x10100 184 | arm7branch: 185 | mov r0,#0x06000000 186 | bx r0 187 | 188 | memset: 189 | 190 | .clrloop: 191 | subs r3, r3, #4 192 | str r1, [r0,r3] 193 | str r1, [r2,r3] 194 | bne .clrloop 195 | bx lr 196 | 197 | wait_dsi7: 198 | ldrh r0,[r5,#2] 199 | .wait7: 200 | ldrh r6,[r5,#2] 201 | cmp r6,r0 202 | beq .wait7 203 | 204 | ldrh r0,[r5] 205 | add r0,r0,#1 206 | strh r0,[r5] 207 | bx lr 208 | 209 | waitsync: 210 | ldrh r0, [r3] 211 | and r0, r0, #0x000f 212 | cmp r0, r2 213 | bne waitsync 214 | bx lr 215 | 216 | 217 | arm7_start: 218 | mov r12, #REG_BASE 219 | str r12, [r12, #0x208] @ IME = 0; 220 | add r3, r12, #0x180 221 | mov r0,#0x500 222 | strh r0,[r3] 223 | b fwload 224 | 225 | writeread: 226 | ldr r3, =0x4000100 227 | strh r0, [r3, #0xc2] 228 | .L2: 229 | ldrh r2, [r3, #0xc0] 230 | tst r2, #128 231 | bne .L2 232 | ldrh r0, [r3, #0xc2] 233 | bx lr 234 | 235 | .pool 236 | 237 | 238 | fwload: 239 | ldr r5, =0x04000100 240 | mov r4, #0 241 | mov r6, #0x8900 242 | strh r6, [r5, #0xc0] 243 | mov r0, #3 @ 244 | bl writeread 245 | mov r0, #1 @ >>16 246 | bl writeread 247 | mov r0, r4 @ >>8 248 | bl writeread 249 | mov r0, r4 @ >>0 250 | bl writeread 251 | ldr r4, =0x06008000 252 | add r5, r4, #2048 253 | .load: 254 | mov r0, #0 255 | bl writeread 256 | strb r0, [r4],#1 257 | cmp r4, r5 258 | bne .load 259 | 260 | ldr r3, =0x04000100 261 | mov r2, #0 262 | strh r2, [r3, #0xc0] 263 | 264 | ldr r4, =0x06008000 265 | bx r4 266 | 267 | .pool 268 | 269 | arm7_end: 270 | 271 | 272 | .space _start + 0x00002000 - . , 0xff 273 | -------------------------------------------------------------------------------- /classichack/cwghack.s: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2009 Dave Murphy (WinterMute) 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | 17 | */ 18 | 19 | #if defined(USA) 20 | #define CODE 0x400810 21 | #endif 22 | 23 | #if defined(UK) 24 | #define CODE 0x800354 25 | #endif 26 | 27 | #if defined(FR) 28 | #define CODE 0x800355 29 | #endif 30 | 31 | #define REG_BASE 0x04000000 32 | 33 | .global _start 34 | 35 | _start: 36 | .word CODE 37 | .hword 1 38 | .hword 0x0203 39 | 40 | .ascii "__CWG_HACK__" 41 | .word 0x010A010A, 0xAAAAAAAA, 0xAAAAAAAA, 0x01010266 42 | .word 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA 43 | .word 0x01010101, 0xAAAAAAAA, 0x02EB4E18, 0xAAAAAAAA 44 | .word 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA 45 | .word 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA 46 | 47 | 48 | 49 | .space (_start + 0x0f38) - . 50 | 51 | .word CODE 52 | .hword 2 53 | .hword 0x0202 54 | 55 | .ascii "_WinterMute_" 56 | 57 | .space (_start + 0x0f80) - . 58 | 59 | mov r0, #REG_BASE 60 | str r0, [r0, #0x208] @ IME = 0; 61 | 62 | mov r1, #0 63 | strh r1, [r0, #0x6c] 64 | 65 | mov r2, #0x1000 66 | add r3, r2, r0 67 | strh r1, [r3, #0x6c] 68 | 69 | mov r12, r0 70 | 71 | add r2, r2, r0 72 | 73 | mov r3, #0x58 74 | bl memset 75 | 76 | ldr r3, dispcnt 77 | str r3, [r0] 78 | str r3, [r2] 79 | 80 | mov r5, #0x200 81 | str r5, [r0, #0x08] 82 | str r5, [r2, #0x08] 83 | 84 | add r0, r0, #0x240 85 | str r1, [r0] 86 | strh r1, [r0, #0x04] 87 | strb r1, [r0, #0x06] 88 | strb r1, [r0, #0x08] 89 | 90 | mov r1, #0x81 91 | strb r1, [r0] 92 | mov r1, #0x84 93 | strb r1, [r0,#0x02] 94 | 95 | mov r4, #0x05000000 @ engine A palette 96 | 97 | mov r1, #0x1f 98 | str r1, [r4] 99 | str r1, [r4,#0x400] @ engine B palette 100 | 101 | add r0, r4, #0x01000000 102 | add r2, r0, #0x00200000 103 | 104 | mov r1, #0 105 | mov r3, #0x1800 106 | bl memset 107 | 108 | 109 | ldr r0, =0x00002078 @ disable TCM and protection unit 110 | mcr p15, 0, r0, c1, c0 111 | 112 | @ Disable caches 113 | mov r0, #0 114 | mcr p15, 0, r0, c7, c5, 0 @ Instruction cache 115 | mcr p15, 0, r0, c7, c6, 0 @ Data cache 116 | 117 | @ Wait for write buffer to empty 118 | mcr p15, 0, r0, c7, c10, 4 119 | 120 | mov r1, #0x3e0 121 | str r1, [r4] 122 | 123 | mov r0, #0x40000 124 | add r0, #0xC 125 | str r0, [r12, #0x188] 126 | 127 | add r3, r12, #0x180 @ r3 = 4000180 128 | 129 | ldr r5,=0x2fffc24 130 | 131 | mov r2,#4 132 | strh r2,[r5,#4] 133 | bl wait_dsi7 134 | mov r2,#3 135 | strh r2,[r5,#4] 136 | bl wait_dsi7 137 | 138 | mov r2, #0xffffffff 139 | str r2, [r4,#0x400] @ engine B palette 140 | 141 | mov r2,#1 142 | bl waitsync 143 | 144 | adr r0,arm7branch 145 | ldr r1,=0x02380000 146 | ldr r2,[r0],#4 147 | str r2,[r1],#4 148 | ldr r2,[r0],#4 149 | str r2,[r1],#4 150 | 151 | mov r2, #0x80 152 | strb r2, [r12,#0x243] 153 | 154 | adr r5,arm7_start 155 | adr r7,arm7_end 156 | ldr r6,=0x6860000 157 | copyloop: 158 | ldr r0,[r5],#4 159 | str r0,[r6],#4 160 | cmp r5,r7 161 | bne copyloop 162 | 163 | mov r2, #0x82 164 | strb r2, [r12,#0x243] 165 | 166 | mov r0, #0x100 167 | strh r0, [r3] 168 | 169 | mov r2,#0 170 | bl waitsync 171 | 172 | mov r0, #0 173 | strh r0, [r3] 174 | 175 | mov r2,#5 176 | bl waitsync 177 | 178 | str r1, [r4,#0x400] @ engine B palette 179 | 180 | ldr r10,=0x02FFFE04 181 | str r10,[r10,#0x20] 182 | ldr r2,=0xE59FF018 183 | str r2,[r10] 184 | 185 | bx r10 186 | 187 | .pool 188 | 189 | dispcnt: 190 | .word 0x10100 191 | arm7branch: 192 | mov r0,#0x06000000 193 | bx r0 194 | 195 | memset: 196 | 197 | .clrloop: 198 | subs r3, r3, #4 199 | str r1, [r0,r3] 200 | str r1, [r2,r3] 201 | bne .clrloop 202 | bx lr 203 | 204 | wait_dsi7: 205 | ldrh r0,[r5,#2] 206 | .wait7: 207 | ldrh r6,[r5,#2] 208 | cmp r6,r0 209 | beq .wait7 210 | 211 | ldrh r0,[r5] 212 | add r0,r0,#1 213 | strh r0,[r5] 214 | bx lr 215 | 216 | waitsync: 217 | ldrh r0, [r3] 218 | and r0, r0, #0x000f 219 | cmp r0, r2 220 | bne waitsync 221 | bx lr 222 | 223 | 224 | arm7_start: 225 | mov r12, #REG_BASE 226 | str r12, [r12, #0x208] @ IME = 0; 227 | add r3, r12, #0x180 228 | mov r0,#0x500 229 | strh r0,[r3] 230 | b fwload 231 | 232 | writeread: 233 | ldr r3, =0x4000100 234 | strh r0, [r3, #0xc2] 235 | .L2: 236 | ldrh r2, [r3, #0xc0] 237 | tst r2, #128 238 | bne .L2 239 | ldrh r0, [r3, #0xc2] 240 | bx lr 241 | 242 | .pool 243 | 244 | 245 | fwload: 246 | ldr r5, =0x04000100 247 | mov r4, #0 248 | mov r6, #0x8900 249 | strh r6, [r5, #0xc0] 250 | mov r0, #3 @ 251 | bl writeread 252 | mov r0, #1 @ >>16 253 | bl writeread 254 | mov r0, r4 @ >>8 255 | bl writeread 256 | mov r0, r4 @ >>0 257 | bl writeread 258 | ldr r4, =0x06008000 259 | add r5, r4, #2048 260 | .load: 261 | mov r0, #0 262 | bl writeread 263 | strb r0, [r4],#1 264 | cmp r4, r5 265 | bne .load 266 | 267 | ldr r3, =0x04000100 268 | mov r2, #0 269 | strh r2, [r3, #0xc0] 270 | 271 | ldr r4, =0x06008000 272 | bx r4 273 | 274 | .pool 275 | 276 | arm7_end: 277 | 278 | .space (_start + 8192) - . 279 | 280 | -------------------------------------------------------------------------------- /README.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | DS(i)Link 7 | 31 | 32 |
33 |
34 |

WARNING

35 |

Use of this software will most probably invalidate your console 36 | warranty, proceed with installation at your own risk. The software 37 | installs in an unused portion of the flash chip on the wifi module but 38 | is still what Nintendo term an unauthorised modification.

39 |

LICENSE

40 |

Copyright (c) 2010 - 2015 Dave Murphy

41 |

Any redistribution or reproduction of part or all this software in any form is prohibited other than the following: 42 |

    43 |
  • You may make as many copies of the software as you require for your own personal use.
  • 44 |
  • You may copy the complete, unmodified archive to individual third 45 | parties for their personal use, but may not place it on websites or 46 | torrent trackers.
  • 47 |
48 | You may not, except with my express written permission, distribute or 49 | commercially exploit the software. Nor may you transmit it or store it 50 | in any other website. 51 | 52 |

The Software shall be used for Good, not Evil.

53 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 54 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 55 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 56 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 57 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 58 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 59 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

60 |

Overview

61 |

dslink is a simple and effective method to transfer homebrew games 62 | and applications to your DS(i) over wifi. Simply run dslink.nds on your 63 | DS console, wait for it to connect and use the command line dslink host 64 | tool to send an nds file. 65 |

	dslink [-a ip address] <ndsfile>
 66 | 
67 |

68 |

The dslink host uses UDP broadcast messages to discover your DS 69 | but this won't work for some people due to routers either not passing on 70 | these packets or sending them at a speed the DS can't read. If you get 71 | "No Response from DS!" then try specifiying the ip address of your DS 72 | with the -a switch.

73 |

DSi mode

74 |

Here's the part most people will probably be interested in, homebrew running in DSi mode.

75 |

While playing around with the save game exploits for Cooking Coach 76 | and Classic Word Games I created back in 2010 I discovered two things 77 | about the flashchip on the wifi module where the firmware would be stored 78 | on a normal DS. (1) It contains only the setup data for wifi, the user settings 79 | and the wifi connection settings and, (2) Part of it is writable, from DS mode. This 80 | was what finally gave me the motivation to revisit an old project to 81 | upload homebrew to the DS over wifi.

82 |

installDSiLink.nds will, when run from a DSi compatible card in DS 83 | mode, write the dslink client to the wifi flash chip and this can then 84 | be bootstrapped from the save game exploits mentioned above. You'll need 85 | to write the appropriate .SAV file from this archive to your game of 86 | choice from either a DS with eepinator 87 | or use one of the save game transfer devices around. Cooking Coach is 88 | more convenient since the exploit kicks in just after the splash screen, 89 | with Classic Word Games you need to go through a couple of menu 90 | options.

91 |

Unfortunately testing revealed that later model DSi and XL consoles 92 | have had changes made to the wifi board which means that writing to the 93 | firmware flash chip is no longer possible. You'll know if you have one 94 | of these consoles if either the installer fails to write the loader or 95 | the loader fails to connect when bootstrapped. Sorry if you have one of 96 | these consoles, you'll have to wait a little bit longer to play with DSi 97 | mode.

98 |

In March 2012 Nintendo released firmware version 1.4.4 which checks for these 99 | exploits and writes a 0 to the end of the string before launching the games. 100 |

At the end of 2014 we found another exploitable DSi hybrid game - The Biggest Loser USA 101 | and this archive now contains save file exploits for the EU and US versions. 102 |

103 |

libnds still needs some more updates to deal with DSi mode features, 104 | currently the swi decompression functions seem to have changed and we 105 | have no microphone input. Hopefully now there's a reasonably 106 | straightforward way to run code we can get a few more people looking at 107 | what we need to change and how best to approach it.

108 |

Archive Listing

109 |

110 |

    111 |
  • README.html - this file.
  • 112 |
  • savefiles/VBLE.SAV - save game for The Biggest Loser, US version.
  • 113 |
  • savefiles/VBLV.SAV - save game for The Biggest Loser, UK/EU version.
  • 114 |
  • savefiles/VCKE.SAV - save game for Cooking Coach, US version.
  • 115 |
  • savefiles/VCKS.SAV - save game for Cooking Coach, Spanish version.
  • 116 |
  • savefiles/VCKV.SAV - save game for Cooking Coach, UK/EU version.
  • 117 |
  • savefiles/VCKF.SAV - save game for Cooking Coach, French version.
  • 118 |
  • savefiles/VCKI.SAV - save game for Cooking Coach, Italian version.
  • 119 |
  • savefiles/VCKD.SAV - save game for Cooking Coach, German version.
  • 120 |
  • savefiles/VCWE.SAV - save game for Classic Word Games, US version.
  • 121 |
  • savefiles/VCWV.SAV - save game for Classic Word Games, UK/EU version.
  • 122 |
  • savefiles/VCWF.SAV - save game for Bravissi Mots, French version.
  • 123 |
  • installDSiLink.nds - writes the wifi loader to the wifi flash chip on DSi.
  • 124 |
  • dslink.nds - DS/DSi version of the wifi upload client.
  • 125 |
  • host/osx/dslink - host application compiled for Mac OSX, 10.4 universal binary.
  • 126 |
  • host/windows/dslink.exe - host application compiled for windows
  • 127 |
  • host/linux-x86/dslink - host application compiled for 32bit x86 linux
  • 128 |
  • host/linux-x86_64/dslink - host application compiled for 64bit x86 linux
  • 129 |
130 | 131 |
132 | -------------------------------------------------------------------------------- /cookhack/cookhack.s: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2009 Dave Murphy (WinterMute) 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | 17 | */ 18 | 19 | .global _start 20 | 21 | #if defined(USA) 22 | 23 | #define CODE 0x56434B45 24 | #define JUMP 0x02179AB8 25 | 26 | #elif defined(UK) 27 | 28 | #define CODE 0x56434B56 29 | #define JUMP 0x02179C98 30 | 31 | #elif defined(ES) 32 | 33 | #define CODE 0x56434B53 34 | #define JUMP 0x02179C94 35 | 36 | #elif defined(FR) 37 | 38 | #define CODE 0x56434B46 39 | #define JUMP 0x02179BA0 40 | 41 | #elif defined(ITA) 42 | 43 | #define CODE 0x56434B49 44 | #define JUMP 0x02179c40 45 | 46 | #elif defined(GER) 47 | 48 | #define CODE 0x56434B44 49 | #define JUMP 0x02179C60 50 | 51 | #else 52 | 53 | #error "Currently unrecognised country" 54 | 55 | #endif 56 | 57 | #define REG_BASE 0x04000000 58 | 59 | _start: 60 | .word CODE 61 | .hword 1 62 | .hword 0x0203 63 | 64 | .incbin "overflow.bin" 65 | 66 | #if !defined(ES) 67 | .byte 0x20 68 | .word 0x20202020, 0x20202020 69 | #endif 70 | 71 | #if defined(FR) || defined(ITA) 72 | .hword 0x5555 73 | #if defined(ITA) 74 | .word 0x55555555 75 | #endif 76 | .word JUMP 77 | .word 0x00414141 78 | .hword 0x4141 79 | #elif defined(GER) 80 | .byte 0x55 81 | .word JUMP 82 | #else 83 | .word 0x55555555 84 | .word JUMP 85 | .word 0x00414141 86 | #endif 87 | 88 | .align 2 89 | 90 | mov r12, #REG_BASE 91 | str r12, [r12, #0x208] @ IME = 0; 92 | 93 | ldr r0, =0x00002078 @ disable TCM and protection unit 94 | mcr p15, 0, r0, c1, c0 95 | 96 | @ Disable caches 97 | mov r0, #0 98 | mcr p15, 0, r0, c7, c5, 0 @ Instruction cache 99 | mcr p15, 0, r0, c7, c6, 0 @ Data cache 100 | 101 | @ Wait for write buffer to empty 102 | mcr p15, 0, r0, c7, c10, 4 103 | 104 | mov r1, #0 105 | strh r1, [r12, #0x6c] 106 | 107 | mov r2, #0x1000 108 | add r3, r2, r12 109 | strh r1, [r3, #0x6c] 110 | 111 | add r11, r12, #0x1a0 112 | 113 | ldrh r0,[r11,#0x204-0x1a0] 114 | and r0,r0,#~(1<<11) 115 | strh r0,[r11,#0x204-0x1a0] 116 | 117 | ldr r0, eepromselect 118 | strh r0,[r11] 119 | 120 | mov r0,#03 121 | strb r0,[r11,#0x02] 122 | bl eepromwait 123 | 124 | mov r0,#0 125 | strb r0,[r11,#0x02] 126 | bl eepromwait 127 | 128 | mov r0,#0 129 | strb r0,[r11,#0x02] 130 | bl eepromwait 131 | 132 | mov r1,#0x02300000 133 | add r2,r1,#0x2000 134 | 135 | readeeprom: 136 | mov r0,#0 137 | strb r0,[r11,#0x02] 138 | 139 | bl eepromwait 140 | ldrb r0,[r11,#0x02] 141 | strb r0,[r1],#1 142 | cmp r1,r2 143 | bne readeeprom 144 | 145 | mov r0,#0x40 146 | strh r0,[r11] 147 | 148 | adr r0,stage2 149 | adr r1,_start 150 | sub r0,r0,r1 151 | add r0,#0x02300000 152 | bx r0 153 | 154 | eepromwait: 155 | ldrh r0,[r11] 156 | tst r0, #128 157 | bne eepromwait 158 | bx lr 159 | 160 | .space (_start + 0x2d8) - . 161 | .word 0xFFFF0000, 0 162 | eepromselect: 163 | .word 0xA040 164 | 165 | .pool 166 | 167 | .space (_start + 0x378) - . 168 | .word CODE 169 | .hword 2 170 | .hword 0x0202 171 | 172 | stage2: 173 | mov r2, #0x1000 174 | add r2,r2,r12 175 | mov r0,r12 176 | ldr r3, dispcnt 177 | str r3, [r0] 178 | str r3, [r2] 179 | 180 | mov r5, #0x200 181 | str r5, [r0, #0x08] 182 | str r5, [r2, #0x08] 183 | 184 | mov r1, #0 185 | add r0, r0, #0x240 186 | str r1, [r0] 187 | strh r1, [r0, #0x04] 188 | strb r1, [r0, #0x06] 189 | strb r1, [r0, #0x08] 190 | 191 | mov r1, #0x81 192 | strb r1, [r0] 193 | mov r1, #0x84 194 | strb r1, [r0,#0x02] 195 | 196 | mov r4, #0x05000000 @ engine A palette 197 | 198 | mov r1, #0x1f 199 | str r1, [r4] 200 | str r1, [r4,#0x400] @ engine B palette 201 | 202 | add r0, r4, #0x01000000 203 | add r2, r0, #0x00200000 204 | 205 | mov r1, #0 206 | mov r3, #0x1800 207 | bl memset 208 | 209 | mov r0, #0x40000 210 | add r0, #0xC 211 | str r0, [r12, #0x188] 212 | 213 | add r3, r12, #0x180 @ r3 = 4000180 214 | 215 | ldr r5,=0x2fffc24 216 | 217 | ldr r0,=0x4004008 218 | ldr r0,[r0] 219 | ands r0,r0,#0x8000 220 | beq notDSi 221 | 222 | mov r2, #4 223 | strh r2, [r5,#4] 224 | bl wait_dsi7 225 | mov r2, #3 226 | strh r2, [r5,#4] 227 | bl wait_dsi7 228 | 229 | notDSi: 230 | mov r2, #1 231 | bl waitsync 232 | 233 | mov r1, #0x3e0 234 | str r1, [r4] 235 | 236 | mov r1, #0x80 237 | strb r1, [r12,#0x243] 238 | 239 | adr r5, arm7_start 240 | adr r7, arm7_end 241 | ldr r6, =0x6860000 242 | copyloop: 243 | ldr r0, [r5],#4 244 | str r0, [r6],#4 245 | cmp r5, r7 246 | bne copyloop 247 | 248 | adr r0,arm7branch 249 | ldr r1,=0x02380000 250 | ldr r2,[r0],#4 251 | str r2,[r1],#4 252 | ldr r2,[r0],#4 253 | str r2,[r1],#4 254 | mov r1, #0x3e0 255 | 256 | mov r2, #0x82 257 | strb r2, [r12,#0x243] 258 | 259 | mov r0, #0x100 260 | strh r0, [r3] 261 | 262 | mov r2, #0 263 | bl waitsync 264 | 265 | mov r0, #0 266 | strh r0, [r3] 267 | 268 | ldr r10,=0x02FFFE04 269 | str r10,[r10,#0x20] 270 | ldr r2,=0xE59FF018 271 | str r2,[r10] 272 | 273 | bx r10 274 | 275 | arm7branch: 276 | mov r0,#0x06000000 277 | bx r0 278 | 279 | .pool 280 | 281 | dispcnt: 282 | .word 0x10100 283 | 284 | memset: 285 | 286 | .clrloop: 287 | subs r3, r3, #4 288 | str r1, [r0,r3] 289 | str r1, [r2,r3] 290 | bne .clrloop 291 | bx lr 292 | 293 | wait_dsi7: 294 | ldrh r0,[r5,#2] 295 | .wait7: 296 | ldrh r6,[r5,#2] 297 | cmp r6,r0 298 | beq .wait7 299 | 300 | ldrh r0,[r5] 301 | add r0,r0,#1 302 | strh r0,[r5] 303 | bx lr 304 | 305 | waitsync: 306 | ldrh r0, [r3] 307 | and r0, r0, #0x000f 308 | cmp r0, r2 309 | bne waitsync 310 | bx lr 311 | 312 | .cpu arm7tdmi 313 | 314 | arm7_start: 315 | mov r12, #REG_BASE 316 | str r12, [r12, #0x208] @ IME = 0; 317 | add r3, r12, #0x180 318 | mov r0,#0x100 319 | strh r0,[r3] 320 | b fwload 321 | 322 | writeread: 323 | ldr r3, =0x4000100 324 | strh r0, [r3, #0xc2] 325 | .L2: 326 | ldrh r2, [r3, #0xc0] 327 | tst r2, #128 328 | bne .L2 329 | ldrh r0, [r3, #0xc2] 330 | bx lr 331 | 332 | .pool 333 | 334 | 335 | fwload: 336 | ldr r5, =0x04000100 337 | mov r4, #0 338 | mov r6, #0x8900 339 | strh r6, [r5, #0xc0] 340 | mov r0, #3 @ 341 | bl writeread 342 | mov r0, #1 @ >>16 343 | bl writeread 344 | mov r0, r4 @ >>8 345 | bl writeread 346 | mov r0, r4 @ >>0 347 | bl writeread 348 | ldr r4, =0x06008000 349 | add r5, r4, #2048 350 | .load: 351 | mov r0, #0 352 | bl writeread 353 | strb r0, [r4],#1 354 | cmp r4, r5 355 | bne .load 356 | 357 | ldr r3, =0x04000100 358 | mov r2, #0 359 | strh r2, [r3, #0xc0] 360 | 361 | ldr r4, =0x06008000 362 | bx r4 363 | 364 | .pool 365 | 366 | arm7_end: 367 | .space (_start + 0xBD0) - . 368 | .word CODE 369 | .hword 3 370 | .hword 0x0202 371 | 372 | .space (_start + 0xF04) - . 373 | .word CODE 374 | .hword 4 375 | .hword 0x0202 376 | 377 | 378 | .space (_start + 0x1238) - . 379 | .word CODE 380 | .hword 5 381 | .hword 0x0202 382 | 383 | .space (_start + 0x2000) - . 384 | -------------------------------------------------------------------------------- /bootstub/bootstub.s: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------- 2 | 3 | Copyright (C) 2010 - 2015 Dave "WinterMute" Murphy 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | ------------------------------------------------------------------*/ 20 | 21 | #define REG_BASE 0x04000000 22 | 23 | .global _start 24 | @----------------------------------------------------------------- 25 | _start: 26 | @----------------------------------------------------------------- 27 | b _boot 28 | fwheader: 29 | .word 0 @ arm7 fw address 30 | .word 0 @ arm7 load address 31 | .word 0 @ arm7 size 32 | .word 0 @ arm7 execute 33 | 34 | .word 0 @ arm9 fw address 35 | .word 0 @ arm9 load address 36 | .word 0 @ arm9 size 37 | .word 0 @ arm9 execute 38 | 39 | @----------------------------------------------------------------- 40 | _boot: 41 | @----------------------------------------------------------------- 42 | bl copystub 43 | 44 | adr r12, fwheader 45 | 46 | ldr r1, [r12], #4 47 | ldr r0, [r12], #4 48 | ldr r2, [r12], #4 49 | ldr r3, [r12], #4 50 | 51 | ldr r4, =0x02FFFE34 52 | str r3, [r4] 53 | 54 | bl fwread 55 | 56 | ldr r1, [r12], #4 57 | ldr r0, [r12], #4 58 | ldr r2, [r12], #4 59 | 60 | bl fwread 61 | 62 | ldr r3, [r12], #4 63 | ldr r4, =0x02FFFE24 64 | str r3, [r4] 65 | 66 | ldr r4, =0x02FFFE34 67 | ldr r4, [r4] 68 | bx r4 69 | 70 | @----------------------------------------------------------------- 71 | copystub: 72 | @----------------------------------------------------------------- 73 | mov r0, #0x03000000 74 | sub r0, r0, #0xc000 75 | adr r1, _bootstub 76 | 77 | @----------------------------------------------------------------- 78 | @ adjust arm9 code address 79 | @----------------------------------------------------------------- 80 | ldr r2, [r1,#8] 81 | add r2, r2, r0 82 | str r2, [r1,#8] 83 | 84 | @----------------------------------------------------------------- 85 | @ adjust arm7 code address 86 | @----------------------------------------------------------------- 87 | ldr r2, [r1,#12] 88 | add r2, r2, r0 89 | str r2, [r1,#12] 90 | 91 | adr r2, arm7_end 92 | 93 | 1: ldr r3, [r1],#4 94 | str r3, [r0],#4 95 | cmp r1, r2 96 | bne 1b 97 | 98 | bx lr 99 | 100 | @----------------------------------------------------------------- 101 | _bootstub: 102 | @----------------------------------------------------------------- 103 | .ascii "bootstub" 104 | .word hook7from9 - _bootstub 105 | .word hook9from7 - _bootstub 106 | 107 | //----------------------------------------------------------------- 108 | hook9from7: 109 | //----------------------------------------------------------------- 110 | mov r12, #REG_BASE 111 | mov r0, #0 112 | str r0, [r12, #0x208] 113 | 114 | 115 | mov r0, #0xc200 @ enable FIFO, clear error, enable irq 116 | orr r0, #8 @ flush send FIFO 117 | str r0, [r12, #0x184] 118 | 119 | adr r0, waitcode_start 120 | mov r1, #0x03800000 121 | adr r2, waitcode_end 122 | 1: ldr r4, [r0],#4 123 | str r4, [r1],#4 124 | cmp r2, r0 125 | bne 1b 126 | 127 | adr r11, enter_passme_loop 128 | ldr r0, resetcode 129 | mov r1, #0x03800000 130 | bx r1 131 | 132 | .pool 133 | 134 | @----------------------------------------------------------------- 135 | waitcode_start: 136 | @----------------------------------------------------------------- 137 | mov r3, #0x04000000 138 | str r0, [r3, #0x188] 139 | add r3, r3, #0x180 140 | 141 | mov r2, #1 142 | bl waitsync 143 | 144 | ldr r0, =0x02FFFE24 145 | str r11, [r0] 146 | 147 | mov r0, #0x100 148 | strh r0, [r3] 149 | 150 | mov r2, #0 151 | bl waitsync 152 | 153 | mov r0, #0 154 | strh r0, [r3] 155 | 156 | mov r2, #5 157 | bl waitsync 158 | 159 | ldr lr, =0x02380000 160 | bx lr 161 | 162 | .pool 163 | 164 | waitsync: 165 | ldrh r0, [r3] 166 | and r0, r0, #0x000f 167 | cmp r0, r2 168 | bne waitsync 169 | bx lr 170 | waitcode_end: 171 | 172 | arm9bootaddr: 173 | .word 0x02FFFE24 174 | 175 | resetcode: 176 | .word 0x0c04000c 177 | 178 | .arch armv5te 179 | .cpu arm946e-s 180 | 181 | @----------------------------------------------------------------- 182 | copy_arm7_code: 183 | @----------------------------------------------------------------- 184 | 185 | ldr r1, =0x02380000 186 | ldr r0, =0x02FFFE34 187 | str r1, [r0] 188 | 189 | adr r0, arm7_start 190 | adr r2, arm7_end 191 | _copyloader: 192 | ldr r4, [r0], #4 193 | str r4, [r1], #4 194 | cmp r0, r2 195 | blt _copyloader 196 | 197 | 198 | ldr r0, =0x02380000 199 | ldr r1, arm7size 200 | add r1, r1, r0 201 | .flush: 202 | mcr p15, 0, r0, c7, c14, 1 @ clean and flush address 203 | add r0, r0, #32 204 | cmp r0, r1 205 | blt .flush 206 | 207 | mov r0, #0 208 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer 209 | 210 | bx lr 211 | 212 | arm7size: 213 | .word arm7_end - arm7_start 214 | .pool 215 | 216 | @----------------------------------------------------------------- 217 | hook7from9: 218 | @----------------------------------------------------------------- 219 | mov r12, #REG_BASE 220 | mov r0, #0 221 | str r0, [r12, #0x208] 222 | 223 | mov r0, #0xc200 @ enable FIFO, clear error, enable irq 224 | orr r0, #8 @ flush send FIFO 225 | str r0, [r12, #0x184] 226 | 227 | add r3, r12, #0x180 @ r3 = 4000180 (REG_IPCSYNC) 228 | 229 | mov r0, #0 230 | strh r0, [r3] 231 | 232 | ldr r0, resetcode 233 | str r0, [r12, #0x188] 234 | 235 | mov r2, #1 236 | bl waitsync 237 | 238 | bl copy_arm7_code 239 | 240 | mov r0, #0x100 241 | strh r0, [r3] 242 | 243 | mov r2, #5 244 | bl waitsync 245 | 246 | mov r0,#0x82 247 | strb r0,[r3,#0x242-0x180] 248 | 249 | b passme_loop 250 | 251 | @----------------------------------------------------------------- 252 | enter_passme_loop: 253 | @----------------------------------------------------------------- 254 | mov r12, #REG_BASE 255 | str r12, [r12,#0x208] 256 | 257 | add r3, r12, #0x180 @ r3 = 4000180 (REG_IPCSYNC) 258 | 259 | mov r0,#0x82 260 | strb r0,[r3,#0x242-0x180] 261 | 262 | bl copy_arm7_code 263 | 264 | @----------------------------------------------------------------- 265 | passme_loop: 266 | @----------------------------------------------------------------- 267 | ldr r1, tcmpudisable @ disable TCM and protection unit 268 | mcr p15, 0, r1, c1, c0 269 | 270 | @ Disable cache 271 | mov r0, #0 272 | mcr p15, 0, r0, c7, c5, 0 @ Instruction cache 273 | mcr p15, 0, r0, c7, c6, 0 @ Data cache 274 | mcr p15, 0, r0, c3, c0, 0 @ write buffer 275 | 276 | @ Wait for write buffer to empty 277 | mcr p15, 0, r0, c7, c10, 4 278 | 279 | @----------------------------------------------------------------- 280 | @ set up and enter passme loop 281 | @----------------------------------------------------------------- 282 | 283 | ldr r0,arm9branchaddr 284 | ldr r1,branchinst 285 | str r1,[r0] 286 | str r0,[r0,#0x20] 287 | 288 | mov r1, #0x500 289 | strh r1, [r3] 290 | 291 | bx r0 292 | 293 | branchinst: 294 | .word 0xE59FF018 295 | 296 | arm9branchaddr: 297 | .word 0x02fffe04 298 | 299 | tcmpudisable: 300 | .word 0x2078 301 | 302 | .arch armv4t 303 | .cpu arm7tdmi 304 | 305 | @----------------------------------------------------------------- 306 | arm7_start: 307 | @----------------------------------------------------------------- 308 | mov r12, #REG_BASE 309 | str r12, [r12, #0x208] @ IME = 0; 310 | 311 | adr r1,arm7_boot 312 | adr r3,arm7_end 313 | ldr r2,=0x03800000 314 | mov r4, r2 315 | 1: 316 | ldr r0,[r1],#4 317 | str r0,[r2],#4 318 | cmp r1,r3 319 | bne 1b 320 | 321 | bx r4 322 | 323 | .pool 324 | 325 | @----------------------------------------------------------------- 326 | arm7_boot: 327 | @----------------------------------------------------------------- 328 | @ switch off sound channels 329 | add r0, r12, #0x400 330 | mov r1, #0 331 | mov r2, #16 332 | .L1: str r1, [r0], #16 333 | subs r2, r2, #1 334 | bne .L1 335 | 336 | add r3, r12, #0x180 337 | mov r0,#0x500 338 | strh r0,[r3] 339 | 340 | waitfor9: 341 | ldrh r0, [r3] 342 | and r0, r0, #0x000f 343 | cmp r0, #5 344 | bne waitfor9 345 | 346 | b fwload 347 | 348 | @----------------------------------------------------------------- 349 | writeread: 350 | @----------------------------------------------------------------- 351 | and r0, r0, #0xff 352 | strh r0, [r3, #0xc2] 353 | .L2: 354 | ldrh r2, [r3, #0xc0] 355 | tst r2, #128 356 | bne .L2 357 | ldrh r0, [r3, #0xc2] 358 | bx lr 359 | 360 | .pool 361 | 362 | @----------------------------------------------------------------- 363 | fwread: 364 | @----------------------------------------------------------------- 365 | @ r0 - destination 366 | @ r1 - firmware address 367 | @ r2 - size 368 | @----------------------------------------------------------------- 369 | push {lr} 370 | mov r5, r0 371 | mov r6, r2 372 | ldr r3, =0x04000100 373 | mov r4, #0x8900 374 | strh r4, [r3, #0xc0] 375 | mov r0, #3 376 | bl writeread 377 | mov r0, r1, lsr #16 378 | bl writeread 379 | mov r0, r1, lsr #8 380 | bl writeread 381 | mov r0, r1 382 | bl writeread 383 | 384 | add r4, r5, r6 385 | .load: 386 | mov r0, #0 387 | bl writeread 388 | strb r0, [r5],#1 389 | cmp r4, r5 390 | bne .load 391 | 392 | mov r2, #0 393 | strh r2, [r3, #0xc0] 394 | 395 | pop {pc} 396 | 397 | .pool 398 | 399 | @----------------------------------------------------------------- 400 | fwload: 401 | @----------------------------------------------------------------- 402 | ldr r0, =0x06008000 403 | mov r1, #0x10000 404 | mov r2, #2048 405 | bl fwread 406 | 407 | ldr r4, =0x06008000 408 | bx r4 409 | 410 | .pool 411 | 412 | arm7_end: 413 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 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 Library 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 307 | along with this program; if not, write to the Free Software 308 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 309 | 310 | 311 | Also add information on how to contact you by electronic and paper mail. 312 | 313 | If the program is interactive, make it output a short notice like this 314 | when it starts in an interactive mode: 315 | 316 | Gnomovision version 69, Copyright (C) year name of author 317 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 318 | This is free software, and you are welcome to redistribute it 319 | under certain conditions; type `show c' for details. 320 | 321 | The hypothetical commands `show w' and `show c' should show the appropriate 322 | parts of the General Public License. Of course, the commands you use may 323 | be called something other than `show w' and `show c'; they could even be 324 | mouse-clicks or menu items--whatever suits your program. 325 | 326 | You should also get your employer (if you work as a programmer) or your 327 | school, if any, to sign a "copyright disclaimer" for the program, if 328 | necessary. Here is a sample; alter the names: 329 | 330 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 331 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 332 | 333 | , 1 April 1989 334 | Ty Coon, President of Vice 335 | 336 | This General Public License does not permit incorporating your program into 337 | proprietary programs. If your program is a subroutine library, you may 338 | consider it more useful to permit linking proprietary applications with the 339 | library. If this is what you want to do, use the GNU Library General 340 | Public License instead of this License. 341 | -------------------------------------------------------------------------------- /classichack/COPYING: -------------------------------------------------------------------------------- 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 Library 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 307 | along with this program; if not, write to the Free Software 308 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 309 | 310 | 311 | Also add information on how to contact you by electronic and paper mail. 312 | 313 | If the program is interactive, make it output a short notice like this 314 | when it starts in an interactive mode: 315 | 316 | Gnomovision version 69, Copyright (C) year name of author 317 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 318 | This is free software, and you are welcome to redistribute it 319 | under certain conditions; type `show c' for details. 320 | 321 | The hypothetical commands `show w' and `show c' should show the appropriate 322 | parts of the General Public License. Of course, the commands you use may 323 | be called something other than `show w' and `show c'; they could even be 324 | mouse-clicks or menu items--whatever suits your program. 325 | 326 | You should also get your employer (if you work as a programmer) or your 327 | school, if any, to sign a "copyright disclaimer" for the program, if 328 | necessary. Here is a sample; alter the names: 329 | 330 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 331 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 332 | 333 | , 1 April 1989 334 | Ty Coon, President of Vice 335 | 336 | This General Public License does not permit incorporating your program into 337 | proprietary programs. If your program is a subroutine library, you may 338 | consider it more useful to permit linking proprietary applications with the 339 | library. If this is what you want to do, use the GNU Library General 340 | Public License instead of this License. 341 | -------------------------------------------------------------------------------- /cookhack/COPYING: -------------------------------------------------------------------------------- 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 Library 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 307 | along with this program; if not, write to the Free Software 308 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 309 | 310 | 311 | Also add information on how to contact you by electronic and paper mail. 312 | 313 | If the program is interactive, make it output a short notice like this 314 | when it starts in an interactive mode: 315 | 316 | Gnomovision version 69, Copyright (C) year name of author 317 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 318 | This is free software, and you are welcome to redistribute it 319 | under certain conditions; type `show c' for details. 320 | 321 | The hypothetical commands `show w' and `show c' should show the appropriate 322 | parts of the General Public License. Of course, the commands you use may 323 | be called something other than `show w' and `show c'; they could even be 324 | mouse-clicks or menu items--whatever suits your program. 325 | 326 | You should also get your employer (if you work as a programmer) or your 327 | school, if any, to sign a "copyright disclaimer" for the program, if 328 | necessary. Here is a sample; alter the names: 329 | 330 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 331 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 332 | 333 | , 1 April 1989 334 | Ty Coon, President of Vice 335 | 336 | This General Public License does not permit incorporating your program into 337 | proprietary programs. If your program is a subroutine library, you may 338 | consider it more useful to permit linking proprietary applications with the 339 | library. If this is what you want to do, use the GNU Library General 340 | Public License instead of this License. 341 | -------------------------------------------------------------------------------- /tblhack/COPYING: -------------------------------------------------------------------------------- 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 Library 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 307 | along with this program; if not, write to the Free Software 308 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 309 | 310 | 311 | Also add information on how to contact you by electronic and paper mail. 312 | 313 | If the program is interactive, make it output a short notice like this 314 | when it starts in an interactive mode: 315 | 316 | Gnomovision version 69, Copyright (C) year name of author 317 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 318 | This is free software, and you are welcome to redistribute it 319 | under certain conditions; type `show c' for details. 320 | 321 | The hypothetical commands `show w' and `show c' should show the appropriate 322 | parts of the General Public License. Of course, the commands you use may 323 | be called something other than `show w' and `show c'; they could even be 324 | mouse-clicks or menu items--whatever suits your program. 325 | 326 | You should also get your employer (if you work as a programmer) or your 327 | school, if any, to sign a "copyright disclaimer" for the program, if 328 | necessary. Here is a sample; alter the names: 329 | 330 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 331 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 332 | 333 | , 1 April 1989 334 | Ty Coon, President of Vice 335 | 336 | This General Public License does not permit incorporating your program into 337 | proprietary programs. If your program is a subroutine library, you may 338 | consider it more useful to permit linking proprietary applications with the 339 | library. If this is what you want to do, use the GNU Library General 340 | Public License instead of this License. 341 | --------------------------------------------------------------------------------