Thread: Programmatically add resources to exe file

  1. #16
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    i managed the file via resources that is beeing read by using a unique search pattern. when just adding stuff at the end of the executable, it is beeing recognized as trojan/dropper.gen...
    I would imagine it is since this isn't a normal safe software practice. EXEs are built to execute code and that's it. Microsoft did add a way to embed resources in the EXE but that functionality is also built into the API and thus into all anti-virus and malware detection software that uses said API.

    You are clearly trying to do something that is not only not recommended but not in the design of an EXE.

    And as Mario has clearly stated as well C# non-native EXEs are not your average PE EXE. So embed data at the end of the file at your own risk. There are proper ways to go about doing what it is you want to do and the solutions are most likely spread all over CodeGuru or some other site that has tons of C# resources. I say this is a bad idea from both a native and non-native environment since essentially you are relying on operating system undefined behavior for resources.

    If you absolutely must know where your icon resources are I would recommend simply putting the icons in a known folder location and using .NET to load them in. This is perfectly valid and I know firsthand that it works as well as allows you to alter the icons the program uses from another program. It also exposes your icons but if you are worried about that it seems more of a programmer exercise to embed them in one common file and then extract as needed. This data definitely does not belong in any EXE or .NET assembly.
    Last edited by VirtualAce; 12-06-2009 at 01:28 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problems passing a file pointer to functions
    By smitchell in forum C Programming
    Replies: 4
    Last Post: 09-30-2008, 02:29 PM
  2. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  3. Replies: 3
    Last Post: 03-04-2005, 02:46 PM
  4. System
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 10:12 PM
  5. what does this mean to you?
    By pkananen in forum C++ Programming
    Replies: 8
    Last Post: 02-04-2002, 03:58 PM