pe 0.1.0
pe: ^0.1.0 copied to clipboard
Read and write PE format files.
import 'package:pe/pe.dart' as pe;
void main() {
final data = pe.Data()..read('C:/Windows/System32/cmd.exe');
print('machine : ${data.file.machine == 332 ? 'x86' : 'x64'}');
for (final sectionTable in data.sectionTables) {
int? end = sectionTable.name.indexOf(0);
if (end == -1) {
end = null;
}
final name = String.fromCharCodes(sectionTable.name, 0, end);
print('${name.padRight(8)}: ${sectionTable.sizeOfRawData}');
}
}