CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    Join Date
    May 2012
    Posts
    43

    Store an image in resources

    Hello,

    I tried to store a bmp image in my RT_RCDATA or RT_BITMAP and my file has a false positive now.
    Is it normal that an array gets picked up as
    AntiVir (Avira) TR/Dropper.Gen

    And what are the possible work arounds?

    Thanks in advance.
    Regards,
    Qwerz

  2. #2
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    5,575

    Re: Store an image in resources

    Best regards,
    Igor

  3. #3
    Join Date
    May 2012
    Posts
    43

    Re: Store an image in resources

    That is not exactly the work around that I meant, because I still want to use the embedded resources. But thanks

  4. #4
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    5,575

    Re: Store an image in resources

    You have to elaborate a bit on "embedded resources" as the samples exactly demonstrate how to embed pictures to resources and use those at runtime.
    Best regards,
    Igor

  5. #5
    Join Date
    Apr 1999
    Posts
    26,799

    Re: Store an image in resources

    Quote Originally Posted by qwerz View Post
    That is not exactly the work around that I meant
    The workaround is to contact the company that makes the anti-virus and report what you're doing as a false positive.

    Regards,

    Paul McKenzie

  6. #6
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,619

    Re: Store an image in resources

    Not that I'm familiar with how a virus scanner does it's decisions but why would the bitmap be considered malicious when stored as a resource in the exe but not as a file? I would try copying that bitmap to a file that ends with exe to check if its really the bitmap that cause the false positive. Just in case the virus scanner needs a proper exe header you might also try attaching it to another exe by doing a copy /B file.exe + /B file.bmp test.exe
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    http://www.microsoft.com/visualstudio/eng/downloads

  7. #7
    Join Date
    May 2012
    Posts
    43

    Re: Store an image in resources

    Just test it yourself if you do not believe it. I added the embedded resource under RT_STRING or RT_RCDATA. Not a single combination works.

    Avira detects resources as a virus if they are bigger than 20kb.

  8. #8
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    5,575

    Re: Store an image in resources

    Sorry, I failed to understand your original problem.
    Just test it yourself if you do not believe it.
    No, thanks. I'm fine with MSE.
    Avira detects resources as a virus if they are bigger than 20kb.
    And what kind of (programming?) workaround you expect here other than to get rid of the offending software and never use the one, never ever?
    Best regards,
    Igor

  9. #9
    Join Date
    Apr 1999
    Posts
    26,799

    Re: Store an image in resources

    Quote Originally Posted by qwerz View Post
    Just test it yourself if you do not believe it. I added the embedded resource under RT_STRING or RT_RCDATA. Not a single combination works.

    Avira detects resources as a virus if they are bigger than 20kb.
    What if I wrote a program that detected that all your EXE's had viruses? Are you going to pull your hair out looking for a "workaround", or are you going to contact my company and ask me what the heck is going on?

    So contact the company and state very simply that their program is detecting your legitimate file has a virus. Let them resolve the issue.

    Regards,

    Paul McKenzie

  10. #10
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,619

    Re: Store an image in resources

    I might do that test when I get home if I'm in the mode for it. Maybe you can post that bitmap?
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    http://www.microsoft.com/visualstudio/eng/downloads

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
  •  



HTML5 Development Center

Click Here to Expand Forum to Full Width