LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2599|回复: 8

个人编写的基于Net Send的消息发送程序,正在加入多线程机制和图形界面:)

[复制链接]
发表于 2003-12-31 14:49:36 | 显示全部楼层 |阅读模式
下载地址:http://alchemy.cn/SendMsg.zip

  1. [b]
  2. # -*- perl -*-
  3. # Copyright (C) 2000 Alchemy Ltd.,
  4. # $Id: SendMsg.pl,v 1.0 2003/12/31 15:27:07 $
  5. # You can contact me with the QQ:155442271 E-mail:root@alchemy.cn

  6. use Win32::NetSend;
  7. use Getopt::Long;
  8. %Config = (
  9.         title => "NetSend群发器 Ver 1.0",
  10.         author => "剑过无痕(QQ:155442271)",
  11. );
  12. Configure(\%Config,@ARGV);
  13. sub Configure {
  14.         my ($Config,@Args) = @_;
  15.         my $Result;
  16.         Getopt::Long::Configure("prefix_pattern=(-|\/)");
  17.         $Result = GetOptions(
  18.                 $Config,
  19.                 qw(
  20.                         start|s=s
  21.                         end|e=s
  22.                         message|m=s
  23.                         file|f=s
  24.                         help|h
  25.                 )
  26.         );
  27.         $Config->{help} =1 if(!$Result);
  28. }

  29. if ($Config{file}) {
  30.         if (-e $Config{file}) {
  31.                 my @msg = &read_data($Config{file});
  32.                 foreach (@msg) {
  33.                         chomp;
  34.                         $message .= $_."\r";
  35.                 }
  36.                 print "发送文件名:$Config{file}\n";
  37.         }
  38.         else {
  39.                 print "发送内容文件错误!";
  40.         }
  41. }
  42. elsif ($Config{message}) {
  43.         $message = $Config{message};
  44.         print "发送文件内容:$message\n";
  45. }

  46. if ($Config{start} && $Config{end}) {
  47.         print "开始地址:$Config{start}\n";
  48.         print "结束地址:$Config{end}\n";
  49.         @arrayfrom = split(/\./,$Config{start});
  50.         @arrayto = split(/\./,$Config{end});
  51.         my $flag = 0;
  52.         if ($arrayfrom[0] < $arrayto[0]) {
  53.                 @first = ($arrayfrom[0]...$arrayto[0]);
  54.                 $flag = 1;
  55.         }
  56.         else {
  57.                 @first = $arrayfrom[0];
  58.         }
  59.        
  60.         if ($arrayfrom[1] < $arrayto[1]) {
  61.                 if ($flag == 1) {
  62.                         @second = ($arrayfrom[1]...255);
  63.                 }
  64.                 else {
  65.                         @second = ($arrayfrom[1]...$arrayto[1]);
  66.                 }
  67.                 $flag = 1;
  68.         }
  69.         else {
  70.                 if ($flag == 1) {
  71.                         @second = ($arrayfrom[1]...255);
  72.                 }
  73.                 else {
  74.                         @second = ($arrayfrom[1]);
  75.                 }
  76.         }
  77.         if ($arrayfrom[2] < $arrayto[2]) {
  78.                 if ($flag == 1) {
  79.                         @third = ($arrayfrom[2]...255);
  80.                 }
  81.                 else {
  82.                         @third = ($arrayfrom[2]...$arrayto[2]);
  83.                 }
  84.                 $flag = 1;
  85.         }
  86.         else {
  87.                 if ($flag == 1) {
  88.                         @third = ($arrayfrom[2]...255);
  89.                 }
  90.                 else {
  91.                         @third = ($arrayfrom[2]);
  92.                 }
  93.         }
  94.         if ($arrayfrom[3] < $arrayto[3]) {
  95.                 if ($flag == 1) {
  96.                         @fouth = ($arrayfrom[3]...255);
  97.                 }
  98.                 else {
  99.                         @fouth = ($arrayfrom[3]...$arrayto[2]);
  100.                 }
  101.                 $flag = 1;
  102.         }
  103.         else {
  104.                 if ($flag == 1) {
  105.                         @fouth = ($arrayfrom[3]...255);
  106.                 }
  107.                 else {
  108.                         @fouth = ($arrayfrom[3]);
  109.                 }
  110.         }
  111.         foreach $first (@first) {
  112.                 foreach $second (@second) {
  113.                         foreach $third (@third) {
  114.                                 foreach $fouth (@fouth) {
  115.                                         $to = "$first\.$second\.$third\.$fouth";
  116.                                         print "正在向地址:$to 发送!\n";
  117.                                         &send($to,$message);
  118.                                 }
  119.                         }
  120.                 }
  121.         }
  122. }
  123. elsif($Config{help}) {
  124.         Syntax();
  125. }
  126. else {
  127.         print "参数传递错误,请使用-h查看帮助信息\n";
  128.         Syntax();
  129. }

  130. exit;

  131. sub send {
  132.         my ($to,$message) = @_;
  133.         my $NetSend = Win32::NetSend->new(
  134.                                         to => "$to",
  135.                                         message => "$message");
  136.         $NetSend->Send();
  137. }

  138. sub read_data {
  139.         my $filename = shift;
  140.         my @data;
  141.         if (-e $filename) {
  142.                 local(*FILE);
  143.                 open(FILE,"<$filename");
  144.                 @data = (<FILE>);
  145.                 close(FILE);
  146.         }
  147.         return @data;
  148. }

  149. sub Syntax {
  150. #使用说明提示
  151.         $0 =~ /([^\\]*?)$/;
  152.         my $Script = $1;
  153.         my $Writespace = " " x length($Script);
  154.         print <<"EOT";
  155. 单线程NetSend群发器 Ver 1.0                   剑过无痕(QQ:155442271)
  156. 使用说明:
  157. $Script  [-s Startip][-e Endip][-h]
  158. $Writespace  -s                ..................待发送的起始IP地址
  159. $Writespace  -e                ..................待发送的结束IP地址
  160. $Writespace  -m                ..................发送的信息内容
  161. $Writespace  -f                ..................从文件中读取信息
  162. $Writespace  -h                ..................本帮助信息.
  163. EOT
  164. }
