[fpc-pascal] Re: Editing resource of executable
Noah Silva
shiruba at galapagossoftware.com
Fri Nov 9 02:43:02 CET 2012
Hi,
Not directly relevant to the web server problem at hand, but...
Interestingly enough, I used to do this on Atari ST systems with
PurePascal, but the reason was different.
I wanted to have things like Mac OS had (meta-data like icons, extension of
files the app could open, friendly application name, etc.), but there was
no standard place to store this that the desktop or other tools could
reliably find it. I figured out that I could add data to the end of
.PRG/.APP files (executables), and the system wouldn't blink, so I
basically appended some pascal records.
The challenges here were:
1. The application had to find the data. The end of the file contained an
integer that indicated where the data block started.
2. I had to design it in a flexible/expandable way without wasting space.
Also, you can usually edit string data in executable files (and resource
files) with no issues, as long as you keep the length the same. If you
have a string you want to edit, you can make it easy to find, and just do a
search/replace without worrying about the resource format much (since the
metadata supporting the string will stay the same).
Yet, as mentioned my previous posters, either editing or appending the file
will both change the check-sum, and thus break code-signing. You would
need to have the code-signing tool be re-run as a part of the customization
process.
Thank you,
Noah Silva
2012/8/30 Jonas Maebe <jonas.maebe at elis.ugent.be>
>
> Krzysztof wrote on Thu, 30 Aug 2012:
>
> Hmm sounds good. So I can normally open another exec in for example
>> TFileStream and write something at the end and this exec run without
>> error?
>>
>
> Yes. Do keep in mind that the original exe has to be able to find the
> length of the data you appended to it. So it's easiest if you add a 4 byte
> length or so after the appended data, which the original exe then can read
> to find the start of that data.
>
>
> Jonas
>
> ______________________________**_________________
> fpc-pascal maillist - fpc-pascal at lists.freepascal.**org<fpc-pascal at lists.freepascal.org>
> http://lists.freepascal.org/**mailman/listinfo/fpc-pascal<http://lists.freepascal.org/mailman/listinfo/fpc-pascal>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20121109/cc7a84c2/attachment.html>
More information about the fpc-pascal
mailing list