idascript from http://www.hexblog.com/?p=128