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#
  4. EXE Files

EXE Files

Scheduled Pinned Locked Moved C#
csharpc++
7 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.
  • P Offline
    P Offline
    plextoR
    wrote on last edited by
    #1

    Hi All, I want to ask how i can open an exe file with C#. the idea i want to compare the binary code of 2 files . So i want to open each. i aslo wanna check if the file corrupted or not - infected with a virus or not. Note : I never do that even with C++ or other so plz try to be descriptive. thanks alot for your co-operate :) plextoR plextoR

    P N 2 Replies Last reply
    0
    • P plextoR

      Hi All, I want to ask how i can open an exe file with C#. the idea i want to compare the binary code of 2 files . So i want to open each. i aslo wanna check if the file corrupted or not - infected with a virus or not. Note : I never do that even with C++ or other so plz try to be descriptive. thanks alot for your co-operate :) plextoR plextoR

      P Offline
      P Offline
      Paul Riley
      wrote on last edited by
      #2

      You should be able to use a standard StreamReader to read any file into a byte[] array and then compare them one byte at a time. Paul Life is just a sexually transmitted desease - Matthew Wright (ex-journalist, TV presenter) 10-Oct-02 I finally have a sig! - Paul Riley (part-time deity) 10-Oct-02

      P 1 Reply Last reply
      0
      • P Paul Riley

        You should be able to use a standard StreamReader to read any file into a byte[] array and then compare them one byte at a time. Paul Life is just a sexually transmitted desease - Matthew Wright (ex-journalist, TV presenter) 10-Oct-02 I finally have a sig! - Paul Riley (part-time deity) 10-Oct-02

        P Offline
        P Offline
        plextoR
        wrote on last edited by
        #3

        Dear sir, Thanks for replaying but.. is it differes when i use streamReader for reading *.txt files from reading *.exe files?? i tried to read ana exe file the same way i do when reading *.txt files in C# but i got strange characters!! is that ordinary or i'm using the a wrong way. if i'm using a wrong way would you direct me to an article or tutorial that help me . & thanks alot & sorry 4 long msg. plextoR plextoR

        P 1 Reply Last reply
        0
        • P plextoR

          Dear sir, Thanks for replaying but.. is it differes when i use streamReader for reading *.txt files from reading *.exe files?? i tried to read ana exe file the same way i do when reading *.txt files in C# but i got strange characters!! is that ordinary or i'm using the a wrong way. if i'm using a wrong way would you direct me to an article or tutorial that help me . & thanks alot & sorry 4 long msg. plextoR plextoR

          P Offline
          P Offline
          Paul Riley
          wrote on last edited by
          #4

          Sorry, I keep making this mistake. A StreamReader is a type of TextReader, not the other way around. What you really need is the System.IO.FileStream class. plextoR wrote: sorry 4 long msg Dude! You think this is long? You should look around these message boards :). [And please don't call me "Sir", I thought you were talking to my father for a minute! ;) The beauty of CodeProject is that we're all normal people, no need for formalities.] Paul Life is just a sexually transmitted desease - Matthew Wright (ex-journalist, TV presenter) 10-Oct-02 I finally have a sig! - Paul Riley (part-time deity) 10-Oct-02

          P 1 Reply Last reply
          0
          • P plextoR

            Hi All, I want to ask how i can open an exe file with C#. the idea i want to compare the binary code of 2 files . So i want to open each. i aslo wanna check if the file corrupted or not - infected with a virus or not. Note : I never do that even with C++ or other so plz try to be descriptive. thanks alot for your co-operate :) plextoR plextoR

            N Offline
            N Offline
            Nick Parker
            wrote on last edited by
            #5

            plextoR wrote: the idea i want to compare the binary code of 2 files . Open a command prompt, then:

            C:\>fc /b file1.exe file2.exe

            plextoR wrote: i aslo wanna check if the file corrupted or not - infected with a virus or not. How do you expect to see a corruption or virus, you are going to see binary. Nick Parker
            The greatest lesson in life is to know that even fools are right sometimes. - Winston Churchill


            P 1 Reply Last reply
            0
            • N Nick Parker

              plextoR wrote: the idea i want to compare the binary code of 2 files . Open a command prompt, then:

              C:\>fc /b file1.exe file2.exe

              plextoR wrote: i aslo wanna check if the file corrupted or not - infected with a virus or not. How do you expect to see a corruption or virus, you are going to see binary. Nick Parker
              The greatest lesson in life is to know that even fools are right sometimes. - Winston Churchill


              P Offline
              P Offline
              plextoR
              wrote on last edited by
              #6

              Thanks for your help. Nick Parker wrote : "Open a command prompt, then: C:\>fc /b file1.exe file2.exe" But i was talking about how to compare 2 files using C# code. Nick Parker wrote : "How do you expect to see a corruption or virus, you are going to see binary." I mean i would find a virus signiture or something like that. So i need to read the binary of the file . plextoR plextoR

              1 Reply Last reply
              0
              • P Paul Riley

                Sorry, I keep making this mistake. A StreamReader is a type of TextReader, not the other way around. What you really need is the System.IO.FileStream class. plextoR wrote: sorry 4 long msg Dude! You think this is long? You should look around these message boards :). [And please don't call me "Sir", I thought you were talking to my father for a minute! ;) The beauty of CodeProject is that we're all normal people, no need for formalities.] Paul Life is just a sexually transmitted desease - Matthew Wright (ex-journalist, TV presenter) 10-Oct-02 I finally have a sig! - Paul Riley (part-time deity) 10-Oct-02

                P Offline
                P Offline
                plextoR
                wrote on last edited by
                #7

                Dear Paul (without sir;) ) Thanks i think i got the point. plextoR

                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