Results 1 to 8 of 8

Thread: How to "stick" a file as a resource?

  1. #1
    Join Date
    Jan 2011
    Posts
    128
    Thanks
    2

    Default How to "stick" a file as a resource?

    Hello,
    what I want to do is quite simple,but i don't know how to do that in Qt.
    1)So,I have a program(p1),
    2)which takes as a resource another(PE),let's call it p2*.

    3)The same app(p1),opens any .exe file(p3),
    4)reads its(binary) and
    5)encrypts the bytes.
    6)Then,I create a new exe(p4),which has my p2.

    7)Now what I want next,is to take that p3(the encrypted byteArray) and add it as a resource of p4.
    Complexive? :/

    *My p2 is an app,already compiled(by me).It will take that p3(which is a resource of it)and decrypt it.

    My problem is,how to do step 7.
    Thank you.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to "stick" a file as a resource?

    I suggest you start reading the relevant Windows API stuff because Qt is not going to help here.

  3. #3
    Join Date
    Jan 2011
    Posts
    128
    Thanks
    2

    Default Re: How to "stick" a file as a resource?

    What stuff?
    I need to pass a file as a resource..possible?

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to "stick" a file as a resource?

    It is possible to install an arbitrary binary blob into a Windows PE file so that it is accessible as a Windows resource (not a Qt resource); this is what Windows icon editors or the Microsoft manifest tool do. I assume, therefore, that there are Windows APIs to do this, and the best place to find them would be a Microsoft site. Start here:
    http://msdn.microsoft.com/en-us/libr...=VS.85%29.aspx

  5. #5
    Join Date
    Jan 2011
    Posts
    128
    Thanks
    2

    Default Re: How to "stick" a file as a resource?

    Well,yes I saw a guy doing that with WinAPI functions,so I wanted to do this in Qt...so not possible?
    Are the functions from MSDN the only way?

    Thanks.

  6. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to "stick" a file as a resource?

    You can do it in C++, and yes, the Windows API functions are the correct way to edit Windows-specific embedded resources.

    Qt has its own resource system that is not the same as the Windows one. You cannot dynamically edit the embedded Qt resources.

  7. #7
    Join Date
    Jan 2011
    Posts
    128
    Thanks
    2

    Default Re: How to "stick" a file as a resource?

    Ok.Thanks and what excactly functions(list ) will I need for this task?

  8. #8
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to "stick" a file as a resource?

    The functions in the page I linked to. I am not about to sit down and learn how to do it in minute detail just so that you don't have to bother trying yourself.

Similar Threads

  1. Replies: 9
    Last Post: 20th May 2010, 10:55
  2. Replies: 3
    Last Post: 15th February 2010, 18:27
  3. Replies: 3
    Last Post: 8th July 2008, 20:37
  4. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 20:05
  5. Setting QFrame palette in Designer doesn't "stick"
    By Doug Broadwell in forum Qt Tools
    Replies: 1
    Last Post: 9th September 2007, 22:44

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.