pub fn dump_touched_pages<T: VirtualMemory, P: AsRef<Path>>(
        &self,
        process: &mut Win32Process<T>,
        path: P,
    ) -> Result<()> {
        std::fs::create_dir_all(path.as_ref().clone())?;

        for (&page, _) in self.touched_pages.iter() {
            info!("reading page at page=0x{:x}", page);
            if let Ok(page_buf) = process
                .virt_mem
                .virt_read_raw(page.into(), PAGE_SIZE)
                .data_part()
            {
                if page_buf.iter().find(|&&b| b != 0).is_none() {
                    // empty page (potentially paged out)
                    continue;
                }

                let mut file =
                    File::create(PathBuf::from(path.as_ref()).join(&format!("0x{:x}.dmp", page)))?;
                file.write_all(&page_buf)?;
            }
        }

        Ok(())
    }
/// Dumps all touched pages to the specified folder
Dumps all touched pages to the specified folder
Dumps all touched pages to the specified folder
pub fn dump_touched_pages<T: VirtualMemory, P: AsRef<Path>>(
        &self,
        process: &mut Win32Process<T>,
        path: P,
    ) -> Result<()> {
        std::fs::create_dir_all(path.as_ref().clone())?;
        for (&page, _) in self.touched_pages.iter() {
            info!("reading page at page=0x{:x}", page);
            if let Ok(page_buf) = process
                .virt_mem
                .virt_read_raw(page.into(), PAGE_SIZE)
                .data_part()
            {
                if page_buf.iter().find(|&&b| b != 0).is_none() {
                    // empty page (potentially paged out)
                    continue;
                }
                let mut file =
                    File::create(PathBuf::from(path.as_ref()).join(&format!("0x{:x}.dmp", page)))?;
                file.write_all(&page_buf)?;
            }
        }
        Ok(())
    }
pub fn dump_touched_pages < T : VirtualMemory , P : AsRef < Path > > ( & self , process : & mut Win32Process < T > , path : P , ) -> Result < ( ) > { std :: fs :: create_dir_all ( path . as_ref ( ) . clone ( ) ) ? ; for ( & page , _ ) in self . touched_pages . iter ( ) { info ! ( " " page ) ; if let Ok ( page_buf ) = process . virt_mem . virt_read_raw ( page . into ( ) , PAGE_SIZE ) . data_part ( ) { if page_buf . iter ( ) . find ( | & & b | b != 0 ) . is_none ( ) { // empty page (potentially paged out) continue ; } let mut file = File :: create ( PathBuf :: from ( path . as_ref ( ) ) . join ( & format ! ( " " page ) ) ) ? ; file . write_all ( & page_buf ) ? ; } } Ok ( ( ) ) }
Dumps all touched pages to the specified folder
Dumps all touched pages to the specified folder
&self
process
&mut Win32Process<T>
path
P
&self
process
&mut Win32Process<T>
path
P