1 die "usage: mapFileLookUpWin32.pl file.map [[address | \@responseFile]...]\n" if (@ARGV < 2);
3 $mapFile = shift(@ARGV);
10 # handle response files that are call stacks
15 # search the file for IP addresses to look up
21 s/^.*unknown\(// && s/\).*//;
22 push(@find, $_) if ($_ ne "");
26 # insert all the found entries at the beginning of @ARGV
27 splice(@ARGV, 0, 0, @find);
33 # go to the beginning and skip past some cruft
37 last if (/^\s+Address/)
40 # search for the symbol containg this address
47 ($seg, $symbol, $address, $junk) = split;
48 $address = hex($address);
50 if ($lastAddress <= $find && $address > $find)
52 printf "%08x: %08x %08x %s\n", $find, $lastAddress, $address, $lastSymbol;
57 $lastAddress = $address;
58 $lastSymbol = $symbol;
60 printf "%08x: not found\n", $find if ($found == 0);