找回密码
 加入
搜索
查看: 6413|回复: 13

[系统综合] 请大大进来帮我解释下这两个代码,关于AU3自身进程隐藏的

 火.. [复制链接]
发表于 2010-8-31 15:37:34 | 显示全部楼层 |阅读模式
第一个,从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/ ... -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[0]
EndFunc

$Struct1 = DllStructCreate("Char[200];int")
DllStructSetData($Struct1, 1, 10)
CreateThread($Handle1, $Struct1)

$Struct2 = DllStructCreate("Char[200];int")
DllStructSetData($Struct2, 1, 10)
CreateThread($Handle2, $Struct2)

MsgBox(0x40, "Thread 1", "Default Thread")

Func ThreadTest1($x)
        $y = DllStructCreate("char[200];int", $x)
        MsgBox(0x40, "Thread 2", "Added Thread #1")
EndFunc   ;==>_ThreadStart

Func ThreadTest2($x)
        $y = DllStructCreate("char[200];int", $x)
        MsgBox(0x40, "Thread 3", "Added Thread #2")
EndFunc   ;==>_ThreadStart
小弟才疏学浅,以上代码不甚理解,还望大大们赐教!
发表于 2010-8-31 15:44:14 | 显示全部楼层
 楼主| 发表于 2010-8-31 15:53:10 | 显示全部楼层
回复 2# xsjtxy


    等级不够,进不去,看不了。。。。。。。
发表于 2010-8-31 15:56:03 | 显示全部楼层
 楼主| 发表于 2010-8-31 16:05:03 | 显示全部楼层
回复 4# xsjtxy


    已经下载,谢谢!呵呵,不过我还是想知道老外写的这个的意思是怎么样的,毕竟别人的成品只是“渔”而不是鱼。
发表于 2010-8-31 16:14:54 | 显示全部楼层
进来收集一下英文网站先
发表于 2010-8-31 16:38:30 | 显示全部楼层
学习了~~~!!
发表于 2010-9-1 01:04:53 | 显示全部楼层
这两端代码,都很牛,基本看不懂...我帮你顶
发表于 2010-9-2 16:24:11 | 显示全部楼层
本帖最后由 C.L 于 2010-9-2 17:20 编辑

回复 1# 虫子樱桃

第二段代码是一段真正多线程(不是多进程)调用的代码,用CreateThread()以回调函数为参数实现多线程运行,这段代码实现了同时创建并运行了3个线程(是多线程,不是多进程)
只是....这种实现方法实际应用中总是出现一些莫名其妙的错误,比如在回调函数中使用某些AU3内置函数的时候,会出现程序崩溃、出错等现象,不解决这些问题,这种多线程的方法就没法得到应用。
发表于 2010-9-2 16:41:00 | 显示全部楼层
我扩展了一下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[0]
EndFunc

$Struct1 = DllStructCreate("Char[200];int")
DllStructSetData($Struct1, 1, "23|45")
CreateThread($Handle1, $Struct1)

$Struct2 = DllStructCreate("Char[200];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[200];int", $x)
                $su = DllStructGetData ($y,1)
                $su2 = StringSplit($su,"|")
                $result = $su2[1]*$su2[2]
        MsgBox(0,"线程2", "两数相乘"&@CRLF& _
                        $su2[1]&"*"&$su2[2]&"="&$result)
EndFunc   ;==>_ThreadStart

Func ThreadTest2($x)
        $y = DllStructCreate("char[200];int", $x)
                $su = DllStructGetData ($y,1)
                $su2 = StringSplit($su,"|")
                $result = $su2[1]+$su2[2]
        MsgBox(0,"线程3", "两数相加"&@CRLF& _
                        $su2[1]&"+"&$su2[2]&"="&$result)
EndFunc   ;==>_ThreadStart

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2010-9-2 16:57:10 | 显示全部楼层
asdfasdfasdfsadf

评分

参与人数 1金钱 -15 收起 理由
pusofalse -15 禁止无意义回复,扣分警告!

查看全部评分

发表于 2010-9-3 00:03:54 | 显示全部楼层
还是做2个程序得了,内部调用即可
发表于 2010-9-7 01:23:53 | 显示全部楼层
晕   P大的帖子没权限看
发表于 2010-9-7 18:39:17 | 显示全部楼层
晕   P大的帖子没权限看
kisyan 发表于 2010-9-7 01:23



    我也是,看不了,气人啊
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-20 09:05 , Processed in 0.099896 second(s), 26 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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