找回密码
 注册
广告投放 虚位以待【阿里云】2核2G云新老同享 99元/年,续费同价做网站就用糖果主机-sugarhosts.comJtti.com-新加坡服务器,美国服务器,香港服务器
查看: 124|回复: 0

关于修改 WinRAR 3.90 默认主题工具栏图标尺寸的方法【2009.08.27 修订】

[复制链接]
发表于 2010 年 10 月 6 日 20:43:02 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

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

×

本帖最后由 D4llower 于 2009-8-28 17:13 编辑
关于修改 WinRAR 3.90 默认主题工具栏图标尺寸的方法【2009.08.27 修订】
【2009.08.27 修订】:在热心网友 Dreamcast 的提醒下,修正了“搜索结果”对话框中的工具栏显示问题,在此表示感谢。完美的版本离不开大家的关注与支持!
  喜欢修改 WinRAR 默认主题的朋友应该都尝试过修改 WinRAR 主程序,使其支持 48×4832×32 尺寸的工具栏图标显示。但 WinRAR 更新到 3.90 版本后,因为使用了更新的编译器编译,导致之前版本的修改经验失效,原来的搜索特征已经找不到了。看到一些网友正为此而困惑,于是分析了一下新版本,发现了蛛丝马迹,特与大家分享下心得。

以下是OllyDbg中的部分关键反汇编代码:
【主界面工具栏调整】:
004695E0    81EC 80060000       sub esp,680
004695E6    A1 90034C00         mov eax,dword ptr ds:[4C0390]
004695EB    33C4                xor eax,esp
004695ED    898424 7C060000     mov dword ptr ss:[esp+67C],eax
004695F4    53                  push ebx
004695F5    8BD9                mov ebx,ecx
004695F7    8B03                mov eax,dword ptr ds:[ebx]
004695F9    85C0                test eax,eax
004695FB    74 0D               je short WinRAR.0046960A
004695FD    50                  push eax
004695FE    FF15 AC154B00       call dword ptr ds:[<&USER32.DestroyWindow>]    ; USER32.DestroyWindow
00469604    C703 00000000       mov dword ptr ds:[ebx],0
0046960A    6A 01               push 1
0046960C    68 04434B00         push WinRAR.004B4304                           ; ASCII "ViewMain"
00469611    68 C0174B00         push WinRAR.004B17C0                           ; ASCII "General\Toolbar"
00469616    E8 45D3FEFF         call WinRAR.00456960
0046961B    85C0                test eax,eax
0046961D    0F84 1F040000       je WinRAR.00469A42
00469623    6A 01               push 1
00469625    68 50204B00         push WinRAR.004B2050                           ; ASCII "LargeButtons"
0046962A    68 C0174B00         push WinRAR.004B17C0                           ; ASCII "General\Toolbar"
0046962F    E8 2CD3FEFF         call WinRAR.00456960
00469634    6A 01               push 1
00469636    68 44204B00         push WinRAR.004B2044                           ; ASCII "ButtonsText"
0046963B    85C0                test eax,eax
0046963D    68 C0174B00         push WinRAR.004B17C0                           ; ASCII "General\Toolbar"
00469642    0F954424 12         setne byte ptr ss:[esp+12]
00469647    E8 14D3FEFF         call WinRAR.00456960
0046964C    85C0                test eax,eax
0046964E    0F954424 07         setne byte ptr ss:[esp+7]
00469653    837B 08 00          cmp dword ptr ds:[ebx+8],0
00469657    B8 200D0046         mov eax,46000D20
0046965C    74 05               je short WinRAR.00469663
0046965E    B8 640D0056         mov eax,56000D64
00469663    8B0D 5C934C00       mov ecx,dword ptr ds:[4C935C]                  ; WinRAR.00400000
00469669    8B15 C8C14D00       mov edx,dword ptr ds:[4DC1C8]
0046966F    55                  push ebp
00469670    56                  push esi
00469671    57                  push edi
00469672    6A 00               push 0
00469674    51                  push ecx
00469675    6A 0C               push 0C
00469677    52                  push edx
00469678    6A 00               push 0
0046967A    6A 00               push 0
0046967C    6A 00               push 0
0046967E    6A 00               push 0
00469680    50                  push eax
00469681    6A 00               push 0
00469683    68 F4424B00         push WinRAR.004B42F4                           ; ASCII "ToolbarWindow32"
00469688    6A 00               push 0
0046968A    FF15 A8154B00       call dword ptr ds:[<&USER32.CreateWindowExA>]  ; USER32.CreateWindowExA
00469690    8B2D 9C154B00       mov ebp,dword ptr ds:[<&USER32.SendMessageA>]  ; USER32.SendMessageA

