how to find the decompressed size of CX OS

I know how to dump RAM, but how do I find out the exact size of the OS so there is not extra data at the end?
News, programmes, tutoriaux, forum sur les calculatrices TI, Casio, NumWorks... !
https://tiplanet.org/forum/
critor wrote:That's something I was wondering about, as I don't use the publicly available decrypting method.
parrotgeek1 wrote:critor wrote:That's something I was wondering about, as I don't use the publicly available decrypting method.
What is that method?
12 0C F0 8F 12 0C 00 90 12 0C 10 90 12 0C 00 A0
1A 0C 00 A4 12 0C 00 AC 12 0C 00 B0 12 0C 00 B4
12 0C 00 B8 12 0C 00 BC 12 0C 00 C0 12 0C 00 C4
12 0C 00 C8 12 0C 00 CC 12 0C 00 DC 12 0C 00 A9
12 0C 00 81 12 0C 10 81 12 0C 20 81 12 0C 30 81
12 0C 40 81 12 0C 50 81 12 0C 60 81 12 0C 70 81
12 0C 80 81 12 0C 90 81 12 0C A0 81 12 0C B0 81
critor wrote:parrotgeek1 wrote:critor wrote:That's something I was wondering about, as I don't use the publicly available decrypting method.
What is that method?
archives_voir.php?id=4281 with the complete source code I'm not allowed to share.
In the public source code, the decryption key is missing.
Ok, all CX, CX CAS and CM raw images I've checked so far seem to end with the following pattern :
- Code: Select all
12 0C F0 8F 12 0C 00 90 12 0C 10 90 12 0C 00 A0
1A 0C 00 A4 12 0C 00 AC 12 0C 00 B0 12 0C 00 B4
12 0C 00 B8 12 0C 00 BC 12 0C 00 C0 12 0C 00 C4
12 0C 00 C8 12 0C 00 CC 12 0C 00 DC 12 0C 00 A9
12 0C 00 81 12 0C 10 81 12 0C 20 81 12 0C 30 81
12 0C 40 81 12 0C 50 81 12 0C 60 81 12 0C 70 81
12 0C 80 81 12 0C 90 81 12 0C A0 81 12 0C B0 81
import java.io.*;
import java.util.*;
import java.nio.*;
import java.nio.file.*;
public class CutOS {
public static int indexOf(byte[] outerArray, byte[] smallerArray) {
for(int i = 0; i < outerArray.length - smallerArray.length+1; ++i) {
boolean found = true;
for(int j = 0; j < smallerArray.length; ++j) {
if (outerArray[i+j] != smallerArray[j]) {
found = false;
break;
}
}
if (found) return i;
}
return -1;
}
public static void main(String args[]) throws Exception {
String in = args[0];
String out = args[1];
byte[] bytes = Files.readAllBytes(Paths.get(in));
String text = new String(bytes);
// thanks critor
byte[] patt = new byte[]{
(byte)0x12, (byte)0x0C, (byte)0xF0, (byte)0x8F, (byte)0x12, (byte)0x0C, (byte)0x00, (byte)0x90, (byte)0x12, (byte)0x0C, (byte)0x10, (byte)0x90, (byte)0x12, (byte)0x0C, (byte)0x00, (byte)0xA0,
(byte)0x1A, (byte)0x0C, (byte)0x00, (byte)0xA4, (byte)0x12, (byte)0x0C, (byte)0x00, (byte)0xAC, (byte)0x12, (byte)0x0C, (byte)0x00, (byte)0xB0, (byte)0x12, (byte)0x0C, (byte)0x00, (byte)0xB4,
(byte)0x12, (byte)0x0C, (byte)0x00, (byte)0xB8, (byte)0x12, (byte)0x0C, (byte)0x00, (byte)0xBC, (byte)0x12, (byte)0x0C, (byte)0x00, (byte)0xC0, (byte)0x12, (byte)0x0C, (byte)0x00, (byte)0xC4,
(byte)0x12, (byte)0x0C, (byte)0x00, (byte)0xC8, (byte)0x12, (byte)0x0C, (byte)0x00, (byte)0xCC, (byte)0x12, (byte)0x0C, (byte)0x00, (byte)0xDC, (byte)0x12, (byte)0x0C, (byte)0x00, (byte)0xA9,
(byte)0x12, (byte)0x0C, (byte)0x00, (byte)0x81, (byte)0x12, (byte)0x0C, (byte)0x10, (byte)0x81, (byte)0x12, (byte)0x0C, (byte)0x20, (byte)0x81, (byte)0x12, (byte)0x0C, (byte)0x30, (byte)0x81,
(byte)0x12, (byte)0x0C, (byte)0x40, (byte)0x81, (byte)0x12, (byte)0x0C, (byte)0x50, (byte)0x81, (byte)0x12, (byte)0x0C, (byte)0x60, (byte)0x81, (byte)0x12, (byte)0x0C, (byte)0x70, (byte)0x81,
(byte)0x12, (byte)0x0C, (byte)0x80, (byte)0x81, (byte)0x12, (byte)0x0C, (byte)0x90, (byte)0x81, (byte)0x12, (byte)0x0C, (byte)0xA0, (byte)0x81, (byte)0x12, (byte)0x0C, (byte)0xB0, (byte)0x81
};
int w = indexOf(bytes,patt);
byte [] subArray = Arrays.copyOfRange(bytes, w+patt.length, bytes.length);
FileOutputStream fos = new FileOutputStream(out);
fos.write(subArray);
fos.close();
}
}
critor wrote:In what way does it not work ?
Lionel Debroux wrote:This is a brittle way to do the job, though it happens to work... you'd much better use imgmanip
The set of decryption keys isn't that hard to build. Maybe imgmanip itself (or something close to that) can do it.