Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
dateiformat [05.04.2015 23:19] – martin | dateiformat [11.08.2021 10:15] (aktuell) – Externe Bearbeitung 127.0.0.1 | ||
---|---|---|---|
Zeile 27: | Zeile 27: | ||
</ | </ | ||
- | Für Bücher ohne Skripte | + | Für Bücher ohne Skript-Datei |
< | < | ||
ScriptMD5: <MD5 Summe der src-Datei> | ScriptMD5: <MD5 Summe der src-Datei> | ||
</ | </ | ||
+ | Ein Buch ohne Skript-Datei bedeutet nicht, dass das Buch keine Skripte enthält. Die binären Skripte befinden | ||
+ | ich immer noch einmal (ohne Kommentare) in der ouf-Datei. | ||
+ | |||
Beispiel: '' | Beispiel: '' | ||
Zeile 47: | Zeile 50: | ||
====== Die png Datei ====== | ====== Die png Datei ====== | ||
- | Ein png-Bild der Größe 140px × 193px. (???) | + | Ein png-Bild |
====== Die ouf Datei ====== | ====== Die ouf Datei ====== | ||
Zeile 57: | Zeile 60: | ||
| Index-Tabelle | n x 12 byte = n x 3 x 32 bit | | | Index-Tabelle | n x 12 byte = n x 3 x 32 bit | | ||
| Padding || | | Padding || | ||
- | | MP3 / Binärscode | + | | MP3 (incl. optionalem ID3-Tag ) / Binärcode |
| Padding || | | Padding || | ||
- | | MP3 / Binärscode | + | | MP3 (incl. optionalem ID3-Tag ) / Binärcode |
| ... || | | ... || | ||
- | | MP3 / Binärscode | + | | MP3 (incl. optionalem ID3-Tag ) / Binärcode |
===== Dateikopf ===== | ===== Dateikopf ===== | ||
- | | 0 | Startposition der Index-Tabelle | 0x0068 | | + | | 0 (0x00) |
- | | 4 | unbekannt | 2 | | + | | 4 (0x04) |
- | | 8 | erste Ting-ID | 15001 (15000 gefunden; laut " | + | | 8 (0x08) |
- | | 12 | letzte Ting-ID | | + | | 12 (0x0c) |
- | | 16 | Anzahl der genutzten Ting-IDs | Entspricht nicht immer letzte Ting-ID – erste Ting-ID + 1 (???) | | + | | 16 (0x10) |
- | | 20 | Buch-ID || | + | | 20 (0x14) |
- | | 24 | unbekannt | Werte im Bereich 1 bis 20 gefunden (häufig gefunden: 2, 5, 7 und 11) | | + | | 24 (0x18) |
- | | 28 | Erstellungszeitpunkt | + | | 28 (0x1c) | Erstellungszeitpunkt |
- | | 32 | unbekannt | 0 | | + | | 32 (0x20) |
- | | 36 | unbekannt | 0x0000ffff | | + | | 36 (0x24) |
===== Index-Tabelle ===== | ===== Index-Tabelle ===== | ||
Zeile 89: | Zeile 92: | ||
===== Padding ===== | ===== Padding ===== | ||
- | Die einzelnen Einträge (MP3 oder Binärcode) fangen immer an einer Adresse | + | Die einzelnen Einträge (MP3 oder Binärcode) fangen immer an einer Adresse |
===== Funktionen ===== | ===== Funktionen ===== | ||
Zeile 102: | Zeile 105: | ||
< | < | ||
+ | |||
+ | |||
+ | private static int getNextAddress(int x) { | ||
+ | x += 0x100 - (x & 0xff); | ||
+ | while(x % 0x200 != 0) { | ||
+ | x += 0x100; | ||
+ | } | ||
+ | return(x); | ||
+ | } | ||
+ | |||
pos = 12 * <Anzahl der Eintrage im Index> + < | pos = 12 * <Anzahl der Eintrage im Index> + < | ||
- | pos += (0x100 - (pos % 0x100)) % 0x100 | + | pos = getNextAddress(12 * <Anzahl der Einträge im Index> + < |
- | while(<Die 12 (???) Bytes an der Stelle | + | while(!isMp3(<daten ab pos>) && !isScript(< |
- | pos += 0x100; | + | pos += 0x200; |
} | } | ||
</ | </ | ||
Zeile 116: | Zeile 129: | ||
< | < | ||
- | private final static int[] E = { 578, 562, 546, 530, 514, 498, 482, 466, | + | private final static int[] E = { 578, 562, 546, 530, 514, 498, 482, 466, |
- | | + | |
- | | + | |
- | | + | |
- | /** | + | /** |
- | | + | * Errechnet aus der Position in der ouf-Datei und der Position in der Indextablelle |
- | | + | * den Positionscode in der Indextabelle |
- | | + | * @param position Position in der Datei |
- | | + | * @param n Position in der Indextablelle (startet bei 0) |
- | | + | * @return Positionscode in der Indextabelle (1. Feld). Im Fehlerfall -1 |
- | | + | */ |
- | | + | private static int getCodeFromPositionInFile(int position, int n) { |
- | if(((position & 0xFF) != 0x0) | (n < 0)) { | + | if(((position & 0xFF) != 0x0) | (n < 0)) { |
- | | + | return -1; |
- | } | + | } |
- | n--; | + | n--; |
- | int b = (position >> 8) + n * 0x1A; | + | int b = (position >> 8) + n * 0x1A; |
- | for(int k = 0; k < E.length; k++) { | + | for(int k = 0; k < E.length; k++) { |
- | | + | int v = (b - E[k]) << 8; |
- | | + | if(getPositionInFileFromCode(v, |
- | return(v); | + | return v; |
- | | + | } |
- | } | + | } |
- | return(-1); | + | return -1; |
- | | + | } |
- | | + | /** |
- | | + | * Errechnet aus dem Positionscode in der Indextabelle und der Position in der Indextablelle |
- | | + | * die Position in der ouf-Datei |
- | | + | * @param code Positionscode in der Indextabelle (1. Feld) |
- | | + | * @param n Position in der Indextablelle (startet bei 0) |
- | | + | * @return Position in der Datei. Im Fehlerfall -1 |
- | | + | */ |
- | | + | public static int getPositionInFileFromCode(int code, int n) { |
- | if(((code & 0xFF) != 0x0) | (n < 0)) { | + | if(((code & 0xFF) != 0x0) | (n < 0)) { |
- | | + | return -1; |
- | } | + | } |
- | n--; | + | n--; |
- | code = code >> 8; | + | code = code >> 8; |
- | int c = ((code >> 3) & 0x1) | (((code >> 4) & 0x1) << 1) | | + | int c = ((code >> 3) & 0x1) | (((code >> 4) & 0x1) << 1) | |
- | (((code >> 5) & 0x1) << 2) | (((code >> 7) & 0x1) << 3) | | + | (((code >> 5) & 0x1) << 2) | (((code >> 7) & 0x1) << 3) | |
- | (((code >> 9) & 0x1) << 4); | + | (((code >> 9) & 0x1) << 4); |
- | code -= n * 0x1A - E[c]; | + | code -= n * 0x1A - E[c]; |
- | return(code << 8); | + | return code << 8; |
- | | + | } |
</ | </ | ||
+ |