Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Programming and Hacking > Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 18th October 2017, 08:36   #1  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,753
Hacking an ancient EXE to exchange CommonControls file dialog call?

I have a quite ancient application which, sadly, provides features not found in any more recent alternative. So I still use it frequently. The only disadvantage which really annoys me is that it uses a very old kind of CommonControls file dialog which is not resizable. I wonder if it is possible to hack this EXE to make it use a more modern kind of file dialog instead. I do remember that I have seen the dialog ID number once in some hacking tool, but I don't remember today which it was...
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is online now   Reply With Quote
Old 18th October 2017, 18:41   #2  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Provided that the dialog layout is stored as a resource in the resource section of the PE file, you might be able to do something with ResourceHacker:
http://www.angusj.com/resourcehacker/

However, I think that "file selection" dialogs are usually standard dialogs. For this kind of dialogs you won't find any resources in the PE file. Showing a standard file open dialog is pretty much just a single API call and all the details (layout, etc) are hidden in the system libraries, e.g. Comctl32.dll. So, in order to "upgrade" to a newer file open dialog, you would probably have to hack the code to call a different API function, or pass different flags, or link against a different library.

Anyhow, which version of Common Controls (Comctl32.dll) an application will use is controlled by the applications manifest - which is also stored in the resource section of the PE file. Thus, by "implanting" the right Manifest, you may be able to trick the program into using a newer version of Comctl32.dll. This is also required to enable the "visual styles" of Windows XP and later. But, of course, it can have some unexpected side-effects...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 18th October 2017 at 19:07.
LoRd_MuldeR is offline   Reply With Quote
Old 18th October 2017, 21:27   #3  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,753
I know ResourceHacker and found that there is no custom dialog to edit.

I would like to try that "Manifest Injection". Indeed, it certainly uses a default Common Controls dialog.

So far ... simply adding a *.exe.manifest file does not apply. And the EXE contains no embedded manifest yet. I guess one can insert a resource with a specific ID / name ...
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid

Last edited by LigH; 18th October 2017 at 21:32.
LigH is online now   Reply With Quote
Old 18th October 2017, 22:06   #4  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Adding a manifest to an executable can be done with the Manifest Tool (Mt.exe) for the Windows SDK:
But, as said before, if the application creates a standard file open dialog, via GetOpenFileName() function, then there will be no dialog box template resource in the executable file's resource section. And forcing a newer Common Controls version probably won't make a difference either (except for enabling "theme" support). Instead the application code would need to be changed to pass the OFN_ENABLESIZING flag in the Flags field of the OPENFILENAME struct...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 18th October 2017 at 22:20.
LoRd_MuldeR is offline   Reply With Quote
Old 18th October 2017, 22:23   #5  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,753
Lucky I had SDK 7.1 still installed.

Pity it did not change the dialog, still legacy and fixed.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is online now   Reply With Quote
Old 22nd October 2017, 16:08   #6  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
FWIW does anyone remember the old File-Ex software by Cottonwood Software? This thing could hack itself into any old fashioned file dialog and expand it adding advanced features.

This was even before Win XP, so out of curiosity I fired up an old Win98SE installation which had File-Ex installed. No so bad IMO...

I have no idea if would run under Win7, also it was not free, I don't even know it the company still exists. But this software would sure do what you have in mind...


Cheers
manolito



Standard File Dialog:



File_Ex File Dialog:

Last edited by manolito; 24th October 2017 at 08:22.
manolito is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 20:11.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.