2002-06-11 05:27:48 +04:00
|
|
|
#!./miniruby -s
|
|
|
|
|
2005-11-05 07:43:46 +03:00
|
|
|
$:.unshift(File.expand_path("../..", __FILE__))
|
|
|
|
require 'win32/mkexports'
|
2002-06-11 05:27:48 +04:00
|
|
|
|
2005-11-05 07:43:46 +03:00
|
|
|
class Exports::Bcc < Exports
|
|
|
|
def forwarding(internal, export)
|
|
|
|
internal[/\A_?/]+export
|
|
|
|
end
|
|
|
|
|
2008-08-05 11:39:21 +04:00
|
|
|
def each_line(objs, &block)
|
2005-11-05 07:43:46 +03:00
|
|
|
objs.each do |obj|
|
2008-08-05 11:39:21 +04:00
|
|
|
opt = /\.(?:so|dll)\z/i =~ obj ? "-ee" : "-oiPUBDEF -oiPUBD32"
|
|
|
|
IO.foreach("|tdump -q #{opt} #{obj.tr('/', '\\')} < nul", &block)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def each_export(objs)
|
|
|
|
objdump(objs) do |l|
|
2005-11-05 07:43:46 +03:00
|
|
|
next unless /(?:PUBDEF|PUBD32|EXPORT)/ =~ l
|
2008-08-05 11:39:21 +04:00
|
|
|
yield $1 if /'(.*?)'/ =~ l
|
2005-11-05 07:43:46 +03:00
|
|
|
end
|
|
|
|
yield "_strcasecmp", "_stricmp"
|
|
|
|
yield "_strncasecmp", "_strnicmp"
|
|
|
|
end
|
2002-06-11 05:27:48 +04:00
|
|
|
end
|