Wednesday, October 14, 2009

mtools for Mac OS X

I'm always cleaning viruses from USB pen drives. Most reside as Windows explorer extensions in hidden files and directories on the FAT32 filesystem of the USB pen drive. I needed some FAT utilities on Mac OS X to be able to change the files' attributes and remove them.

The mtools package for Linux was just the thing needed. However, compiling it on Mac OS X proved to be a challenge. I downloaded the latest mtools-4.0.11 which fixed a problem in calculating the FAT size. These days, GNU's not what it used to be. There's hardly any documentation for mtools to help. Running make left me with an error stating "Undefined symbols: _iconv...". I managed to compile successfully using the following command:

./configure LIBS=-liconv

After that, cleaning the malware files was a breeze using mattrib, mdel and mdeltree.