From e0315132fe0c257b35c9df2172dd3fea6e41a984 Mon Sep 17 00:00:00 2001 From: ko1N Date: Sat, 21 Nov 2020 18:46:47 +0100 Subject: [PATCH] Updated to memflow/next branch --- memflow-pcileech/Cargo.toml | 7 ++----- memflow-pcileech/src/lib.rs | 15 ++++++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/memflow-pcileech/Cargo.toml b/memflow-pcileech/Cargo.toml index 487ccc3..715cfe1 100644 --- a/memflow-pcileech/Cargo.toml +++ b/memflow-pcileech/Cargo.toml @@ -16,13 +16,10 @@ categories = [ "api-bindings", "memory-management", "os" ] crate-type = ["lib", "cdylib"] [dependencies] -memflow = { version = "0.1", features = ["inventory", "serde_derive"] } -memflow-derive = { version = "0.1" } +memflow = { git = "https://github.com/memflow/memflow", branch = "next", features = ["inventory", "serde_derive"] } log = { version = "0.4", default-features = false } -leechcore-sys = { path = "../leechcore-sys" } - -[dev-dependencies] simple_logger = "1.0" +leechcore-sys = { path = "../leechcore-sys" } [features] default = [] diff --git a/memflow-pcileech/src/lib.rs b/memflow-pcileech/src/lib.rs index 3426d58..b3f0cca 100644 --- a/memflow-pcileech/src/lib.rs +++ b/memflow-pcileech/src/lib.rs @@ -6,10 +6,10 @@ use std::path::Path; use std::ptr; use std::sync::{Arc, Mutex}; -use log::{error, info}; +use log::{error, info, Level}; -use memflow::*; -use memflow_derive::connector; +use memflow::prelude::v1::*; +use memflow::derive::connector; use leechcore_sys::*; @@ -283,8 +283,13 @@ impl PhysicalMemory for PciLeech { } /// Creates a new PciLeech Connector instance. -#[connector(name = "pcileech")] -pub fn create_connector(args: &ConnectorArgs) -> Result { +#[connector(name = "pcileech", ty = "PciLeech")] +pub fn create_connector(log_level: Level, args: &ConnectorArgs) -> Result { + simple_logger::SimpleLogger::new() + .with_level(log_level.to_level_filter()) + .init() + .ok(); + let device = args .get("device") .or_else(|| args.get_default())