Archive: Writing extra data to the installer exe and then read it.


Writing extra data to the installer exe and then read it.
Hi,

I need to distribute installers exe with different data added to them at download time.
(site.com/download.php?id=123 outputs setup.exe with 123 value inside it). I cannot recompile installers each time because Im on unix hosting.

I know that win32 binaries can have extra data added to the end of file ("type info.txt > notepad.exe") and exe continues working.

The question is it possible to read that extra data with NSIS and if yes how to do this. I looked through docs but found no readfile or something like it functions.

Any ideas?

Thanks!


FileOpen,FileClose,FileSeek,FileRead/FileReadByte


Re: Writing extra data to the installer exe and then read it.

I need to distribute installers exe with different data added to them at download time.
(site.com/download.php?id=123 outputs setup.exe with 123 value inside it).
AFAIK, NSIS installer is an EXE file with added archive to its end. So if you add some data to the end if EXE, this archive will be damaged.

There are some zero bytes in the installer before archive. You can try to overwrite some of this bytes with your own data, but you need to know offset of the archive.

Re: Re: Writing extra data to the installer exe and then read it.

Originally posted by Vovan-VE
AFAIK, NSIS installer is an EXE file with added archive to its end. So if you add some data to the end if EXE, this archive will be damaged.
No it will not (It will even pass the CRC check)

http://nsis.sourceforge.net/ReadCustomerData

Re: Re: Re: Writing extra data to the installer exe and then read it.

Originally posted by Anders
No it will not (It will even pass the CRC check)

http://nsis.sourceforge.net/ReadCustomerData
that is exactly what I need. Thank you!