-
Notifications
You must be signed in to change notification settings - Fork 0
/
romfs.h
29 lines (25 loc) · 939 Bytes
/
romfs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* romfs.h ROM file access functions.
*
* Author: [email protected]
* Copyright: (c) 2022 Oozlum
* Licence: MIT
*/
#ifndef ROMFS_H
#define ROMFS_H
/* mount and return the filesystem content of a ROM blob. This must be
* called on a ROM blob before trying to extract files from it.
* Store the length of the mounted filesystem in romfs_len.
* The returned pointer is dynamically allocated and must be free'd by the caller
* when the ROM is nolonger needed.
*
* passphrase may be NULL.
*
* return zero on failure.
*/
const char* mount_rom(const char *rom_blob, size_t rom_blob_len, size_t *romfs_len, const char *passphrase);
/* find and return a pointer to the string containing the contents of the file
* matching the given path. Store the file length in file_len if given.
* return zero if the file is not found.
*/
const char* extract_rom_file(const char *romfs, const char *path, size_t *file_len);
#endif