Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Identifying a corrupt exe

Identifying a corrupt exe

Scheduled Pinned Locked Moved C / C++ / MFC
adobequestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vipin_nvk
    wrote on last edited by
    #1

    Hello My code copies an exe onto a USB flash drive using normal File copy functions, however it is quite possible that the USB flash drive might get disconnected during file copy and may not be copied properly (hence gets corrupted) So, when the user plugs in the USB flash drive next time he / she wont be able to use it. Is it possible programatically to identify a corrupted exe once the exe has been copied onto the USB flash drive ? Thanx

    J K 2 Replies Last reply
    0
    • V vipin_nvk

      Hello My code copies an exe onto a USB flash drive using normal File copy functions, however it is quite possible that the USB flash drive might get disconnected during file copy and may not be copied properly (hence gets corrupted) So, when the user plugs in the USB flash drive next time he / she wont be able to use it. Is it possible programatically to identify a corrupted exe once the exe has been copied onto the USB flash drive ? Thanx

      J Offline
      J Offline
      jhwurmbach
      wrote on last edited by
      #2

      Checksumming (e.g. MD5). Tools like MD5sum are readyly available in the internet. But the corrupted exe will very properly not start, so it can't check itself.


      Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal.
      George Orwell, "Keep the Aspidistra Flying", Opening words

      1 Reply Last reply
      0
      • V vipin_nvk

        Hello My code copies an exe onto a USB flash drive using normal File copy functions, however it is quite possible that the USB flash drive might get disconnected during file copy and may not be copied properly (hence gets corrupted) So, when the user plugs in the USB flash drive next time he / she wont be able to use it. Is it possible programatically to identify a corrupted exe once the exe has been copied onto the USB flash drive ? Thanx

        K Offline
        K Offline
        kasturi_haribabu
        wrote on last edited by
        #3

        Although there is no Direct way to do this, letme specify some alternatives. 1. calculate the Check sum of the File before you save and validate it after your file copy operation is complete. (Less Error prone but effective) 2.Verify the Size of the file copied. haribabu

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups