找回密码
 加入
搜索
查看: 3076|回复: 11

[AU3基础] 迅雷引擎3.2调用方法求助

[复制链接]
发表于 2020-3-26 16:34:32 | 显示全部楼层 |阅读模式
本帖最后由 itsky2 于 2020-4-3 10:06 编辑

论坛上的全部是老版的 并且下载相应dll无法调用 新版的连函数名都变了 百度易语言都是加密的模块 没有源码 方法也没有
以下是dll中的函数 希望各位了解的大佬帮下忙 看看如何调用3.2的dll





本帖子中包含更多资源

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

×
发表于 2020-3-30 10:48:30 | 显示全部楼层
看这些函数,好像没多大变化吧,好久没接触这个了
 楼主| 发表于 2020-3-30 17:27:59 | 显示全部楼层
破帽遮颜 发表于 2020-3-30 10:48
看这些函数,好像没多大变化吧,好久没接触这个了

变化很大,暂停继续都没有了
发表于 2020-3-30 18:04:34 | 显示全部楼层
_XL_StartTask和_XL_StopTask不是吗?
#cs
        BOOL XL_StartTask(HANDLE hTask);
        开始下载。任务创建成功后,不会马上开始下载,需调用此接口才会开始下载。
        参数:
        [in]hTask,任务句柄
        返回值:TRUE表示成功,FALSE表示失败。当任务不存在时,调用会失败。
        说明:异步执行,如果任务出于pending状态则不能调用该接口。
#ce
Func _XL_StartTask($hTask)
        Local $iRet = DllCall($__ghXLDll, "int:cdecl", "XL_StartTask", "int", $hTask)
        If @error Then Return SetError(@error, 0, 0)
        Return $iRet[0]
EndFunc

#cs
        BOOL XL_StopTask(HANDLE hTask)
        停止下载
        参数:
        [in]hTask,任务句柄
        返回值:TRUE表示成功,FALSE表示失败。当任务不存在时,调用会失败。
        说明:获取任务信息是使用轮询方式的,最终任务下载了多少数据在任务停止下载后查询才是正确的。调用后任务不会立即停止,需轮询到任务状态为PAUSE之后,才能获取到。
#ce
Func _XL_StopTask($hTask)
        Local $iRet = DllCall($__ghXLDll, "int:cdecl", "XL_StopTask", "int", $hTask)
        If @error Then Return SetError(@error, 0, 0)
        Return $iRet[0]
EndFunc
 楼主| 发表于 2020-3-31 18:57:30 | 显示全部楼层
破帽遮颜 发表于 2020-3-30 18:04
_XL_StartTask和_XL_StopTask不是吗?

XL_CreateTaskByURL用原来的代码闪退
发表于 2020-4-2 13:32:05 | 显示全部楼层
迅雷下载还有资源昂
发表于 2020-4-4 02:07:23 | 显示全部楼层
本帖最后由 繁星 于 2020-4-4 22:56 编辑
#AutoIt3Wrapper_UseX64=n

Local $Url = 'https://down5.huorong.cn/sysdiag-full-5.0.41.9.exe', _
        $FileName = StringMid($Url, StringInStr($Url, '/', Default, -1) + 1)
Global $hXL = DllOpen('xldl.dll')
DllCall($hXL, "bool:cdecl", 'XL_Init')
Local $tagDownTaskParam = 'int nReserved;' & _
                'wchar szTaskUrl[2084];' & _
                'wchar szRefUrl[2084];' & _
                'wchar szCookies[4096];' & _
                'wchar szFilename[260];' & _
                'wchar szReserved0[260];' & _
                'wchar szSavePath[260];' & _
                'ptr hReserved;' & _
                'bool bReserved;' & _
                'wchar szReserved1[64];' & _
                'wchar szReserved2[64];' & _
                'bool isOnlyOriginal;' & _
                'int nReserved1;' & _
                'bool DisableAutoRename;' & _
                'bool isResume;' & _
                'int reserved[2048];'

