睡觉() [英] Sleep()

查看:125
本文介绍了睡觉()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个syn flood程序(win32),以便在我的道德黑客程度上对Web服务器发起DoS攻击并提出几个问题。


我的程序采用以下参数:


synflood< dest ip address> < dest port> <要发送的数据包数量> <每个数据包之间的延迟>


并且工作方式如下:


创建自定义数据包

数据包{

增加源IP,源端口和序列号

发送数据包

打印成功消息

睡眠( atoi(argv [4]))

}


我的问题在于我在命令行接收的输出,我认为睡眠功能正在工作但是没有获得一个成功消息然后暂停然后下一个,我得到一个大的暂停然后所有消息一起出现。这是睡眠功能的典型行为还是我做错了什么?


谢谢

Rob

Hi I''m writing a syn flood program (win32) to launch a DoS attack on a web server for my ethical hacking degree and have a couple of questions.

My program takes the following arguments:

synflood <dest ip address> <dest port> <number of packets to send> <delay between each packet>

And works something like this:

Create custom packet
for each packet{
increment source ip, source port and sequence number
Send packet
print success message
Sleep(atoi(argv[4]))
}

My problem lies in the output I am recieving at the comand line, I think the sleep function is working but rather than getting one success message then a pause then the next one, I get one large pause and then all of the messages appear together. Is this typical behaviour for the sleep function or am i doing something wrong?

Thanks
Rob

推荐答案


这是睡眠功能的典型行为还是我做错了什么?
Is this typical behaviour for the sleep function or am i doing something wrong?



你好Rob,这不是典型的行为。典型的行为是当前程序暂停执行的数量为
由参数指定的分数。


你可以用睡眠()发布部分吗?


Savage


Hi Rob,it''s not typical behaviour.Typical behavior is that the current program is
suspended from execution for the number of secounds specified by the argument.

Can u post part with sleep()?


Savage


肯定是代码:


[代码已编辑出来因此不能用于恶意目的 - ADMIN]
sure heres the code:

[code edited out so it can''t be used for malicious purposes - ADMIN]


是因为它在for循环中吗?这是我唯一能想到的......


也许所有的cout<<消息全部在for循环结束时完成????还是我离开了标记?
Is it becuase it is in a for loop? Thats the only thing I can think of...

maybe all of the cout<< messages all get done at the end of a for loop???? or am I way off the mark?


这篇关于睡觉()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