复制代码
发表于 2003-12-31 18:07:32 | 显示全部楼层
多謝兄弟分享
 楼主| 发表于 2004-1-2 22:44:18 | 显示全部楼层

更新的后图形+多线程信使发送程序

点击下载
同时向高手们请教:在net send中,内容是使用什么方式编码的?我试过很多中,都不行,所以无法显示中文


  1. #!/usr/bin/perl
  2. use Tk;
  3. require Tk::LabFrame;
  4. require Tk::LabEntry;
  5. use Tk::ProgressBar;
  6. use Tk::DialogBox;
  7. use Win32::NetSend;
  8. use Thread;
  9. #use threads;#编译过程中需要打开
  10. my $crstatus = '请打开文件或填写内容';
  11. my $percent_done = 0;
  12. my $threads = 10;
  13. my $ip = "202.115.22.29-202.115.22.29";
  14. $mw = MainWindow->new(-title => '消息群发 Ver1.0.0.2');
  15. $menu = $mw->Menu;
  16. $file_o = $menu->cascade(-label => '文件(~F)', -tearoff => 0);
  17. $opt_m = $menu->cascade(-label => '选项(~O)', -tearoff => 0);
  18. $help = $menu->cascade(-label => '帮助(~H)', -tearoff => 0);
  19. #===========================================================
  20. #字体部分设置
  21. $font = $mw->fontCreate(        '宋体',
  22.                                                         -size => 9
  23.                                 );

  24. #===========================================================
  25. #文件部分设置
  26. my $types = [
  27.      ['发送信息内容文件',       ['.msg', '.txt']],
  28.      ['IP Files',      '.ip'           ],
  29.      ['C Source Files',   '.c',      'TEXT'],
  30.      ['GIF Files',        '.gif',          ],
  31.      ['GIF Files',        '',        'GIFF'],
  32.      ['All Files',        '*',             ],
  33. ];
  34. $file_submenu = $mw->Menu(        -tearoff => 0,
  35.                                                         -font => $font,
  36.                                                         -menuitems => [
  37.                                                                 [        command => '打开消息文件(~O)',
  38.                                                                         -command =>
  39.                                                                                 sub {
  40.                                                                                         my $filename = $file_submenu->getOpenFile(-filetypes=>[$types->[0]]);
  41.                                                                                         if ($filename ne "") {
  42.                                                                                                 # 读取文件中的内容
  43.                                                                                                 my @filedata = Read_Data($filename);
  44.                                                                                                 foreach (@filedata) {
  45.                                                                                                         chomp;
  46.                                                                                                         $message .= $_."\n";
  47.                                                                                                 }
  48.                                                                                                 $text->delete('1.0','end');
  49.                                                                                                 $text->insert('end',$message);
  50.                                                                                                 $crstatus = $filename;
  51.                                                                                         }
  52.                                                                                 }
  53.                                                                 ],
  54.                                                                 [        command => '保存消息文件(~S)',
  55.                                                                         -command =>
  56.                                                                                 sub {
  57.                                                                                         my $filename = $file_submenu->getSaveFile(        -defaultextension => 'msg',
  58.                                                                                                                                                                                 -filetypes=>[$types->[0]],
  59.                                                                                                                         );
  60.                                                                                         if ($filename ne "") {
  61.                                                                                                 # 写入内容到文件中
  62.                                                                                                 my $content = $text->get('1.0','end');
  63.                                                                                                 Write_Data($filename,$content);
  64.                                                                                                 $crstatus = '保存成功';
  65.                                                                                         }
  66.                                                                                 }
  67.                                                                 ],
  68.                                                                 "-",
  69.                                                                 [        command => '发送(~E)',
  70.                                                                         -command => sub {
  71.                                                                                 my @allip;
  72.                                                                                 my $current_line = 1;
  73.                                                                                 $message = '';
  74.                                                                                 while ((my $linedata = $text->get($current_line.'.0 linestart', $current_line.'.0 lineend')) ne '') {
  75.                                                                                         #$linedata = expand($linedata);
  76.                                                                                         chomp $linedata;
  77.                                                                                         $message .= "\r".$linedata;
  78.                                                                                         $current_line++;
  79.                                                                                         #$linedata = unexpand($linedata);
  80.                                                                                         $linedata = '';
  81.                                                                                 }
  82.                                                                                 @allip = &get_ip_arrary($ip);
  83.                                                                                 if (scalar(@allip)<$threads) {
  84.                                                                                         $threads = scalar(@allip);
  85.                                                                                 }
  86.                                                                                 @all_tid = ();
  87.                                                                                 for ($i=0;$i<$threads;$i++) {
  88.                                                                                         my $toip = shift @allip;
  89.                                                                                         @send_argv = ($toip,$message);
  90.                                                                                         my $t = Thread->new(\&send, @send_argv);
  91.                                                                                         $tid = Thread->self->tid;
  92.                                                                                         push @all_tid,$tid;
  93.                                                                                 }
  94.                                                                                 while (scalar(@allip)) {
  95.                                                                                         foreach (0...$threads) {
  96.                                                                                                 if ($all_tid[$_] == 0) {
  97.                                                                                                         my $toip = shift @allip;
  98.                                                                                                         @send_argv = ($toip,$message);
  99.                                                                                                         my $t = Thread->new(\&send, @send_argv);
  100.                                                                                                         $tid = Thread->self->tid;
  101.                                                                                                         $all_tid[$_] = $tid;
  102.                                                                                                 }
  103.                                                                                         }
  104.                                                                                 }
  105.                                                                         }
  106.                                                                 ],
  107.                                                                 [        command => '退出(~X)',
  108.                                                                         -command => sub { exit }
  109.                                                                 ],
  110.                                                         ]
  111.                                 );
  112. $file_o->configure(-menu => $file_submenu);
  113. #===========================================================
  114. #选项部分设置
  115. $opt_submenu = $mw->Menu(        -tearoff => 0,
  116.                                                         -font => $font,
  117.                                                         -menuitems => [
  118.                                                                 [        checkbutton => '远程开启对方服务(~S)',
  119.                                                                         -state => 'disabled',
  120.                                                                         -variable => \$opt_s],
  121.                                                                 [        command => '发送IP范围设置(~P)',
  122.                                                                         -command => sub {
  123.                                                                                 $ip = &config_ip;
  124.                                                                                 $crstatus = "当前IP设置为:$ip";
  125.                                                                         }
  126.                                                                 ],
  127.                                                                 [        command => '发送线程设置(~P)',
  128.                                                                         -command => sub {
  129.                                                                                 $threads = &config_threads;
  130.                                                                                 $crstatus = "当前发送线程设置为:$threads";
  131.                                                                         }
  132.                                                                 ],
  133.                                                         ]
  134.                                 );
  135. $opt_m->configure(-menu => $opt_submenu);

  136. #===========================================================
  137. #帮助部分设置
  138. $help_submenu = $mw->Menu(        -tearoff => 0,
  139.                                                         -font => $font,
  140.                                                         -menuitems => [
  141.                                                                 [        command => '使用说明(~I)',
  142.                                                                         -command => sub {
  143.                                                                                 &intro;
  144.                                                                         }
  145.                                                                 ],
  146.                                                                 [        command => '鸣谢(~T)',
  147.                                                                         -command => sub {
  148.                                                                                 &thanks;
  149.                                                                         }
  150.                                                                 ],
  151.                                                         ]
  152.                                 );
  153. $help->configure(-menu => $help_submenu);
  154. #===========================================================
  155. $mw->configure(        -menu => $menu);
  156. #===========================================================
  157. #文本输入栏
  158. $text = $mw->Text(
  159.                                 -takefocus => 1,
  160.                                 -width => 80,
  161.                                 -height => 30,
  162.                                 -font => $font,
  163.                 );
  164. $mw->Scrollbar();
  165. $text->pack();

  166. # 产生状态栏
  167. my $status = $mw->LabFrame(-label => "2004年01月01日",
  168.                            -labelside => "right",
  169.                                                    -relief=>sunken, );
  170. # 当前动作显示
  171. $status->LabEntry(        #-label => "Testing",
  172.                                         -textvariable => \$crstatus,
  173.                                         -relief=>sunken,
  174.                                         -width=>30,
  175.                                         -borderwidth=>0
  176.                 )->pack(-side=>"left");
  177. # 进度条显示
  178. $progress = $status->ProgressBar(
  179.                 -troughcolor => '#CCCCCC',
  180.                 -anchor => 'w',
  181.         -width => 15,
  182.         -length => 200,
  183.         -from => 0,
  184.                 -gap => 0,
  185.         -to => 100,
  186.         -blocks => 50,
  187.         -colors => [0, '#66CCFF'],
  188.         -variable => \$percent_done
  189.     )->pack();
  190. $status->pack(-side=>"bottom", -fill=>"x");
  191. #===========================================================
  192. MainLoop;

  193. # 读取文件中的数据
  194. sub Read_Data {
  195.         my $filename = shift;
  196.         my @data;
  197.         if (-e $filename) {
  198.                 local(*FILE);
  199.                 open(FILE,"<$filename");
  200.                 @data = (<FILE>);
  201.                 close(FILE);
  202.         }
  203.         return @data;
  204. }

  205. # 读取文件中的数据
  206. sub Write_Data {
  207.         my ($filename,$content) = @_;
  208.         local(*FILE);
  209.         open(FILE,">$filename");
  210.         print(FILE "$content");
  211.         close(FILE);
  212.         return;
  213. }

  214. sub config_ip {
  215.         $d = $mw->DialogBox(-title => "修改IP地址范围", -buttons => ["提交", "取消"]);
  216.         my $config_intro = $d->Label(
  217.                                 -text => "请填写IP地址范围\n格式为:startip-endip",
  218.                                 -font => $font,
  219.         )->pack();
  220.         my $config_ip = $d->Text(
  221.                                 -takefocus => 1,
  222.                                 -width => 31,
  223.                                 -height => 1,
  224.                                 -font => $font,
  225.         )->pack();
  226.         $config_ip->insert('end',$ip);
  227.         $d->Show;
  228.         my $new_ip = $config_ip->get('1.0','end');
  229.         return $new_ip;
  230. }

  231. sub config_threads {
  232.         $d2 = $mw->DialogBox(-title => "修改IP地址范围", -buttons => ["提交", "取消"]);
  233.         my $config_intro = $d2->Label(
  234.                                 -text => "请填写最大发送线程数\n格式如同:30",
  235.                                 -font => $font,
  236.         )->pack();
  237.         my $config_threads = $d2->Text(
  238.                                 -takefocus => 1,
  239.                                 -width => 6,
  240.                                 -height => 1,
  241.                                 -font => $font,
  242.         )->pack();
  243.         $config_threads->insert('end',$threads);
  244.         $d2->Show;
  245.         $new_threads = $config_threads->get('1.0','end');
  246.         return $new_threads;
  247. }

  248. sub get_ip_arrary {
  249.         $ip = shift;
  250.         my @allip;
  251.         my ($startip,$endip) = split(/-/,$ip);
  252.         @arrayfrom = split(/\./,$startip);
  253.         @arrayto = split(/\./,$endip);
  254.         my $flag = 0;
  255.         if ($arrayfrom[0] < $arrayto[0]) {
  256.                 @first = ($arrayfrom[0]...$arrayto[0]);
  257.                 $flag = 1;
  258.         }
  259.         else {
  260.                 @first = $arrayfrom[0];
  261.         }
  262.         if ($arrayfrom[1] < $arrayto[1]) {
  263.                 if ($flag == 1) {
  264.                         @second = (0...255);
  265.                 }
  266.                 else {
  267.                         @second = ($arrayfrom[1]...$arrayto[1]);
  268.                 }
  269.                 $flag = 1;
  270.         }
  271.         else {
  272.                 if ($flag == 1) {
  273.                         @second = (0...255);
  274.                 }
  275.                 else {
  276.                         @second = ($arrayfrom[1]);
  277.                 }
  278.         }
  279.         if ($arrayfrom[2] < $arrayto[2]) {
  280.                 if ($flag == 1) {
  281.                         @third = (0...255);
  282.                 }
  283.                 else {
  284.                         @third = ($arrayfrom[2]...$arrayto[2]);
  285.                 }
  286.                 $flag = 1;
  287.         }
  288.         else {
  289.                 if ($flag == 1) {
  290.                         @third = (0...255);
  291.                 }
  292.                 else {
  293.                         @third = ($arrayfrom[2]);
  294.                 }
  295.         }
  296.         if ($arrayfrom[3] < $arrayto[3]) {
  297.                 if ($flag == 1) {
  298.                         @fouth = (0...255);
  299.                 }
  300.                 else {
  301.                         @fouth = ($arrayfrom[3]...$arrayto[3]);
  302.                 }
  303.                 $flag = 1;
  304.         }
  305.         else {
  306.                 if ($flag == 1) {
  307.                         @fouth = (0...255);
  308.                 }
  309.                 else {
  310.                         @fouth = ($arrayfrom[3]);
  311.                 }
  312.         }
  313.         foreach $first (@first) {
  314.                 foreach $second (@second) {
  315.                         foreach $third (@third) {
  316.                                 foreach $fouth (@fouth) {
  317.                                         $to = "$first\.$second\.$third\.$fouth";
  318.                                         push(@allip,$to);
  319.                                 }
  320.                         }
  321.                 }
  322.         }
  323.         return @allip;
  324. }


  325. sub send {
  326.         my ($to,$message) = @_;
  327.         my $NetSend = Win32::NetSend->new(
  328.                                         to => "$to",
  329.                                         message => "$message");
  330.         $NetSend->Send();
  331. }

  332. sub intro {
  333.         $d3 = $mw->DialogBox(-title => "使用说明", -buttons => ["确定"]);
  334.         my $intro = $d3->Label(
  335.                                 -text => "目前只支持英文发送,中文在后续版本中推出\n使用前请先设置IP地址和线程数,建议使用默\n认的线程数                              ",
  336.                                 -font => $font,
  337.         )->pack(-side => "left");
  338.         $d3->Show;
  339.         return 1;
  340. }

  341. sub thanks {
  342.         $d4 = $mw->DialogBox(-title => "使用说明", -buttons => ["确定"]);
  343.         my $thanks = $d4->Label(
  344.                                 -text => "感谢所有支持我的兄弟姐妹,特别是 Win32::\nNetSend 模块的提供者: Victor Sanchez   ",
  345.                                 -font => $font,
  346.         )->pack();
  347.         $d4->Show;
  348.         return 1;
  349. }
