Omnimaga

Calculator Community => TI Calculators => General Calculator Help => Topic started by: brahimmed30 on August 11, 2011, 09:52:09 pm

Title: Help damaged tns files‏
Post by: brahimmed30 on August 11, 2011, 09:52:09 pm
hello,
I can not speak well in English but I will try
I have a problem with damaged tns files (the handheld can not open them) if any one can help me recover the data stored in these files, I contacted ti-cares and they did nothing for me
Title: Re: Help damaged tns files‏
Post by: pianoman on August 11, 2011, 11:07:08 pm
Hi, welcome to the forums!
If you can, we need a bit more info to best helP you. Wht type of nspire, OS do you have, and what was in the file?
Thanks!
Title: Re: Help damaged tns files‏
Post by: Jim Bauwens on August 12, 2011, 05:43:08 am
Like pianoman said, we need some more information first:

1. In what OS version were the files created?
2. Did you upgrade your calculator to a newer version?
3. Maybe you can upload the files, so someone here can check them
Title: Re: Help damaged tns files‏
Post by: brahimmed30 on August 12, 2011, 06:10:11 am
This problem starts to appear for me since I installed on my ti Nspire CAS Clickpad the version 3.0.2.1791  exactly May 25, just recently when I bought a TI-Nspire CX CAS equipped with the OS 3.0.2.1791 I found this problem
 we concluded:
1. All damaged files  contain Activities in these activities there are pages of the application table and lists
2.The files are created with version 3.0.2.1791
3.The files are created after the update of handhelds
4. files: http://www.4shared.com/file/wUoC6y6d/TNS_Files.html


 thank you to all for your attention
Title: Re: Help damaged tns files‏
Post by: fb39ca4 on August 12, 2011, 12:06:26 pm
Have you tried opening them on the OS version (and possibly calculator) they were created on?
Title: Re: Help damaged tns files‏
Post by: brahimmed30 on August 12, 2011, 12:33:59 pm
Yes, I tried to do this but no effect , the unit restart and TI-Nspire computer software closed
Title: Re: Help damaged tns files‏
Post by: Goplat on August 12, 2011, 02:40:01 pm
If you reduce the version number in the file header from 0500 to 0300, then they open fine in OS 1.7. It looks like it's only OS 2.0+ that crashes
Title: Re: Help damaged tns files‏
Post by: brahimmed30 on August 12, 2011, 04:05:16 pm
How I can do this
Title: Re: Help damaged tns files‏
Post by: brahimmed30 on August 12, 2011, 04:06:46 pm
And i have not the version 1.7 , where i can found it ?
Title: Re: Help damaged tns files‏
Post by: Lionel Debroux on August 12, 2011, 04:13:22 pm
Double-posting is bad ;)

You can use a hex editor, such as XVI32, WinHEX, KHexEdit, etc. At the very beginning of the file, you'll see the "TIMLP0500" text. Replace it by "TIMLP0300".

And you can find OS 1.7.2741 for example on TI-Bank, which redirects to TI's servers.
Title: Re: Help damaged tns files‏
Post by: pianoman on August 12, 2011, 04:15:07 pm
Here is the thread that is on Omnimaga: http://ourl.ca/7373
Title: Re: Help damaged tns files‏
Post by: brahimmed30 on August 12, 2011, 04:20:14 pm
thanks but i can not install os 1.7 in my handheld because i have the version 3.0.2.1791
Title: Re: Help damaged tns files‏
Post by: pianoman on August 12, 2011, 04:26:23 pm
I would suggest using this (http://ourl.ca/9360) to load OS 1.7, then open the file, copy down all the information, and put it back into a new file in OS 3.0.2
Title: Re: Help damaged tns files‏
Post by: brahimmed30 on August 12, 2011, 05:20:04 pm
Thank you to all very much .... is there any way to copy these files from emulator to thr unit or to computer software?
Title: Re: Help damaged tns files‏
Post by: Goplat on August 12, 2011, 06:04:45 pm
There's no way to get documents out of nspire_emu; it's meant for testing and debugging asm/C programs, not for doing things the computer software does.

Anyway, I managed to dump the XML of the documents, remove the offending tag (it was just the cursor location, nothing important), zip them back up, and re-save on my TI-Nspire with OS 2.0.1 (in order to encrypt them - 3.0 doesn't allow unencrypted documents any more). Here you go.
Title: Re: Help damaged tns files‏
Post by: Lionel Debroux on August 13, 2011, 01:42:22 am
Quote
There's no way to get documents out of nspire_emu
I know that you know it, but for other readers: it can be done the harder way :)

One can use a Ndless program that outputs the contents of a file to the serial port under raw or text form, such as:
Code: [Select]
#include <os.h>

int main(void) {
    FILE * f;
    volatile int c;

    TCT_Local_Control_Interrupts(0xFFFFFFFF);
    f = fopen("/documents/ndless/test.tns","rb");
    if (f) {
        printf("=====\n");
        while ((c = fgetc(f)) != EOF) {
            printf("%02x ", c);
        }
        printf("=====\n");

        fclose(f);
    }

    return 0;
}

within the emulator, and on the host computer, copy&paste the output to whatever piece of code / program that can turn those bytes into a binary. Such as the following trivial code, which I've been using to check the effect of patching well-chosen locations in the document saving code, in order to defeat TI's layers of obfuscation without having to use any decryption code, or having to implement the decompression part of TI's patented XML compression algorithm, on the computer side:
Code: [Select]
#include <stdio.h>

unsigned char data[] = {
// Paste the output of the program (between the markers) here.
};

int main(void) {
    FILE *f = fopen("test.tns","wb");
    fwrite(data, 1, sizeof(data), f);
    fclose(f);
    return 0;
}
Title: Re: Help damaged tns files‏
Post by: brahimmed30 on August 13, 2011, 08:30:15 am
thank you to all...viva omnimaga
Title: Re: Help damaged tns files‏
Post by: brahimmed30 on August 17, 2011, 07:29:25 pm
The question:what is the cause for which my files are damaged ?
and if I find this problem in future is there any method to repair my files without losing data ?
Title: Re: Help damaged tns files‏
Post by: Lionel Debroux on August 18, 2011, 02:39:19 am
Quote
what is the cause for which my files are damaged ?
Undoubtedly a bug in TI's OS.

Quote
and if I find this problem in future is there any method to repair my files without losing data ?
Just ask again on the forums, as you did here, and the people knowledgeable enough about the OS will certainly try to help :)
Title: Re: Help damaged tns files‏
Post by: brahimmed30 on October 16, 2011, 03:57:46 am
Good morning,
 i have an other damaged tns file if any one can repair it he will send me a personal message to give him the password of ziped file because this tns file contain personel informations
 thank you!
Title: Re: Help damaged tns files‏
Post by: Goplat on October 16, 2011, 04:50:12 pm
Here you go; the password is same as the original. It might be best to avoid saving documents while editing a spreadsheet cell, to avoid this bug.

Edit: The bug is caused by the combination of two things: a colored row, and saving while editing a cell. Loading a spreadsheet that was saved while editing a cell somehow tries to retrieve the color of a cell in column -1, and if there exists a colored row, that crashes.