def _write_file(self, vnode, out_path): if vnode and vnode.is_valid() and vnode.is_reg(): ents = out_path.split("/") out_path = os.path.join(self._config.DUMP_DIR, *ents) # this is the ..namedfork/rsrc files. We currently skip those if os.path.exists(out_path) and os.path.isdir(out_path): shutil.rmtree(out_path) mac_common.write_vnode_to_file(vnode, out_path) ret = 1 elif vnode.is_dir(): ret = 1 else: ret = 0 return ret
def _write_file(self, vnode, out_path): if vnode and vnode.is_valid() and vnode.is_reg(): ents = out_path.split("/") out_path = os.path.join(self._config.DUMP_DIR, *ents) # this is the ..namedfork/rsrc files. We currently skip those if os.path.exists(out_path) and os.path.isdir(out_path): shutil.rmtree(out_path) mac_common.write_vnode_to_file(vnode, out_path) ret = 1 elif vnode.is_dir(): ret = 1 else: ret = 0 return ret
def calculate(self): common.set_plugin_members(self) outfile = self._config.outfile vnode_off = self._config.FILE_OFFSET if not outfile: debug.error("You must specify an output file (-O/--outfile)") if not vnode_off: debug.error("You must specificy a vnode address (-q/--file-offset) from mac_list_files") vnode = obj.Object("vnode", offset = vnode_off, vm = self.addr_space) wrote = common.write_vnode_to_file(vnode, outfile) yield vnode_off, outfile, wrote