You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Tuesday, December 28th 2010, 7:27am

Patching binary file build with Qt

Hello.

I have a small application which downloads files from server over HTTP. Its written with Delphi now. It contains a list of files that needs to be downloaded in resources. Each time user downloads the application, server patches exe binary with new list of file. With the help of this technique I can deploy a single-file app without installer.

I want to make this app cross-platform and I want to use Qt for this. The problem is that I don't know how to save file list in Linux and Mac OS version. In Windows version I still can save file list in resources, I think. The worst is that server is running on Windows OS, so I can't use any non-Windows system calls.


So, my question is:
1. Does Qt have some routines for changing resources of binary file?
2. If not, is it possible to just change some part of binary file in Linux and Mac OS? For example I can leave some place for file list when compiling and can insert the list in that place when patching binary.

P.S.: I don't want to have full rebuild of application each time user downloads my application. But maybe I can just re-link compiled modules each time?

2

Wednesday, December 29th 2010, 1:26pm

If a 2-file app is acceptable, you can create an external resource file with rcc on the server.

3

Monday, January 3rd 2011, 8:11pm

If a 2-file app is acceptable, you can create an external resource file with rcc on the server.
I can't use second file, because in that case user must download this second file with my program. It will be hard to explain to user why he or she must download unknown file with unknown extension and unknown data.

4

Monday, January 3rd 2011, 8:13pm

Now I am investigating such method:
1. I want to reserve some space in binary file (for example 32 bytes) for some ID.
2. When generating file for user I want to change this 32 bytes to unique "download ID".
3. When executing my program could download second file like this http://my-site.com/getSecondFile?Id=xxxx…xxxxxxxxxxxxxxx

So my questions:
Is it possible in Linux? Would C++ compiler and linker leave this 32 bytes same as was declared in the code?
Is it safe? Does Linux have some CRC calculation which can be broken by changes in binary file