class Exports::Mswin
Public Instance Methods
each_export(objs) { |strip, is_data| ... }
click to toggle source
# File ruby_3_3_0_preview1/win32/mkexports.rb, line 104 def each_export(objs) noprefix = ($arch ||= nil and /^(sh|i\d86)/ !~ $arch) objs = objs.collect {|s| s.tr('/', '\\')} filetype = nil objdump(objs) do |l| if filetype if /^\f/ =~ l filetype = nil next end case filetype when /OBJECT/, /LIBRARY/ l.chomp! next if /^[[:xdigit:]]+ 0+ UNDEF / =~ l next unless /External/ =~ l next if /(?:_local_stdio_printf_options|v(f|sn?)printf(_s)?_l)\Z/ =~ l next unless l.sub!(/.*?\s(\(\)\s+)?External\s+\|\s+/, '') is_data = !$1 if noprefix or /^[@_]/ =~ l next if /(?!^)@.*@/ =~ l || /@[[:xdigit:]]{8,32}$/ =~ l || /^_?#{PrivateNames}/o =~ l l.sub!(/^[@_]/, '') if /@\d+$/ !~ l elsif !l.sub!(/^(\S+) \([^@?\`\']*\)$/, '\1') next end when /DLL/ next unless l.sub!(/^\s*\d+\s+[[:xdigit:]]+\s+[[:xdigit:]]+\s+/, '') else next end yield l.strip, is_data else filetype = l[/^File Type: (.+)/, 1] end end yield "strcasecmp", "msvcrt.stricmp" yield "strncasecmp", "msvcrt.strnicmp" end
each_line(objs, &block)
click to toggle source
# File ruby_3_3_0_preview1/win32/mkexports.rb, line 98 def each_line(objs, &block) IO.popen(%w"dumpbin -symbols -exports" + objs) do |f| f.each(&block) end end