复制代码
发表于 2004-1-9 13:57:58 | 显示全部楼层
上面写着 php 源码,真让人沮丧,呵呵
但程序是相当好的,代码很好。

收藏转载一下,:)  谢谢。
发表于 2004-1-9 15:24:37 | 显示全部楼层
兄弟也不用沮丧的, "php 源码" 是php 自帶的功能?淼, 要標明顯示perl  源码也得修改一點論壇的源碼呢, 反正php 加亮用在perl 也沒什麼問題, 大家就用下去而已
本?砦乙蚕爰舆@個功能的, 不過要修改源碼和加一些腳本而且咱們devel 也不喜歡加亮呢 :p
发表于 2004-1-9 15:26:46 | 显示全部楼层
:sorry,在没有通知楼主的情况下删除了彩色。但用PHP会让人误解的。所以我改成了现在的格式!
发表于 2004-1-9 15:31:06 | 显示全部楼层
呵呵,以前也写过一个类似的,用的是Roth的Win32::Message,TK界面,有冒名功能,好像也引入线程(忘了),后来就没再写,又是一个半成品:(,回家找找。。。
发表于 2004-1-10 21:37:55 | 显示全部楼层
不错,我也不喜欢加彩色,呵呵。
发表于 2004-10-22 21:46:17 | 显示全部楼层
呵呵,今天从光盘里翻出以前曾没写完的代码,和这个是同话题就贴上来,代码写得较早,也没写完,错误在所难免,现在懒得去改了,大伙凑合着看吧:)
不好意思,很少上这个论坛,不知道怎么上贴代码:(
##### Name:          p_sems.pl
##### Version:       0.0.1.5
##### Author:        y6cmE
##### Contact:       y6cme@4red.org
##### Licence:       The licence of Perl
##### Last Updated:  2002.11.15
use Tk;
use Thread;
use Tk:abFrame;
use Tk:ialogBox;
use Win32::Message;
my @z1=(cursor,'clock',font,'fixed',bg,'violet',fg,'salmon4',text);
my @z2=(cursor,'spider',bg,'gray',fg,'firebrick3',insertbackground,'LavenderBlush');
my @z3=(bg,'black',fg,'red',activebackground,'green',text);
my @z4=(cursor,'gumby',bg,'grey',fg,'aquamarine4',insertbackground,'LightCyan',width,35,height,15);
my @z5=(cursor,'mouse',bg,'coral',fg,'bisque1',insertbackground,'bisque4',width,40,height,15);
my @z6=(cursor,'pencil',bg,'HotPink',fg,'lavender',insertbackground,'LavenderBlush');
my @z7=(cursor,'sailboat',font,'fixed',bg,'sienna4',fg,'coral2',text);
my @z8=(bg,'snow4',fg,'seashell1',activebackground,'gold1',text);
my $mw=tkinit(title,p_sems);
   $mw->opup(-popanchor,'center');
   $mw->resizable(0,0);
my $a1=$mw->Label(@z1,'冒名:');
my $a2=$mw->Label(@z1,'目标:');
my $b1=$mw->Entry(@z2);
my $b2=$mw->Entry(@z2);
my $c1=$mw->Button(@z3,'关于',cursor,'question_arrow',command,\&about);
my $c2=$mw->Button(@z3,'撤退',cursor,'heart',command,sub{exit});
my $c3=$mw->Button(@z3,'出手',cursor,'pirate',command,\&send);
my $c4=$mw->Button(@z3,'群发',cursor,'star',command,\&array);
my $dd=$mw->Text(@z4);
   $a1->grid(-row,0,-column,0);
   $b1->grid(-row,0,-column,1);
   $c1->grid(-row,0,-column,2);
   $c2->grid(-row,0,-column,3);
   $a2->grid(-row,1,-column,0);
   $b2->grid(-row,1,-column,1);
   $c3->grid(-row,1,-column,2);
   $c4->grid(-row,1,-column,3);
   $dd->grid(-row,2,-column,0,-columnspan,4);
sub send{
        my $g1=$b1->get();
        my $g2=$b2->get();
        my $g3=$dd->get("1.0","end");
        if(Win32::Message::Send("",$g2,$g1,$g3)){
                my $t1=$mw->DialogBox(title,'p_sems',-buttons,['知道啦']);
                $t1->add("Label",text,'已发送,但无法肯定对方是否收到。',font,'fixed')->pack;
                $t1->Show;
        }
        else{
                my $t2=$mw->DialogBox(title,'p_sems',-buttons,['去死吧']);
                $t2->add("Label",text,'发送失败!原因未知。这个破软件!',font,'fixed')->pack;
                $t2->Show;
        }
}
sub array{
        my $gh=$mw->Toplevel(title,'p_sems——群发');
           $gh->resizable(0,0);
           $gh->opup(-popanchor,'left');
        my $g1=$gh->Label(@z7,'IP段:');
        my $g2=$gh->Label(@z7,'冒名:');
        my $g3=$gh->Label(@z7,'起始:');
        my $g4=$gh->Label(@z7,'终止:');
        my $h1=$gh->Entry(@z6,width,15,validate,'key',vcmd,sub{length(shift)>11?0:1;});
        my $h2=$gh->Entry(@z6,width,15);
        my $h3=$gh->Entry(@z6,width,3,validate,'key',vcmd,sub{length(shift)>3?0:1;});
        my $h4=$gh->Entry(@z6,width,3,validate,'key',vcmd,sub{length(shift)>3?0:1;});
        my $v1=$gh->Button(@z8,'关  于',cursor,'right_tee',command,\&help);
        my $v2=$gh->Button(@z8,'撤  退',cursor,'left_tee',command,sub{$gh->destroy});
        my $v3=$gh->Button(@z8,' 出  手',cursor,'circle',command,\&thread);
        my $t1=$gh->Text(@z5);
           $g1->grid(-row,0,-column,0);
           $h1->grid(-row,0,-column,1,-columnspan,3);
           $g2->grid(-row,0,-column,4);
           $h2->grid(-row,0,-column,5,-columnspan,2);
           $g3->grid(-row,1,-column,0);
           $h3->grid(-row,1,-column,1);
           $g4->grid(-row,1,-column,2);
           $h4->grid(-row,1,-column,3);
           $v1->grid(-row,1,-column,4);
           $v2->grid(-row,1,-column,5);
           $v3->grid(-row,1,-column,6);
           $t1->grid(-row,2,-column,0,-columnspan,7);
        sub thread{
                my $y1=$h1->get;
                my $y2=$h2->get;
                my $y3=$h3->get;
                my $y4=$h4->get;
                my $s1=$t1->get("1.0","end");
                my @jj;
                for(my $x=$y3;$x<=$y4;$x++){
                        my $u1=$y1.".$x";
                        my $xmm=Thread->new(\&hack);
                        push(@jj,$xmm);
                }
                $_->join foreach @jj;
                open(FILE,'>>hack.txt');
                sub hack{
                        if(Win32::Message::Send("",$u1,$y2,$s1)){
                                print FILE "已发送到$u1,但无法肯定对方是否一定收到。\n";
                        }
                        else{
                                print FILE "发送到$u1失败,原因未知。\n";
                        }
                }
        }
        close FILE;
}
sub help{
        my $zz=$mw->Toplevel(title,'p_sems——群发',cursor,'umbrella');
           $zz->resizable(0,0);
           $zz->transient($zz->arent->toplevel);
        my $mm=$zz->LabFrame(-label,'p_sems  群发',-labelside,'acrosstop',-fg,'salmon1',-bg,'green');
        my $nn=$mm->Label(width,66,height,17,font,'fixed',anchor,'nw',justify,'left',fg,'purple2',bg,'grey72',cursor,'trek',text,'             p_sems的群发使用说明书

★★在IP段里填入要群发网络消息的IP段,应该填入例如“127.0.0”,最
后面不要填写“.”,也就是说不要填为“127.0.0.”之类的,起始.终止
栏里填入要从哪个IP开始及哪个IP结束,也是不用填“.”就直接填入“26
”之类的,不要填写为“26.”。本群发采用多线程,发送给多少个IP,就
打开多少个线程。为顺利发送网络消息,请关闭安全防护程序,如:天网。
★★注意:此程序尚在开发之中,许多功能还不完善,并还存在bug,请勿
将此程序用于商业行为,自担风险吧。由于时间与能力有限,本人暂不提供
技术支持。
_____________________________________________________________________

★★                            作者:y6cmE 联系:y6cme@4red.org
_____________________________________________________________________');
           $mm->pack();
           $nn->pack();
}
sub about{
        my $ab=$mw->Toplevel(title,'About p_sems',cursor,'gobbler');
           $ab->resizable(0,0);
        my $lf=$ab->LabFrame(-label,'p_sems',-labelside,'acrosstop',-fg,'orangered',-bg,'yellow');
        my $la=$lf->Label(width,80,height,17,font,'fixed',anchor,'nw',justify,'left',fg,'blue',bg,'azure',cursor,'heart',text,'                      p_sems使用说明书

★★这是一个网络消息发送器,是个比较简单的程序,用于向Win32机器发送网络消息。但
是无法保证用户能够收到您所发的消息,请先肯定对方已运行了Messenger或Winpopup。使
用时在冒名栏里填入您想冒充的机器,可以是IP地址或机器名,甚至可以使用任何数据,也
可以不填。目标栏应填入您想发送网络消息给对方,对方的IP地址或计算机名或其它可以接
收消息的地址。在最下面的空白部分写入您的信息,此为对方收到的正文。最后点击“出手
”即可。为顺利发送网络消息,请关闭安全防护程序,例如:天网等。
★★另外,群发功能用于向指定IP段的所有主机发送网络消息,具体请参阅群发里的帮助。
★★注意:此程序尚在开发之中,许多功能还不完善,并还存在bug,请勿将此程序用于商
业行为,自担风险吧。由于时间与能力有限,本人暂不提供技术支持。
____________________________________________________________________________________

★★                                       作者:y6cmE 联系:y6cme@4red.org
____________________________________________________________________________________');
           $lf->pack();
           $la->pack();
}
MainLoop;

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表