Page 1 of 1
Building an antivirus in PB?
Posted: Fri Dec 09, 2005 1:21 pm
by Inf0Byt3
Has anyone ever think about building an antivirus in purebasic? Would it be possible? The engine could be very simple (recursive search , load file to memory, comparememory with a database, and so on..) What do you think?
Re: Building an antivirus in PB?
Posted: Fri Dec 09, 2005 1:28 pm
by Trond
Inf0Byt3 wrote:Would it be possible?
You're not ready just yet.
Posted: Fri Dec 09, 2005 1:54 pm
by Inf0Byt3
I know, but i've studied how modern scanning engine works, and it shouldn't be so hard, but it takes too much time building those procedures (Filetype recognition, unpacking, etc). I was just curious

Posted: Fri Dec 09, 2005 1:57 pm
by Lazarus404
I did a crash course in Virus development using ASM... Just so I know how they work. It's all very clever, you just create a stub at the beginning of the file which redirects to a deposit at the end of the file (the virus), then execute the original exe stub which continues the program running.
You could check for such a modification with PB, seeing as PB supports ASM compilation.
Good luck to you, though

Posted: Fri Dec 09, 2005 4:57 pm
by Inf0Byt3
Thank you for the info (and for wishing me luck)... I hope I can build it

Posted: Fri Dec 09, 2005 5:00 pm
by Trond
Inf0Byt3 wrote:I know, but i've studied how modern scanning engine works, and it shouldn't be so hard, but it takes too much time building those procedures (Filetype recognition, unpacking, etc). I was just curious

No, it's all made up out of small pieces that aren't really so difficult, but it will take very long time if you're not skilled. On the other hand, if you never attempt anything, you'll never become skilled.
Posted: Fri Dec 09, 2005 6:29 pm
by Inf0Byt3
Yes, you're right... I've noticed that best things are made accidentally. That's how i started thinking about this... Refering to skills, the GREAT and ALLMIGHTY PB HELPFILE will give me a hand

. By the way, how am i going to get the newly-appeared viruses so I can make virus-definitions? I'm starting to believe that this is an impossible task. But i'll try to complete it anyway

.
Posted: Fri Dec 09, 2005 6:46 pm
by thefool
Inf0Byt3 wrote: By the way, how am i going to get the newly-appeared viruses so I can make virus-definitions?
You need to have the viruses so you can check them
however, a thing you _could_ do: Monitor exe files on the computer. Simply first time run will scan for exe files, then store their sizes in a database.
When the user runs an exe file, you check the size. If the size is changed, you give a warning before you run the file!
This will not stop worms and other app's living in its own exe file, however it will stop vira from attaching itself to your exe.!
Posted: Fri Dec 09, 2005 9:17 pm
by Inf0Byt3
Great idea!!! This could be implemented as a resident "scan". By the way, i did a quicksearch on the forum and i've seen an example (something about file notification on modification or on copy...). This could extend its capabilities... Or making a driver in assembler (on acess scanning), but this is way too hard. We CAN stop this disease

Posted: Fri Dec 09, 2005 9:24 pm
by thefool
Inf0Byt3 wrote:Great idea!!! This could be implemented as a resident "scan". By the way, i did a quicksearch on the forum and i've seen an example (something about file notification on modification or on copy...). This could extend its capabilities... Or making a driver in assembler (on acess scanning), but this is way too hard. We CAN stop this disease

yeah its not _that_hard.