......
......
004696D2    E8 29570100         call WinRAR.0047EE00
004696D7    84C0                test al,al
004696D9    74 35               je short WinRAR.00469710
004696DB    56                  push esi
004696DC    C64424 14 01        mov byte ptr ss:[esp+14],1
004696E1    E8 7A560100         call WinRAR.0047ED60
004696E6    57                  push edi
004696E7    894424 1C           mov dword ptr ss:[esp+1C],eax
004696EB    E8 70560100         call WinRAR.0047ED60
004696F0    894424 14           mov dword ptr ss:[esp+14],eax
004696F4    EB 27               jmp short WinRAR.0046971D
004696F6    807C24 12 00        cmp byte ptr ss:[esp+12],0
004696FB    74 0A               je short WinRAR.00469707
004696FD    BE 30000000         mov esi,30                    ; 将“大按钮”工具栏图标宽度0x30(10进制即48)放入ESI。
00469702    8D7E F4             lea edi,dword ptr ds:[esi-C]  ; 将“大按钮”工具栏图标高度[ESI-C]=0x30-0xC=0x24(10进制即36)放入EDI,
                                                              ; 所以可改成 lea edi,dword ptr ds:[esi]
00469705  ^ EB CB               jmp short WinRAR.004696D2
00469707    BE 18000000         mov esi,18                    ; 将“小按钮”工具栏图标宽度0x18(10进制即24)放入ESI,
                                                              ; 所以可改成 mov esi,20
0046970C    8BFE                mov edi,esi                   ; 将“小按钮”工具栏图标高度ESI放入EDI。
0046970E  ^ EB C2               jmp short WinRAR.004696D2

......
......
【“搜索结果”工具栏调整】:
注意:需要配合调整“CMDWNDFIND”对话框的部分控件的尺寸及位置,
   比如“ToolbarWindow32高度改为48,“SysListView32距离上方改为52高度改为146
......
......

0048AFF5    50                  push eax
0048AFF6    6A 01               push 1
0048AFF8    68 03100000         push 1003
0048AFFD    56                  push esi
0048AFFE    FFD5                call ebp
0048B000    68 8C000000         push 8C
0048B005    68 A4564B00         push WinRAR.004B56A4                           ; ASCII "ResColWidth0"
0048B00A    68 B0554B00         push WinRAR.004B55B0                           ; ASCII "Interface\FindFiles"
0048B00F    C74424 74 0F000000  mov dword ptr ss:[esp+74],0F
0048B017    C74424 78 00000000  mov dword ptr ss:[esp+78],0
0048B01F    E8 3CB9FCFF         call WinRAR.00456960
0048B024    68 E7040000         push 4E7
0048B029    894424 74           mov dword ptr ss:[esp+74],eax
0048B02D    E8 AE0DFDFF         call WinRAR.0045BDE0
0048B032    8D5424 68           lea edx,dword ptr ss:[esp+68]
0048B036    52                  push edx
0048B037    6A 00               push 0
0048B039    68 1B100000         push 101B
0048B03E    56                  push esi
0048B03F    898424 84000000     mov dword ptr ss:[esp+84],eax
0048B046    C78424 8C000000 000>mov dword ptr ss:[esp+8C],0
0048B051    FFD5                call ebp
0048B053    68 A0000000         push 0A0
0048B058    68 94564B00         push WinRAR.004B5694                           ; ASCII "ResColWidth1"
0048B05D    68 B0554B00         push WinRAR.004B55B0                           ; ASCII "Interface\FindFiles"
0048B062    E8 F9B8FCFF         call WinRAR.00456960
0048B067    68 E8040000         push 4E8
0048B06C    894424 74           mov dword ptr ss:[esp+74],eax
0048B070    E8 6B0DFDFF         call WinRAR.0045BDE0
0048B075    894424 74           mov dword ptr ss:[esp+74],eax
0048B079    8D4424 68           lea eax,dword ptr ss:[esp+68]
0048B07D    50                  push eax
0048B07E    6A 01               push 1
0048B080    68 1B100000         push 101B
0048B085    56                  push esi
0048B086    FFD5                call ebp
0048B088    68 A0000000         push 0A0
0048B08D    68 84564B00         push WinRAR.004B5684                           ; ASCII "ResColWidth2"
0048B092    68 B0554B00         push WinRAR.004B55B0                           ; ASCII "Interface\FindFiles"
0048B097    E8 C4B8FCFF         call WinRAR.00456960
0048B09C    68 E9040000         push 4E9
0048B0A1    894424 74           mov dword ptr ss:[esp+74],eax
0048B0A5    E8 360DFDFF         call WinRAR.0045BDE0
0048B0AA    8D4C24 68           lea ecx,dword ptr ss:[esp+68]
0048B0AE    51                  push ecx
0048B0AF    6A 02               push 2
0048B0B1    68 1B100000         push 101B
0048B0B6    56                  push esi
0048B0B7    898424 84000000     mov dword ptr ss:[esp+84],eax
0048B0BE    FFD5                call ebp
0048B0C0    6A 65               push 65
0048B0C2    57                  push edi
0048B0C3    FFD3                call ebx
0048B0C5    8BD8                mov ebx,eax
0048B0C7    6A 00               push 0
0048B0C9    6A 14               push 14
0048B0CB    68 1E040000         push 41E
0048B0D0    53                  push ebx
0048B0D1    FFD5                call ebp
0048B0D3    8D5424 1C           lea edx,dword ptr ss:[esp+1C]
0048B0D7    52                  push edx
0048B0D8    8D4424 34           lea eax,dword ptr ss:[esp+34]
0048B0DC    50                  push eax
0048B0DD    B9 60294E00         mov ecx,WinRAR.004E2960
0048B0E2    C74424 18 30000000  mov dword ptr ss:[esp+18],30    ; 将工具栏图标宽度0x30(10进制即48)放入[ESP+18]。
0048B0EA    C74424 20 24000000  mov dword ptr ss:[esp+20],24    ; 将工具栏图标高度0x24(10进制即36)放入[ESP+20],

                                                                ; 所以可改成 mov dword ptr ss:[esp+20],30
