pefile 1.0.0-dev.1 copy "pefile: ^1.0.0-dev.1" to clipboard
pefile: ^1.0.0-dev.1 copied to clipboard

A Dart library to parse Portable Executable (PE) format

example/pefile_example.dart

import 'package:pefile/pefile.dart' as pefile;

Future<void> main() async {
  var pe = pefile.parse('C:\\Windows\\System32\\notepad.exe');
  print('Is 64bit ? ${pe.is64bit}');

  var dos_hdr = pe.dos_header;
  print('DOS magic ${dos_hdr.e_magic}');
  print('Entry point ${pe.header_data.entry_point_rva.toRadixString(16)}h');

  for (var section in pe.sections) {
    print(
        'Section ${section.name}\taddress ${section.virtual_address.toRadixString(16)}h\tsize ${section.virtual_size.toRadixString(16)}h');

    print(
        'First 16 bytes : ${pe.getSectionData(section).sublist(0, 16).map((e) => e.toRadixString(16).padLeft(2, '0')).join(' ')}');
  }
}
1
likes
100
pub points
0%
popularity

Publisher

unverified uploader

A Dart library to parse Portable Executable (PE) format

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

ffi

More

Packages that depend on pefile