Fixed leechcore-sys compilation; Fixed examples

pull/7/head
ko1N 3 years ago
parent be5ce8bc96
commit 52773488a1

@ -1,6 +1,6 @@
# memflow-pcileech # memflow-pcileech
This connector implements a rust-native implementation of the pcileech interface. This connector implements the [LeechCore](https://github.com/ufrisk/LeechCore) interface of pcileech for memflow.
More information about pcileech can be found under https://github.com/ufrisk/pcileech. More information about pcileech can be found under https://github.com/ufrisk/pcileech.

@ -32,6 +32,7 @@ fn build_leechcore(target: &str) {
"device_pmem.c", "device_pmem.c",
"device_tmd.c", "device_tmd.c",
"device_usb3380.c", "device_usb3380.c",
"device_vmware.c",
"leechrpcclient.c", "leechrpcclient.c",
]; ];
if target.contains("windows") { if target.contains("windows") {

@ -30,7 +30,8 @@ fn main() {
let mut mem = vec![0; 8]; let mut mem = vec![0; 8];
connector connector
.phys_read_raw_into(Address::from(0x1000).into(), &mut mem) .phys_view()
.read_raw_into(Address::from(0x1000).into(), &mut mem)
.expect("unable to read physical memory"); .expect("unable to read physical memory");
info!("Received memory: {:?}", mem); info!("Received memory: {:?}", mem);
@ -39,7 +40,8 @@ fn main() {
loop { loop {
let mut buf = vec![0; 0x1000]; let mut buf = vec![0; 0x1000];
connector connector
.phys_read_raw_into(Address::from(0x1000).into(), &mut buf) .phys_view()
.read_raw_into(Address::from(0x1000).into(), &mut buf)
.expect("unable to read physical memory"); .expect("unable to read physical memory");
counter += 1; counter += 1;

@ -48,7 +48,7 @@ const fn calc_num_pages(start: u64, size: u64) -> u64 {
} }
#[allow(clippy::mutex_atomic)] #[allow(clippy::mutex_atomic)]
#[derive(Debug)] #[derive(Clone, Debug)]
pub struct PciLeech { pub struct PciLeech {
handle: Arc<Mutex<HANDLE>>, handle: Arc<Mutex<HANDLE>>,
metadata: PhysicalMemoryMetadata, metadata: PhysicalMemoryMetadata,
@ -57,16 +57,6 @@ pub struct PciLeech {
unsafe impl Send for PciLeech {} unsafe impl Send for PciLeech {}
impl Clone for PciLeech {
fn clone(&self) -> Self {
Self {
handle: self.handle.clone(),
metadata: self.metadata,
mem_map: self.mem_map.clone(),
}
}
}
// TODO: proper drop + free impl -> LcMemFree(pLcErrorInfo); // TODO: proper drop + free impl -> LcMemFree(pLcErrorInfo);
#[allow(clippy::mutex_atomic)] #[allow(clippy::mutex_atomic)]
impl PciLeech { impl PciLeech {

Loading…
Cancel
Save