2008年10月2日 星期四

[script] BAT 的延遲技巧 (wait or sleep)

ㄧ整個很見鬼的批次檔技巧,雖然很久沒寫了...麗娜絲娘真的很可愛唷!!!
DOS 的批次檔應該很少人在用了,小微微大惡魔已經把世界改造的很好用了,所以忽然想在常用的批次檔裡使用wait 或 sleep 忽然間找不到函數好用( 麗娜絲就好用很多啦!!!)

之前常用延遲的手法就是用ping來製造延遲
缺點大概就是時間ㄧ點都不精準

ex:
@ping 127.0.0.1 -n %1 1>null

可以把它寫成一個wait.bat 檔然後呼叫他

說到寫成wait.bat 小技巧,這樣子已將用很久了,但是今天卻看到更詭異的用法,太猛了...

就是
寫一個sleep.exe !!!

阿好像沒啥嘛,就是用檸檬C,咖啡JAVA都可以寫一個然後再用批次檔去呼叫就好...

可是這個範例卻是用這樣寫!!!

ex:

:: Sleep.bat - Sleep/Delay/Wait n seconds
:: Herbert Kleebauer(Germany) - 2005/05/29
:: Modified by Will Sort - 2005/06/02
@echo off
echo q | debug>nul
echo Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(Lu(LX(LeZRR]EEEUYRX2Dx=>sleep.com
echo 0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU WwX0GwUY Wv;ovBX2Gv0ExGIuht6>>sleep.com
echo T}{z~~@GwkBG@OEKcUt`~}@MqqBsy?seHB~_Phxr?@zAB`LrPEyoDt@Cj?>>sleep.com
echo pky_jN@QEKpEt@ij?jySjN@REKpEt@jj?jyGjN@SEKkjtlGuNw?p@pjirz>>sleep.com
echo LFvAURQ?OYLTQ@@?~QCoOL~RDU@?aU?@{QOq?@}IKuNWpe~FpeQFwH?Vkk>>sleep.com
echo _GSqoCvH{OjeOSeIQRmA@KnEFB?p??mcjNne~B?M??QhetLBgBPHexh@e=>>sleep.com
echo EsOgwTLbLK?sFU`?LDOD@@K@xO?SUudA?_FKJ@N?KD@?UA??O}HCQOQ??R>>sleep.com
echo _OQOL?CLA?CEU?_FU?UAQ?UBD?LOC?ORO?UOL?UOD?OOI?UgL?LOR@YUO?>>sleep.com
echo dsmSQswDOR[BQAQ?LUA?_L_oUNUScLOOuLOODUO?UOE@OwH?UOQ?DJTSDM>>sleep.com
echo QTqrK@kcmSULkPcLOOuLOOFUO?hwDTqOsTdbnTQrrDsdFTlnBTm`lThKcT>>sleep.com
echo @dmTkRQSoddTT~?K?OCOQp?o??Gds?wOw?PGAtaCHQvNntQv_w?A?it\EH>>sleep.com
echo {zpQpKGk?Jbs?FqokOH{T?jPvP@IQBDFAN?OHROL?Kj??pd~aN?OHROd?G>>sleep.com
echo Q??PGT~B??OC~?ipO?T?~U?p~cUo0x>>sleep.com
sleep.com>sleep.exe
del sleep.com
echo wait 2 seconds:
sleep.exe 2000


-------

沒看錯  囧!! 她用一個批次檔去塞出一個.com 再換檔名成 .exe
用那些外星語(機械亂語)去塞耶!!!

寫一個test.bat 把上面的貼進去執行就可以用了,不過我真的無法知道那些亂碼是什麼內容,說不定有毒或是木馬喔,剛剛是過真的可以跑。

隨便懷疑人家是不好的!!! 應該是很厲害的人...感謝前輩分享