#! perl # Store help text in variable $syntax = "\nVideoROM.pl, Version 2.00 for DOS, Windows & OS/2\n"; $syntax = $syntax."Display video adapter manufacturer information read from video ROM\n\n"; $syntax = $syntax."Usage: VIDEOROM.PL [ DEBUG ]\n\n"; $syntax = $syntax."Where: \"DEBUG\" will display intermediate results for debugging purposes.\n\n"; $syntax = $syntax."This script uses DEBUG.EXE to read the information from video ROM.\n"; $syntax = $syntax."Tested in Windows 2000 only.\n\n"; $syntax = $syntax."Written by Rob van der Woude\n"; $syntax = $syntax."http://www.robvanderwoude.com\n\n"; $syntax = $syntax."Original idea by ComputerHope\n"; $syntax = $syntax."http://www.computerhope.com/rdebug.htm\n\n\n\n\n"; # Check command line argument(s) if ( $ARGV[0] ) { if ( $ARGV[0] =~ m/^DEBUG$/i ) { $debugmode = true; } else { print $syntax; } } # Create temporary DEBUG script $dbg = "D C000:0040\nD C000:00C0\nQ\n"; open( DBGSCR, "> videorom.dbg" ) || die( "Cannot open temporary DEBUG script: $!" ); print DBGSCR $dbg; close DBGSCR; # Run DEBUG script and store output in array @viddbg = `debug.exe < videorom.dbg`; if ( $debugmode ) { foreach $_ (@viddbg) { print $_; } } # Concatenate relevant parts of screen output into one single line $line = ""; foreach $_ (@viddbg) { chomp $_; $line = $line.substr( $_, 61 ); if ( $debugmode ) { print substr( $_, 61 )."\n"; } } if ( $debugmode ) { print "$line\n"; } # Use some regular expressions to tidy up the output before display $line =~ m/\.([\w]+ +[^\s.]+.*$)/; $line = $1; $line =~ s/\.*$//; # Display the result print "\nYour video adapter info:\n\n".$line."\n"; # Delete temporary DEBUG script `DEL videorom.dbg >NUL 2>&1`;