CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   Ruby & Ruby On Rails (http://www.codingforums.com/forumdisplay.php?f=44)
-   -   Ruby + clamAV (http://www.codingforums.com/showthread.php?t=229740)

talfiq 06-18-2011 03:26 AM

Ruby + clamAV
 
Hi,

I am newbie to both programming and Ruby.
But I need to complete this task - analyzing malware using ClamAV gem with Ruby.

I do not understand how to analyze a file, say "abc.exe" based on the documentation here;

http://rubydoc.info/gems/clamav/0.4.1/frames


Let's say I have a code snippet like this:

Code:

require 'rubygems'
require 'clamav'

#what else I have to put here?
#say the file is in /home/test/abc.exe
#and I put my Ruby code, test.rb in /home/test/

I saw this function(?), method(?)

ClamAV#scanfile(filename[, options])

How should I put the function? Is it something like;

Code:

ClamAV#scanfile('/home/test/abc.exe',CL_SCAN_RAW)
If so, how can I print out the result?


All times are GMT +1. The time now is 10:44 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.