scan complete machine

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nabanita
    New Member
    • Mar 2010
    • 9

    scan complete machine

    is there a way in C/C++ to sacn the whole computer for executable files?
    the process would scan all the folders and sub folders recursively.
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    Scan the whole computer for what?

    Comment

    • newb16
      Contributor
      • Jul 2008
      • 687

      #3
      @Banfa - For viruses? @OP -"Computer" is not defined in C standard, so it depends on os and compiler.

      Comment

      • weaknessforcats
        Recognized Expert Expert
        • Mar 2007
        • 9214

        #4
        You can only scan the addresses inside the address space of your process.

        Only the OS itself can scan the entire machine.

        Comment

        • jkmyoung
          Recognized Expert Top Contributor
          • Mar 2006
          • 2057

          #5
          ?
          Assuming permissions:
          Code:
          Get root directory
          RecursiveScan(root);
          
          RecursiveScan(File file){
            if file is dir
              foreach File f in dir
                RecursiveScan (f)
            else
                Scan(f)
          }
          where Scan() is a function that does the work of scanning the file.

          Comment

          Working...