analizing bytes of files for an AV
guys Im making a simple AV so the scanning consists onto for example look for malicius strings of viruses for example a file have a determinated string of hexadecimal and if that matches with the signature that is considered as a virus it will eliminate it so Im looking some stuff of Inputdatastream library and more stuff related with data flow input stream blablabla anywayz I dont find a good example of do a well reading of bytes plz some aid here
Re: analizing bytes of files for an AV
FileInputStream should be enough for your requirements:
FileInputStream (Java Platform SE 6)
Re: analizing bytes of files for an AV
once I read it how do I see if that string is that is malware? read()? would you give me an example
?
Re: analizing bytes of files for an AV
Quote:
how do I see if that string is that is malware
If you are reading executable files like .exe you will not be reading Strings. It will be a sequence of bytes.
As I understand AV software, they have large dictionaries of sequences of bytes that are in malware.
The AV software understands the structure of the executable files and knows where to look in them to find the sequence of bytes that that have been found in previously detected malware.
There are several read methods that you can use to read enough bytes to fill a large array where you can search for the malware byte sequence.
Once you have read the bytes from the file you compare them byte by byte for a match.
There could be classes and methods to help you do that, I'm not sure. Otherwise its loops and arrays.