You don't need to perform this conversion, just use $fopen and $fread to directly read the vmlinux binary.hths.