Skip to content

Instantly share code, notes, and snippets.

@Wonicon
Created July 11, 2016 11:07
Show Gist options
  • Save Wonicon/a5f4d879cbe0483a4394bb5165b154a4 to your computer and use it in GitHub Desktop.
Save Wonicon/a5f4d879cbe0483a4394bb5165b154a4 to your computer and use it in GitHub Desktop.
Check function name from objdump -d output
#!/usr/bin/env ruby
result = []
File.read(ARGV[0]).each_line do |line|
# Match pattern "XXXXXXXX <function-name>:"
# and extract the function name.
# Note that all the symbol including '<', '>'
# and ':' are literal, except 'function-name',
# which is the variable we want.
matchData = /(?<=\h{8} <)\w+(?=>:$)/ .match line
result << matchData.to_s if matchData
end
puts result.sort
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment