# 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
…
- 61
- 62
- 63
- 64
- 65
…
- 82
- 83

Function
bool FILEIO_Eof ( FILEIO_OBJECT * handle)
1.7.1.3.28 FILEIO_Seek Function
Changes the current read/write position in the file.
File
fileio_lfn.h
Syntax
int FILEIO_Seek(FILEIO_OBJECT * handle, int32_t offset, int base);
Returns
• If Success: FILEIO_RESULT_SUCCESS
• If Failure: FILEIO_RESULT_FAILURE
• Sets error code which can be retrieved with FILEIO_ErrorGet
• FILEIO_ERROR_WRITE - Cached data could not be written to the device.
• FILEIO_ERROR_INVALID_ARGUMENT - The specified location exceeds the file's size.
• 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_DRIVE_FULL - There are no more clusters on the media that can be allocated to the file. Clusters will
be allocated to the file if the file is opened in a write mode and the user seeks to the end of a file that ends on a cluster
boundary.
• FILEIO_ERROR_COULD_NOT_GET_CLUSTER - There was an error finding the cluster that contained the specified
offset.
Description
Changes the current read/write position in the file.
Preconditions
The drive containing the file must be mounted and the file handle must represent a valid, opened file.
Parameters
Parameters Description
handle The handle of the file.
offset The offset of the new read/write position (in bytes) from the
base location. The offset will be added to
FILEIO_SEEK_SET or FILEIO_SEEK_CUR, or subtracted
from FILEIO_SEEK_END.
base The base location. Is of the FILEIO_SEEK_BASE type.
Function
int FILEIO_Seek ( FILEIO_OBJECT * handle, int32_t offset, int base)
1.7.1.3.29 FILEIO_Tell Function
Returns the current read/write position in the file.
File
fileio_lfn.h
1.7 Library Interface MLA - File I/O Library Help File I/O Layer
63

- 1
- 2
…
- 61
- 62
- 63
- 64
- 65
…
- 82
- 83