找回密码
 加入
搜索
查看: 4030|回复: 12

[GUI管理] 【求助】AU3能不能为exe程序加皮肤?

 火.. [复制链接]
发表于 2010-12-11 22:05:58 | 显示全部楼层 |阅读模式
我想为一款exe程序加载AU3里的Vista样式皮肤,我忙活了一整天都没有搞定,特来此请教各位大侠。AU3能不能为exe程序加皮肤?
发表于 2010-12-12 14:13:03 | 显示全部楼层
楼主要学会搜索,本论坛上多的是这样的代码资源.怎么不搜一下呢?
发表于 2010-12-12 15:10:03 | 显示全部楼层

为已有的exe程序另外添加皮肤,应该不可以吧
发表于 2010-12-12 22:49:42 | 显示全部楼层
因为在那之后,我又更新了一下Thread.au3,使得部分函数不能兼容以前的代码。用以下这个测试:
#include <Thread.au3>
 
Const $tagSET_SKIN = "hWnd hWnd;wchar LicenKey[8];wchar SkinPath[520]"
 
$sImagePath = @ScriptDir & "\SkinCrafterDll.dll"
$sFilePath = @ScriptDir & "\Sequence.skf"
 
$pLibrary = _RTLoadLibrary($sImagePath)
 
Const $pApplySkin = _RTGetProcAddress($pLibrary, "ApplySkin")
Const $pDecorateAs = _RTGetProcAddress($pLibrary, "DecorateAs")
Const $pLoadSkinFromFile = _RTGetProcAddress($pLibrary, "LoadSkinFromFile")
Const $pInitDecoration = _RTGetProcAddress($pLibrary, "InitDecoration")
Const $pInitLicenKeys = _RTGetProcAddress($pLibrary, "InitLicenKeys")
 
_RTFreeLibrary($pLibrary)
 
Run(@SystemDir & "\notepad.exe")
ProcessWait("notepad.exe")
Sleep(700)
 
$hWnd = WinGetHandle("[class:Notepad]")
 
$iProcessId = _RTGetWindowThreadProcessId($hWnd)
$iThreadId = @Extended
 
$hProcess = _RTOpenProcess($iProcessId)
$hThread = _RTOpenThread($iThreadId)
 
$pStartAddr = _RTVirtualAllocEx($hProcess, 2048)
$pParam = $pStartAddr + 512
 
_RTWriteProcessMemory($hProcess, $pParam, $hWnd, 4, "hWnd*")
_RTWriteProcessMemory($hProcess, $pParam + 4, 1, 6, "wstr")
_RTWriteProcessMemory($hProcess, $pParam + 20, $sFilePath, 518, "wstr")
 
_RTInfiltrateThread($hProcess, $hThread, $pStartAddr, 0, $pParam)
 
$bCode = "0x" & _
        "55" & _                                                ; push        ebp
        "8BEC" & _                                                ; mov        ebp, esp
        "60" & _                                                ; pushad
        "8B5D08" & _                                                ; mov        ebx, dword ptr [ebp+8]
        "8D7B04" & _                                                ; lea        edi, dword ptr [ebx+4]
        "57" & _                                                ; push        edi
        "57" & _                                                ; push        edi
        "6A00" & _                                                ; push        0
        "57" & _                                                ; push        edi
        "B8" & _RTLongPtrToBytes($pInitLicenKeys) & _                ; mov        eax, InitLicenKeys
        "FFD0" & _                                                ; call        eax
        "6A01" & _                                                ; push        1
        "B8" & _RTLongPtrToBytes($pInitDecoration) & _                ; mov        eax, InitDecoration
        "FFD0" & _                                                ; call        eax
        "8D7B14" & _                                                ; lea        edi, dword ptr [ebx+14]
        "57" & _                                                ; push        edi
        "B8" & _RTLongPtrToBytes($pLoadSkinFromFile) & _        ; mov        eax, LoadSkinFromFile
        "FFD0" & _                                                ; call        eax
        "6A19" & _                                                ; push        19
        "FF33" & _                                                ; push        dword ptr [ebx]
        "B8" & _RTLongPtrToBytes($pDecorateAs) & _                ; mov        eax, DecorateAs
        "FFD0" & _                                                ; call        eax
        "B8" & _RTLongPtrToBytes($pApplySkin) & _                ; mov        eax, ApplySkin
        "FFD0" & _                                                ; call        eax
        "83C420" & _                                                ; add        esp, 20
        "61" & _                                                ; popad
        "5D" & _                                                ; pop        ebp
        "C20400"                                                ; ret        4
 
_RTLoadDllEx($sImagePath, $hProcess)
_RTInjectEx($hProcess, $pStartAddr, $bCode)
_RTResumeThread($hThread)
 
_RTCloseHandle($hThread)
_RTCloseHandle($hProcess)


注意把$sImagePath和$sFilePath改成你自己的DLL文件和皮肤文件的全路径。
发表于 2010-12-13 13:23:12 | 显示全部楼层
刚好要用上,谢谢楼上的
发表于 2010-12-13 14:07:22 | 显示全部楼层
呵呵,正需要这个哈学习学习
发表于 2010-12-25 11:09:53 | 显示全部楼层
正想学习学习呢
发表于 2010-12-25 22:16:57 | 显示全部楼层
测试成功!厉害
发表于 2010-12-25 22:49:47 | 显示全部楼层
下载来试试
发表于 2010-12-26 00:43:27 | 显示全部楼层
回复 4# pusofalse


    谢谢分享!
 楼主| 发表于 2011-1-7 14:18:11 | 显示全部楼层
回复 4# pusofalse

发生内存不能读的错误!!
发表于 2011-1-7 14:24:49 | 显示全部楼层
高手神马的 最讨厌了
发表于 2011-1-7 18:22:44 | 显示全部楼层
回复 11# lhylm


    不知道什么情况。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-20 19:54 , Processed in 0.083663 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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