64 Bit Support in MadRes?

delphi package - madRes, madTools, madStrings, ...
Post Reply
mimar
Posts: 13
Joined: Sat Jul 16, 2005 2:57 pm

64 Bit Support in MadRes?

Post by mimar »

Does MadRes support updating 64 bit executable images?
Is the 64 bit header and data preserved correctly?
I notice both the WinAPIs and Visual Studio editor intermittently crash when working with 64 bit images.

So does MadRes have support for IA64, X64 executable images?
madshi
Site Admin
Posts: 10338
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

64bit executables are currently not supported. Honestly, I don't even know yet in which way they differ from 32bit executables. Probably they'll differ so much, that madRes won't work. I don't know it for sure, though. I'd suggest to simply try it out.
mimar
Posts: 13
Joined: Sat Jul 16, 2005 2:57 pm

Post by mimar »

Well, I have tried it out - I am happy to say MadRes works better than the Visual Studio editor, and the default Win32 API functions. However an exception is raised upon calling the Finalize... function, so there seems to be some room for improvement.
qsqsqs
Posts: 2
Joined: Mon Feb 20, 2012 7:43 pm

Re: 64 Bit Support in MadRes?

Post by qsqsqs »

Hello,

Any news on this issue?
As far as I have tried the resource extraction from 64 bit files is working, but the adding of resources is not.
Any plans to update this package in the future with 64 bit support?
Thank you.

Best regards
madshi
Site Admin
Posts: 10338
Joined: Sun Mar 21, 2004 5:25 pm

Re: 64 Bit Support in MadRes?

Post by madshi »

Yes, I do plan on making madRes work with 64bit exes soon. Don't ask me for a release date, though.
qsqsqs
Posts: 2
Joined: Mon Feb 20, 2012 7:43 pm

Re: 64 Bit Support in MadRes?

Post by qsqsqs »

Good to know :). Thank you for creating this nice library, very useful.
zunzster
Posts: 58
Joined: Wed Oct 29, 2008 3:43 am

Re: 64 Bit Support in MadRes?

Post by zunzster »

I need 64-bit support for madRes also.

I thought switching to the Windows routines might work for 32-bit and 64-bit modules but immediately bumped into the problem that the built-in UpdateResource family don't reliaby update the PE checksum which we've set madExcept to check for. Furthermore, the bug that corrupts modules in the presence of TD32 debug information is still there (and I expect is fairly low on Microsoft's priority list to ever fix). which is one of the things that prompted Mathias to write madRes in the first place.

Anyway, since we need this sooner rather than later - I've had a look at the code to see what the problem might be. First off, it's not coping with the fact that the NT OptionalHeader for 64-bit PE files is different from the 32-bit structure. After that, there might be size problems with the internal resource structures themselves.

If you've not already done so, Mathias, I might take a stab at adding support for 64-bit OptionalHeaders and see how far that gets me. I might need to dig into the internal resource structures after that.

If I go down this route and get it working, I'll send the code to Mathias.
madshi
Site Admin
Posts: 10338
Joined: Sun Mar 21, 2004 5:25 pm

Re: 64 Bit Support in MadRes?

Post by madshi »

My latest madRes sources already support x64. Just didn't get around releasing it yet. Maybe I'll get around releasing an x64 madRes beta build next week.
zunzster
Posts: 58
Joined: Wed Oct 29, 2008 3:43 am

Re: 64 Bit Support in MadRes?

Post by zunzster »

Sounds good - saves me the hassle :-)

Just out of curiosity, was it just the OptionalHeader64 stuff you needed to change or were there internal issues as well?

Actually, just to be clear, does the updated madRes now support updating both x86 and x64 modules whether compiled as 32-bit or 64-bit or are you just meaning the new madRes will update 64-bit modules when compiled as 64-bit?

Ideally, I desire the former but could work with the latter although I might feel tempted to do the extra work myself out of cussedness and curiousity :-)
madshi
Site Admin
Posts: 10338
Joined: Sun Mar 21, 2004 5:25 pm

Re: 64 Bit Support in MadRes?

Post by madshi »

I don't remember what I changed exactly to make it work with 64bit PE files, it's been a few weeks ago. Have been busy with other stuff in the meanwhile. In any case, it can modify both 32bit and 64bit PE files. Doesn't matter in which bitdepth you compile it.
zunzster
Posts: 58
Joined: Wed Oct 29, 2008 3:43 am

Re: 64 Bit Support in MadRes?

Post by zunzster »

Awesome! I await the beta with bated breath.
madshi
Site Admin
Posts: 10338
Joined: Sun Mar 21, 2004 5:25 pm

Re: 64 Bit Support in MadRes?

Post by madshi »

Better late than never:

http://madshi.net/madCollection.exe (installer version 2.7.0.0)

It's not a beta, after all, but the official new version, including madExcept 4... :wink:
Post Reply