EXE Files
-
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
-
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
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
-
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
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
-
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
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
-
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
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
-
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
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
-
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