Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- open(FH, "-|", "objdump", "-d", "-M", "intel", $ARGV[0]) or die "objdump failed\n";
- while(<FH>){
- if(/([0-9a-f]+) <(\S+)>:/) {
- $start_addr = hex($1);
- $name = $2;
- } elsif(/^\s*([0-9a-f]+):\s+((?:[0-9a-f]{2} )+)/ and $name) {
- $end_addr = hex($1) + split(/ /, $2);
- } elsif(/^$/ and $name) {
- printf("%d %s\n", $end_addr - $start_addr, $name);
- undef $end_addr
- }
- }
- printf("%d %s\n", $end_addr - $start_addr, $name) if $end_addr;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement