readPeVersionResources function

Future<List<PeVersionResource>> readPeVersionResources(
  1. String filePath
)

Every RT_VERSION leaf the image carries, in resource-directory order — named entries before numeric ones, and languages in the order each entry lists them. Empty when there is nothing to read.

See readPeVersionResource for the file-handling contract.

Implementation

Future<List<PeVersionResource>> readPeVersionResources(String filePath) async {
  RandomAccessFile? handle;
  try {
    final file = File(filePath);
    if (!await file.exists()) return const [];
    handle = await file.open();
    return await _readFromHandle(handle);
  } on FileSystemException {
    return const [];
  } on RangeError {
    return const [];
  } finally {
    await handle?.close();
  }
}