-2

I have a university assignment and i need to have some sort of function that detects the presence of a binary sequence (in my case, it should be a "virus" signature -> the assignment is to create some sort of antivirus that checks files for viruses ) in a file. To do this i believe i need to get the whole binary content of the file, and check the presence of that signature. The problem is that every function i found gives me the content of the file, not the raw binary data. Any ideas how i should proceed with this? Thanks !

Pavlo
  • 1
  • 2
    ?? All files contain bytes of binary data. – Martin James May 29 '14 at 20:43
  • 1
    do a little more research: when you open a file, the second argument is the mode for which you open the file. there is a binary mode option. google this – bkane521 May 29 '14 at 20:43
  • I did, i used the "rb" argument; This is my first time posting a question, i guess it was a bit ambigous because i am in a hurry. What i want is not the actual content from file. For example, if the file contained a bit of text, i dont't want to get the text, but the bytes of information from the file, in hex value or something like this – Pavlo May 29 '14 at 20:47
  • **Post the code** that you asset doesn't work. If it as short and failed as you say, it should be obvious where the problem is. – WhozCraig May 29 '14 at 20:48
  • Thanks! that is what i was looking for, but i didn't know exactly what to search – Pavlo May 29 '14 at 20:54

1 Answers1

0

I think you would use: istream::read

Emanuele Paolini
  • 8,978
  • 3
  • 32
  • 57