Local $CreateTask = DllStructCreate($tagDownTaskParam)
DllStructSetData($CreateTask, 'szTaskUrl', $Url)
DllStructSetData($CreateTask, 'szFilename', $FileName)
DllStructSetData($CreateTask, 'szSavePath', @ScriptDir & '\')
;~ DllStructSetData($CreateTask, 'bReserved', 0)
;~ DllStructSetData($CreateTask, 'IsOnlyOriginal', 0)
;~ DllStructSetData($CreateTask, 'nReserved1', 5)
;~ DllStructSetData($CreateTask, 'DisableAutoRename', 0)
;~ DllStructSetData($CreateTask, 'IsResume', 1)

Local $Result = DllCall($hXL, 'hwnd:cdecl', 'XL_CreateTask', 'ptr', DllStructGetPtr($CreateTask))
DllCall($hXL, 'bool:cdecl', 'XL_StartTask', 'hwnd', $Result[0])
While 1
        If FileExists(@ScriptDir & '\' & $FileName) Then ExitLoop
WEnd
DllCall($hXL, 'bool:cdecl', 'XL_UnInit')
DllClose($hXL)

评分

参与人数 1金钱 +20 收起 理由
itsky2 + 20 很给力!

查看全部评分

 楼主| 发表于 2020-4-5 08:33:06 | 显示全部楼层

膜拜大佬!您有时间的话再看看回调函数
发表于 2020-4-6 02:25:11 | 显示全部楼层
itsky2 发表于 2020-4-5 08:33
膜拜大佬!您有时间的话再看看回调函数

参考发哥这个帖子:https://www.autoitx.com/forum.php?mod=viewthread&tid=71601&highlight=%D1%B8%C0%D7
#AutoIt3Wrapper_UseX64=n

Local $Url = 'https://down5.huorong.cn/sysdiag-full-5.0.41.9.exe', _
                $FileName = StringMid($Url, StringInStr($Url, '/', Default, -1) + 1)
Global $hXL = DllOpen('xldl.dll')

Local $tagDownTaskParam = 'int nReserved;' & _
                'wchar szTaskUrl[2084];' & _
                'wchar szRefUrl[2084];' & _
                'wchar szCookies[4096];' & _
                'wchar szFilename[260];' & _
                'wchar szReserved0[260];' & _
                'wchar szSavePath[260];' & _
                'hwnd hReserved;' & _
                'bool bReserved;' & _
                'wchar szReserved1[64];' & _
                'wchar szReserved2[64];' & _
                'bool isOnlyOriginal;' & _
                'uint nReserved1;' & _
                'bool DisableAutoRename;' & _
                'bool isResume;' & _
                'dword reserved[2048];'

Local $tagDownTaskInfo = 'int stat;' & _
                'int failCode;' & _
                'wchar szFilename[260];' & _
                'wchar szReserved0[260];' & _
                'int64 nTotalSize;' & _
                'int64 nTotalDownload;' & _
                'float fPercent;' & _
                'int nTotalTime;' & _
                'int nSrcTotal;' & _
                'int nSrcUsing;' & _
                'int nReserved1;' & _
                'int nReserved2;' & _
                'int nReserved3;' & _
                'int nReserved;' & _
                'int64 nTotalUpload;' & _
                'int64 nDonationP2P;' & _
                'int64 nReserved4;' & _
                'int64 nDonationOrgin;' & _
                'int64 nDonationP2S;' & _
                'int64 nReserved5;' & _
                'int64 nReserved6;' & _
                'int nSpeed;' & _
                'int nSpeedP2S;' & _
                'int nSpeedP2P;' & _
                'bool IsOriginUsable;' & _
                'float fReserved;' & _
                'int bReserved;' & _
                'dword reserved[64]'

Local $DownTaskInfo = DllStructCreate($tagDownTaskInfo)
Local $CreateTask = DllStructCreate($tagDownTaskParam)
DllStructSetData($CreateTask, 'szTaskUrl', $Url)
DllStructSetData($CreateTask, 'szFilename', $FileName)
DllStructSetData($CreateTask, 'szSavePath', @ScriptDir & '\')

DllCall($hXL, "bool:cdecl", 'XL_Init')
Local $Result = DllCall($hXL, 'hwnd:cdecl', 'XL_CreateTask', 'ptr', DllStructGetPtr($CreateTask))
DllCall($hXL, 'bool:cdecl', 'XL_StartTask', 'hwnd', $Result[0])

While 1
        If DllStructGetData($DownTaskInfo, 'stat') = 4 Then ExitLoop ;TSC_COMPLETE = 4
        DllCall($hXL, 'bool:cdecl', 'XL_QueryTaskInfoEx', 'hwnd', $Result[0], 'ptr', DllStructGetPtr($DownTaskInfo))
        ConsoleWrite('Task Status:' & DllStructGetData($DownTaskInfo, 'stat') & '  ')
        ConsoleWrite('Download Progress:' & DllStructGetData($DownTaskInfo, 'fPercent') & '  ')
        ConsoleWrite('Download Speed:' & DllStructGetData($DownTaskInfo, 'nSpeed') & @CRLF)
        Sleep(100)
WEnd

DllCall($hXL, 'bool:cdecl', 'XL_UnInit')
DllClose($hXL)

评分

参与人数 1金钱 +30 收起 理由
itsky2 + 30 很给力!

查看全部评分

 楼主| 发表于 2020-4-6 16:07:51 | 显示全部楼层
繁星 发表于 2020-4-6 02:25
参考发哥这个帖子:https://www.autoitx.com/forum.php?mod=viewthread&tid=71601&highlight=%D1%B8%C0%D ...

大佬能讲下cdecl的调用方式和默认的有什么区别吗
发表于 2020-5-5 17:53:43 | 显示全部楼层
综合一下几位老师的,链接地址分别为
https://www.autoitx.com/thread-28721-1-1.html
https://www.autoitx.com/thread-43839-1-1.html
https://www.autoitx.com/thread-43850-1-1.html
以上排名不分先后。。。

惭愧,不会原创,只为能用。




附件:




本帖子中包含更多资源

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

×
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-19 12:15 , Processed in 0.092024 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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