Author Topic: Help damaged tns files‏  (Read 12735 times)

0 Members and 5 Guests are viewing this topic.

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: Help damaged tns files‏
« Reply #15 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;
}
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline brahimmed30

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 17
  • Rating: +0/-0
    • View Profile
Re: Help damaged tns files‏
« Reply #16 on: August 13, 2011, 08:30:15 am »
thank you to all...viva omnimaga

Offline brahimmed30

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 17
  • Rating: +0/-0
    • View Profile
Re: Help damaged tns files‏
« Reply #17 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 ?
« Last Edit: August 17, 2011, 07:29:50 pm by brahimmed30 »

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: Help damaged tns files‏
« Reply #18 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 :)
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline brahimmed30

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 17
  • Rating: +0/-0
    • View Profile
Re: Help damaged tns files‏
« Reply #19 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!
« Last Edit: October 16, 2011, 04:01:56 am by brahimmed30 »

Offline Goplat

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 289
  • Rating: +82/-0
    • View Profile
Re: Help damaged tns files‏
« Reply #20 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.
« Last Edit: October 16, 2011, 07:45:23 pm by Goplat »
Numquam te deseram; numquam te deficiam; numquam circa curram et te desolabo
Numquam te plorare faciam; numquam valedicam; numquam mendacium dicam et te vulnerabo