0048B0F2    E8 09B7FDFF         call WinRAR.00466800
0048B0F7    884424 16           mov byte ptr ss:[esp+16],al
0048B0FB    84C0                test al,al
0048B0FD    0F84 BE000000       je WinRAR.0048B1C1
0048B103    8B4424 1C           mov eax,dword ptr ss:[esp+1C]
0048B107    83F8 24             cmp eax,24
0048B10A    8B4C24 30           mov ecx,dword ptr ss:[esp+30]
0048B10E    894C24 10           mov dword ptr ss:[esp+10],ecx
0048B112    894424 18           mov dword ptr ss:[esp+18],eax
0048B116    0F8E 94000000       jle WinRAR.0048B1B0
0048B11C    8D5424 34           lea edx,dword ptr ss:[esp+34]
0048B120    52                  push edx
0048B121    56                  push esi
0048B122    FF15 48164B00       call dword ptr ds:[<&USER32.GetWindowRect>]    ; USER32.GetWindowRect

......
......

假设您对使用OllyDbg调试软件并不熟悉,也可以使用16进制编辑器(例如 UltraEditWinHex)打开“WinRAR.exe”主程序,进行如下Hex搜索替换操作:
◆搜索“8D 7E F4”,替换成“8D 3E 90
◆搜索“BE 18 00 00 00”,替换成“BE 20 00 00 00
◆搜索“C7 44 24 20 24 00 00 00”,替换成“C7 44 24 20 30 00 00 00


  保存修改后的主程序,运行一下试试,看看是不是工具栏文字与图标间的距离明显增高了?
  再用资源编辑软件,调整好上面提到的“CMDWNDFIND”对话框的部分控件的尺寸及位置。
  运行修改后的主程序,点击主界面工具栏的“查找”按钮,随便搜索些什么,看看弹出的“搜索结果”对话框的工具栏显示是否正常。

      假设顺利完成了上述操作,那么恭喜您,已经修改成功了,呵呵。
  剩下的工作就是使用您喜欢的资源去配套更新默认的位图、图标等了^_^

  感兴趣的朋友不妨尝试一下,定制您自己喜欢的WinRAR默认皮肤主题。
  您也可以到 http://bbs.wmzhe.com/viewthread.php?tid=90741 下载我修改好的美化默认皮肤的版本(不带其它皮肤),作为模板进行再加工。预祝大家都能制作出自己的个性版本^_^
                                     D4llower,2009.08
 
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|金光论坛

GMT+8, 2025 年 2 月 2 日 21:00 , Processed in 0.027300 second(s), 22 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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