cake
/
libg1m
Archived
1
0
Fork 0
This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
libg1m/include/libg1m/format/fxi.h.draft

92 lines
2.4 KiB
Plaintext

/* *****************************************************************************
* libg1m/format/fxi.h -- the FXI file format description.
* Copyright (C) 2017 Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
*
* This file is part of libg1m.
* libg1m is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3.0 of the License,
* or (at your option) any later version.
*
* libg1m is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with libg1m; if not, see <http://www.gnu.org/licenses/>.
* ************************************************************************** */
#ifndef LIBG1M_FORMAT_FXI_H
# define LIBG1M_FORMAT_FXI_H
# include <stdint.h>
# pragma pack(1)
/* FXI is obfuscated with a symetrical obfuscation algorithm:
* byte = byte ^ ~24;
*
* Once the format is deobfuscated, this is the header structure: */
struct fxi_header {
/* unknown - probably part of the magic? "\xD5\xD7\x1F" "f" */
uint8_t _unknown[4];
/* description: the description of the format (probably part of the
* magic too): "FX-INTERFACE - YELLOW COMPUTING" */
char description[31];
uint8_t _unused[40];
/* the number of meta entries */
uint8_t num;
uint8_t _unused2[80];
/* sum of the number of meta entries and records */
uint16_t sum;
uint8_t _unused3;
/* 0xFF, 0xFF, 0, 0, 0x0F, 0 */
uint8_t _blackmagic[6];
/* board type? CY */
uint8_t board[2];
/* introduction? */
uint8_t type[11];
};
/* Then come the meta-entries, which have this structure: */
struct fxi_entry {
/* entry type: first type is 'NP', then {0x01, 0x80}. */
uint8_t type[2];
uint8_t _unused[2];
/* entry number */
uint8_t number;
uint8_t _unused2[3];
/* unknown: either 0x00, 0x01, 0x02 */
uint8_t _unknown;
uint8_t _unused3;
/* unknown: either 0x00, 0x02, 0x03 */
uint8_t _unknown2;
uint8_t _unused4;
/* unknown: checksum? */
uint16_t checksum;
uint8_t _unused5[2];
/* unknown: some sort of type? */
uint8_t typeid;
uint8_t _unused6;
/* size of the file name */
uint8_t filename_size;
/* TODO: finish me */
};
# pragma pack()
#endif