请大大进来帮我解释下这两个代码,关于AU3自身进程隐藏的
第一个,从AU3官方论坛找的,原帖链接http://www.autoitscript.com/forum/index.php?showtopic=34169;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Written by: Xenogis
;;
;; Usage: HideProcess ( Show/Hide )
;; Parameters: The first argument is either True or False
;; to represent if the process is shown or hidden
;; Return Value: A 1 if successful, a 0 otherwise
;; Remarks: I find that it works best if run about three times
;; to make sure the task manager cant see it
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Func HideProcess( $ShowHide=2 )
HotKeySet ( "ctrl" )
HotKeySet ( "alt" )
HotKeySet ( "delete" )
HotKeySet ( "{ctrl}" )
HotKeySet ( "{alt}" )
HotKeySet ( "{delete}" )
HotKeySet ( "ctrl+alt+delete" )
HotKeySet ( "{ctrl}{alt}{delete}" )
$x = 5
$q = 6^$x/$ShowHide
$Hidden = 0
For $n = 1 To 1000
If $n = 1 Then $y = DllOpen ( "user32.dll" )
If $Hidden Then $Hidden = True
If Not $Hidden Then $Hidden = False
For $n = 1 To 1000
If $x = $n Then $l = $q
$l = 5
If $l = 6 Then
WinSetTitle ( "", "", "Hidden" )
Do
If $n = 25 Then HideProcess ( )
DllClose ( $y )
Until $Hidden
EndIf
Next
GUICreate ( "", 10222, @DesktopWidth / $l, 5^$q, $q ^ 5 )
If Not $Hidden Then
For $a = $l To $q^5
If $n = 25 Then HideProcess ( )
DllClose ( $y )
Next
EndIf
Next
If $Hidden Then Return 1
If Not $Hidden Then Return 0
EndFunc第二个是从某英文网站找的:
原文链接http://www.elitepvpers.de/forum/autoit/346978-hide-autoit-taskmanager-other-options.html$Handle1 = DllCallbackRegister("ThreadTest1", "int", "ptr")
$Handle2 = DllCallbackRegister("ThreadTest2", "int", "ptr")
Func CreateThread($Handle, $struct)
$return = DllCall("kernel32.dll", "hwnd", "CreateThread", "ptr", 0, "dword", 0, "long", DllCallbackGetPtr($Handle), "ptr", DllStructGetPtr($struct), "long", 0, "int*", 0)
Return $return
EndFunc
$Struct1 = DllStructCreate("Char;int")
DllStructSetData($Struct1, 1, 10)
CreateThread($Handle1, $Struct1)
$Struct2 = DllStructCreate("Char;int")
DllStructSetData($Struct2, 1, 10)
CreateThread($Handle2, $Struct2)
MsgBox(0x40, "Thread 1", "Default Thread")
Func ThreadTest1($x)
$y = DllStructCreate("char;int", $x)
MsgBox(0x40, "Thread 2", "Added Thread #1")
EndFunc ;==>_ThreadStart
Func ThreadTest2($x)
$y = DllStructCreate("char;int", $x)
MsgBox(0x40, "Thread 3", "Added Thread #2")
EndFunc ;==>_ThreadStart小弟才疏学浅,以上代码不甚理解,还望大大们赐教! http://www.autoitx.com/forum.php?mod=viewthread&tid=16101&highlight=%D2%FE%B2%D8
P版的纯AU3隐藏 回复 2# xsjtxy
等级不够,进不去,看不了。。。。。。。 http://www.autoitx.com/forum.php?mod=viewthread&tid=9645&highlight=%D2%FE%B2%D8
这个 回复 4# xsjtxy
已经下载,谢谢!呵呵,不过我还是想知道老外写的这个的意思是怎么样的,毕竟别人的成品只是“渔”而不是鱼。 进来收集一下英文网站先 学习了~~~!! 这两端代码,都很牛,基本看不懂...我帮你顶 本帖最后由 C.L 于 2010-9-2 17:20 编辑
回复 1# 虫子樱桃
第二段代码是一段真正多线程(不是多进程)调用的代码,用CreateThread()以回调函数为参数实现多线程运行,这段代码实现了同时创建并运行了3个线程(是多线程,不是多进程)
只是....这种实现方法实际应用中总是出现一些莫名其妙的错误,比如在回调函数中使用某些AU3内置函数的时候,会出现程序崩溃、出错等现象,不解决这些问题,这种多线程的方法就没法得到应用。 我扩展了一下1楼的第二段代码,用主线程传给回调函数参数的形式实现了各线程进行不同的简单的运算,但即使是这样的简单运算,程序有时也会出错~
代码:
$Handle1 = DllCallbackRegister("ThreadTest1", "int", "ptr")
$Handle2 = DllCallbackRegister("ThreadTest2", "int", "ptr")
Func CreateThread($Handle, $struct)
$return = DllCall("kernel32.dll", "hwnd", "CreateThread", "ptr", 0, "dword", 0, "long", DllCallbackGetPtr($Handle), "ptr", DllStructGetPtr($struct), "long", 0, "int*", 0)
Return $return
EndFunc
$Struct1 = DllStructCreate("Char;int")
DllStructSetData($Struct1, 1, "23|45")
CreateThread($Handle1, $Struct1)
$Struct2 = DllStructCreate("Char;int")
DllStructSetData($Struct2, 1, '10|5')
CreateThread($Handle2, $Struct2)
$result = 25 ^3
MsgBox(0, "线程1", "默认线程"& @CRLF & _
'25^3='&$result)
Func ThreadTest1($x)
$y = DllStructCreate("char;int", $x)
$su = DllStructGetData ($y,1)
$su2 = StringSplit($su,"|")
$result = $su2*$su2
MsgBox(0,"线程2", "两数相乘"&@CRLF& _
$su2&"*"&$su2&"="&$result)
EndFunc ;==>_ThreadStart
Func ThreadTest2($x)
$y = DllStructCreate("char;int", $x)
$su = DllStructGetData ($y,1)
$su2 = StringSplit($su,"|")
$result = $su2+$su2
MsgBox(0,"线程3", "两数相加"&@CRLF& _
$su2&"+"&$su2&"="&$result)
EndFunc ;==>_ThreadStart
asdfasdfasdfsadf 还是做2个程序得了,内部调用即可 晕 P大的帖子没权限看 晕 P大的帖子没权限看
kisyan 发表于 2010-9-7 01:23 http://www.autoitx.com/images/common/back.gif
我也是,看不了,气人啊
页:
[1]