Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.2 KiB

  1. #========================================================================================
  2. # Convert netmsg.dll
  3. #========================================================================================
  4. # hsaimoto
  5. # 7/25/02
  6. # Bug fix for #423602
  7. #
  8. #========================================================================================
  9. $repstr[0]=']]=NET.HLP';
  10. $repstr[1]=']]=NETUS.HLP';
  11. $flag=0;
  12. if ($ARGV[0] eq "")
  13. {
  14. print "\n";
  15. print "perl netmsgconv.pl filename1(netmsg.dll) [output_folder]\n";
  16. print "\n";
  17. exit;
  18. }
  19. else
  20. {
  21. $ARGV[0];
  22. $idx=rindex($ARGV[0],"\\");
  23. $tkn =$ENV{'TMP'};
  24. $tkn .=substr($ARGV[0],$idx);
  25. $tkn =~ s/.$/_/g;
  26. $cmd="bingen -t";
  27. $cmd .= " ";
  28. $cmd .= $ARGV[0];
  29. $cmd .= " ";
  30. $cmd .= $tkn;
  31. print $cmd;
  32. system($cmd);
  33. open(ifn,"$tkn");
  34. }
  35. $ofn=$ARGV[1];
  36. if ($#ARGV!=0)
  37. {
  38. $ofn.="\\";
  39. }
  40. $ofn.=substr($ARGV[0],$idx+1);
  41. $ofn =~ s/.$/_/g;
  42. print $ofn;
  43. {
  44. open(ofn,">$ofn");
  45. }
  46. while($buff = <ifn>)
  47. {
  48. if ($flag==0)
  49. {
  50. if ($buff=~/$repstr[0]/)
  51. {
  52. $buff =~ s/($repstr[0])/$repstr[1]/g;
  53. $flag=1;
  54. }
  55. }
  56. print (ofn $buff);
  57. }
  58. close(ifn);
  59. close(ofn);