From 38de3e73bf0be64590af95cf785c3e5f2d62128a Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Tue, 17 Jul 2012 01:15:10 +0200 Subject: restore: implemented BasebandData request --- src/fls.h | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 src/fls.h (limited to 'src/fls.h') diff --git a/src/fls.h b/src/fls.h new file mode 100644 index 0000000..57b3869 --- /dev/null +++ b/src/fls.h @@ -0,0 +1,85 @@ +/* + * fls.h + * support for .fls file format (found in .bbfw files) + * + * Copyright (c) 2012 Nikias Bassen. All Rights Reserved. + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +#ifndef FLS_H +#define FLS_H + +#include + +struct _fls_element { + uint32_t type; + uint32_t size; + uint32_t empty; + const unsigned char* data; +} __attribute__((packed)); +typedef struct _fls_element fls_element; + +struct _fls_0c_element { + uint32_t type; + uint32_t size; + uint32_t empty; + uint32_t off_0x0c; + uint32_t off_0x10; + uint32_t off_0x14; + uint32_t off_0x18; + uint32_t data_size; // size without header + uint32_t off_0x20; + uint32_t offset; // absolute offset of data in file + const unsigned char* data; // data+0x14 contains offset to sig blob +} __attribute__((packed)); +typedef struct _fls_0c_element fls_0c_element; + +struct _fls_10_element { + uint32_t type; + uint32_t size; + uint32_t empty; + uint32_t data_size; // size without header + uint32_t off_0x10; + uint32_t offset; + const unsigned char* data; +} __attribute__((packed)); +typedef struct _fls_10_element fls_10_element; + +struct _fls_14_element { + uint32_t type; + uint32_t size; + uint32_t empty; + uint32_t data_size; // size without header + uint32_t off_0x10; + uint32_t offset; + const unsigned char* data; +} __attribute__((packed)); +typedef struct _fls_14_element fls_14_element; + +typedef struct { + unsigned int num_elements; + unsigned int max_elements; + fls_element** elements; + const fls_0c_element* c_element; + void* data; + uint32_t size; +} fls_file; + +fls_file* fls_parse(unsigned char* data, unsigned int size); +void fls_free(fls_file* fls); +int fls_update_sig_blob(fls_file* fls, const unsigned char* data, unsigned int size); +int fls_insert_ticket(fls_file* fls, const unsigned char* data, unsigned int size); + +#endif -- cgit v1.1-32-gdbae