# Vault 7: Projects

This publication series is about specific projects related to the Vault 7 main publication.

### Protego

# MLA -- File I/O Library

- 1
- 2
…
- 59
- 60
- 61
- 62
- 63
…
- 82
- 83

Function
int FILEIO_PutChar (char c, FILEIO_OBJECT * handle)
1.7.1.3.25 FILEIO_Read Function
Reads data from a file.
File
fileio_lfn.h
Syntax
size_t FILEIO_Read(void * buffer, size_t size, size_t count, FILEIO_OBJECT * handle);
Returns
The number of data objects that were read. This value will match 'count' if the read was successful, or be less than count if it
was not.
Sets error code which can be retrieved with FILEIO_ErrorGet:
• FILEIO_ERROR_WRITE_ONLY - The file is not opened in read mode.
• FILEIO_ERROR_BAD_SECTOR_READ - There was an error reading the FAT to determine the next cluster in the file, or
an error reading the file data.
• FILEIO_ERROR_INVALID_CLUSTER - The next cluster in the file is invalid.
• FILEIO_ERROR_EOF - There is no next cluster in the file (EOF)
• FILEIO_ERROR_WRITE - Cached data could not be written to the device.
Description
Reads data from a file and stores it in 'buffer.'
Preconditions
The drive containing the file must be mounted and the file handle must represent a valid, opened file.
Parameters
Parameters Description
buffer The buffer that the data will be written to.
size The size of data objects to read, in bytes
count The number of data objects to read
handle The handle of the file.
Function
size_t FILEIO_Read (void * buffer, size_t size, size_t count,
FILEIO_OBJECT * handle)
1.7.1.3.26 FILEIO_Write Function
Writes data to a file.
File
fileio_lfn.h
Syntax
size_t FILEIO_Write(const void * buffer, size_t size, size_t count, FILEIO_OBJECT * handle);
Returns
The number of data objects that were written. This value will match 'count' if the write was successful, or be less than count if
1.7 Library Interface MLA - File I/O Library Help File I/O Layer
61

- 1
- 2
…
- 59
- 60
- 61
- 62
- 63
…
- 82
- 83