mkfuzzoids.pl 802 B

123456789101112131415161718192021222324252627282930
  1. #! /usr/bin/env perl
  2. # Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
  3. #
  4. # Licensed under the Apache License 2.0 (the "License"). You may not use
  5. # this file except in compliance with the License. You can obtain a copy
  6. # in the file LICENSE in the source distribution or at
  7. # https://www.openssl.org/source/license.html
  8. my $obj_dat_h = $ARGV[0];
  9. # The year the output file is generated.
  10. my $YEAR = [localtime()]->[5] + 1900;
  11. open IN, '<', $obj_dat_h
  12. || die "Couldn't open $obj_dat_h : $!\n";
  13. while(<IN>) {
  14. s|\R$||; # Better chomp
  15. next unless m|^\s+((0x[0-9A-F][0-9A-F],)*)\s+/\*\s\[\s*\d+\]\s(OBJ_\w+)\s\*/$|;
  16. my $OID = $1;
  17. my $OBJname = $3;
  18. $OID =~ s|0x|\\x|g;
  19. $OID =~ s|,||g;
  20. print "$OBJname=\"$OID\"\n";
  21. }
  22. close IN;