From 569658d1e105c4c58ad739bfac05c01014f4ae3d Mon Sep 17 00:00:00 2001 From: jamcleod Date: Tue, 17 Sep 2024 16:27:42 -0400 Subject: [PATCH] Update all panda-rs plugins to latest version --- panda/plugins/Cargo.lock | 76 ++------- panda/plugins/Cargo.toml | 1 + panda/plugins/cosi/Cargo.toml | 2 +- panda/plugins/cosi_strace/Cargo.toml | 2 +- panda/plugins/gdb/Cargo.toml | 2 +- panda/plugins/gdb/src/memory_map.rs | 8 +- panda/plugins/gdb/src/monitor_commands/mod.rs | 62 ++++---- .../gdb/src/monitor_commands/proc_info.rs | 10 +- .../gdb/src/monitor_commands/proc_list.rs | 10 +- panda/plugins/gdb/src/panda_target.rs | 150 ++++++++++-------- panda/plugins/rust_skeleton/Cargo.toml | 2 +- panda/plugins/rust_skeleton/README.md | 2 +- panda/plugins/snake_hook/Cargo.toml | 2 +- 13 files changed, 151 insertions(+), 178 deletions(-) diff --git a/panda/plugins/Cargo.lock b/panda/plugins/Cargo.lock index d1f3256f2bc..999aa92767a 100644 --- a/panda/plugins/Cargo.lock +++ b/panda/plugins/Cargo.lock @@ -112,7 +112,7 @@ version = "0.1.0" dependencies = [ "curl", "once_cell", - "panda-re 0.46.1", + "panda-re", "regex", "volatility_profile", ] @@ -124,7 +124,7 @@ dependencies = [ "chumsky", "log", "once_cell", - "panda-re 0.45.1", + "panda-re", ] [[package]] @@ -256,7 +256,7 @@ dependencies = [ "gdbstub", "gdbstub_arch", "lazy_static", - "panda-re 0.14.0", + "panda-re", "peg", "tabwriter", ] @@ -514,28 +514,9 @@ dependencies = [ [[package]] name = "panda-re" -version = "0.14.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03153860245f365c1f01452404eddd0a0741beafd88acf6e6afe167d1ac6c874" -dependencies = [ - "dirs", - "glib-sys", - "inventory", - "lazy_static", - "libloading", - "panda-re-macros 0.10.0", - "panda-re-sys 0.5.0", - "paste", - "strum 0.20.0", - "strum_macros 0.20.1", - "thiserror", -] - -[[package]] -name = "panda-re" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca671a99ad5cbfb16f9019548dd4bf85145c6e386b3b3989b1e1ed088dc9d032" +checksum = "fa3072d536c4445015aaae6e37c0c668f61db6e75225cd2d068578c682e03fda" dependencies = [ "array-init", "dirs", @@ -544,47 +525,14 @@ dependencies = [ "lazy_static", "libloading", "once_cell", - "panda-re-macros 0.25.1", - "panda-re-sys 0.7.0", - "paste", - "strum 0.20.0", - "strum_macros 0.20.1", - "thiserror", -] - -[[package]] -name = "panda-re" -version = "0.46.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "758a684eb7563df43de73e64e2e96cc1b8233a4c2c55c47ecfaa59e5064239cb" -dependencies = [ - "array-init", - "dirs", - "glib-sys", - "inventory", - "lazy_static", - "libloading", - "once_cell", - "panda-re-macros 0.25.1", - "panda-re-sys 0.7.0", + "panda-re-macros", + "panda-re-sys", "paste", "strum 0.20.0", "strum_macros 0.20.1", "thiserror", ] -[[package]] -name = "panda-re-macros" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0ebc6c9d873a7285c7a09bfe4c80dc80efa8d3ea28bcb18a1d6a933dd3242be" -dependencies = [ - "darling", - "doc-comment", - "quote", - "syn 1.0.109", -] - [[package]] name = "panda-re-macros" version = "0.25.1" @@ -598,12 +546,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "panda-re-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b9fe3ab684d3cf027c816a724de1ea40373b6438dc2240d64bdca0ca99f2e01" - [[package]] name = "panda-re-sys" version = "0.7.0" @@ -803,7 +745,7 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" name = "rust_skeleton" version = "0.1.0" dependencies = [ - "panda-re 0.46.1", + "panda-re", ] [[package]] @@ -872,7 +814,7 @@ dependencies = [ "lazy_static", "libc", "once_cell", - "panda-re 0.14.0", + "panda-re", "pyo3", ] diff --git a/panda/plugins/Cargo.toml b/panda/plugins/Cargo.toml index f4dcdaf57ee..3e7cbf8854f 100644 --- a/panda/plugins/Cargo.toml +++ b/panda/plugins/Cargo.toml @@ -1,4 +1,5 @@ [workspace] +resolver = "2" members = [ "gdb", "rust_skeleton", diff --git a/panda/plugins/cosi/Cargo.toml b/panda/plugins/cosi/Cargo.toml index 1fd85eac2a1..856524afcbb 100644 --- a/panda/plugins/cosi/Cargo.toml +++ b/panda/plugins/cosi/Cargo.toml @@ -9,7 +9,7 @@ crate-type = ["cdylib"] [dependencies] once_cell = "1.8.0" -panda-re = { version = "0.46.0", default-features = false } +panda-re = { version = "0.47.0", default-features = false } regex = "1.5.4" curl = "0.4.44" volatility_profile = { path = "./volatility_profile" } diff --git a/panda/plugins/cosi_strace/Cargo.toml b/panda/plugins/cosi_strace/Cargo.toml index 29c5f677e44..c57d0194399 100644 --- a/panda/plugins/cosi_strace/Cargo.toml +++ b/panda/plugins/cosi_strace/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" crate-type = ["cdylib"] [dependencies] -panda-re = { version = "0.45.0", default-features = false } +panda-re = { version = "0.47.0", default-features = false } chumsky = "0.8" log = "0.4" once_cell = "1" diff --git a/panda/plugins/gdb/Cargo.toml b/panda/plugins/gdb/Cargo.toml index 0b4bdbaeb56..3a173abbfd9 100644 --- a/panda/plugins/gdb/Cargo.toml +++ b/panda/plugins/gdb/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" crate-type = ["cdylib"] [dependencies] -panda-re = { version = "0.14.0", default-features = false } +panda-re = { version = "0.47.0", default-features = false } gdbstub = "0.5" lazy_static = "1.4.0" gdbstub_arch = "0.1.0" diff --git a/panda/plugins/gdb/src/memory_map.rs b/panda/plugins/gdb/src/memory_map.rs index 42109f2525c..ce6875fb916 100644 --- a/panda/plugins/gdb/src/memory_map.rs +++ b/panda/plugins/gdb/src/memory_map.rs @@ -1,11 +1,11 @@ -use panda::prelude::*; use panda::plugins::osi::OSI; +use panda::prelude::*; -use std::ffi::CStr; use gdbstub::outputln; +use std::ffi::CStr; pub(crate) fn print(cpu: &mut CPUState) { - let mut proc = OSI.get_current_process(cpu); + let mut proc = OSI.get_current_process(cpu).unwrap(); let mappings = OSI.get_mappings(cpu, &mut *proc); println!("Memory map:"); @@ -33,7 +33,7 @@ pub(crate) fn print(cpu: &mut CPUState) { } pub(crate) fn print_to_gdb(cpu: &mut CPUState, mut out: impl std::fmt::Write) { - let mut proc = OSI.get_current_process(cpu); + let mut proc = OSI.get_current_process(cpu).unwrap(); let mappings = OSI.get_mappings(cpu, &mut *proc); outputln!(out); diff --git a/panda/plugins/gdb/src/monitor_commands/mod.rs b/panda/plugins/gdb/src/monitor_commands/mod.rs index 1f34c35cd29..021b642e4f1 100644 --- a/panda/plugins/gdb/src/monitor_commands/mod.rs +++ b/panda/plugins/gdb/src/monitor_commands/mod.rs @@ -6,42 +6,38 @@ use gdbstub::outputln; mod parser; use parser::{Command, TaintTarget}; -mod thread_info; mod proc_info; mod proc_list; +mod thread_info; pub(crate) fn handle_command(cmd: &str, cpu: &mut CPUState, mut out: impl std::fmt::Write) { let cmd = cmd.trim(); // this parsing is totally fineā„¢ match Command::parse(cmd) { - Ok(Command::Taint(target, label)) => { - match target { - TaintTarget::Address(addr) => { - let addr = panda::mem::virt_to_phys(cpu, addr); - taint::label_ram(addr, label); - outputln!(out, "Memory location {:#x?} tainted.", addr); - } - TaintTarget::Register(reg) => { - taint::label_reg(reg, label); - outputln!(out, "Register {} tainted.", reg.to_string()); - } + Ok(Command::Taint(target, label)) => match target { + TaintTarget::Address(addr) => { + let addr = panda::mem::virt_to_phys(cpu, addr).unwrap(); + taint::label_ram(addr, label); + outputln!(out, "Memory location {:#x?} tainted.", addr); + } + TaintTarget::Register(reg) => { + taint::label_reg(reg, label); + outputln!(out, "Register {} tainted.", reg.to_string()); } }, - Ok(Command::CheckTaint(target)) => { - match target { - TaintTarget::Address(addr) => { - let addr = panda::mem::virt_to_phys(cpu, addr); - outputln!(out, "{:?}", taint::check_ram(addr)); - } - TaintTarget::Register(reg) => { - outputln!(out, "{:?}", taint::check_reg(reg)); - } + Ok(Command::CheckTaint(target)) => match target { + TaintTarget::Address(addr) => { + let addr = panda::mem::virt_to_phys(cpu, addr).unwrap(); + outputln!(out, "{:?}", taint::check_ram(addr)); + } + TaintTarget::Register(reg) => { + outputln!(out, "{:?}", taint::check_reg(reg)); } }, Ok(Command::GetTaint(target)) => { match target { TaintTarget::Address(addr) => { - let addr = panda::mem::virt_to_phys(cpu, addr); + let addr = panda::mem::virt_to_phys(cpu, addr).unwrap(); // TODO: fix segfault if taint::check_ram(addr) { outputln!(out, "{:?}", taint::get_ram(addr)); @@ -58,7 +54,7 @@ pub(crate) fn handle_command(cmd: &str, cpu: &mut CPUState, mut out: impl std::f } } } - }, + } Ok(Command::MemInfo) => crate::memory_map::print_to_gdb(cpu, out), Ok(Command::ThreadInfo) => thread_info::print(cpu, out), Ok(Command::ProcInfo) => proc_info::print(cpu, out), @@ -93,10 +89,22 @@ fn print_help_text(mut out: impl std::fmt::Write) { outputln!(out); outputln!(out, "Commands:"); outputln!(out, " meminfo - print out the current memory map"); - outputln!(out, " taint - apply taint to a given register/memory location"); - outputln!(out, " check_taint - check if a given register/memory location is tainted"); - outputln!(out, " get_taint - get the taint labels for a given register/memory location"); - outputln!(out, " threadinfo - get info about threads of the current process"); + outputln!( + out, + " taint - apply taint to a given register/memory location" + ); + outputln!( + out, + " check_taint - check if a given register/memory location is tainted" + ); + outputln!( + out, + " get_taint - get the taint labels for a given register/memory location" + ); + outputln!( + out, + " threadinfo - get info about threads of the current process" + ); outputln!(out, " procinfo - get info about the current process"); outputln!(out, " proclist - list all the currently running processes"); } diff --git a/panda/plugins/gdb/src/monitor_commands/proc_info.rs b/panda/plugins/gdb/src/monitor_commands/proc_info.rs index 0de4cfa54aa..01bddc20d5d 100644 --- a/panda/plugins/gdb/src/monitor_commands/proc_info.rs +++ b/panda/plugins/gdb/src/monitor_commands/proc_info.rs @@ -1,10 +1,10 @@ -use panda::prelude::*; use panda::plugins::osi::OSI; +use panda::prelude::*; use gdbstub::outputln; pub(crate) fn print(cpu: &mut CPUState, mut out: impl std::fmt::Write) { - let proc = OSI.get_current_process(cpu); + let proc = OSI.get_current_process(cpu).unwrap(); outputln!(out); outputln!(out, "{}", proc.get_name()); @@ -13,6 +13,10 @@ pub(crate) fn print(cpu: &mut CPUState, mut out: impl std::fmt::Write) { outputln!(out, "ASID: {:#x?}", proc.asid); outputln!(out, "Parent PID: {}", proc.ppid); outputln!(out, "Creation time: {}", proc.create_time); - outputln!(out, "PC in shared library: {}", OSI.in_shared_object(cpu, &*proc)); + outputln!( + out, + "PC in shared library: {}", + OSI.in_shared_object(cpu, &*proc) + ); outputln!(out); } diff --git a/panda/plugins/gdb/src/monitor_commands/proc_list.rs b/panda/plugins/gdb/src/monitor_commands/proc_list.rs index 04a77dfd547..e5d1f1a8ba3 100644 --- a/panda/plugins/gdb/src/monitor_commands/proc_list.rs +++ b/panda/plugins/gdb/src/monitor_commands/proc_list.rs @@ -1,19 +1,21 @@ -use panda::prelude::*; use panda::plugins::osi::OSI; +use panda::prelude::*; use gdbstub::outputln; -use tabwriter::{TabWriter, Alignment}; +use tabwriter::{Alignment, TabWriter}; use std::io::Write; pub(crate) fn print(cpu: &mut CPUState, mut out: impl std::fmt::Write) { let procs = OSI.get_processes(cpu); - let current_pid = OSI.get_current_process(cpu).pid; + let current_pid = OSI.get_current_process(cpu).unwrap().pid; outputln!(out); let output = Vec::new(); - let mut output = TabWriter::new(output).padding(1).alignment(Alignment::Right); + let mut output = TabWriter::new(output) + .padding(1) + .alignment(Alignment::Right); let _ = writeln!(output, " \tPID\tASID\tParent\tCreate Time\tProcess Name"); let _ = writeln!(output, " \t===\t====\t======\t===========\t============"); diff --git a/panda/plugins/gdb/src/panda_target.rs b/panda/plugins/gdb/src/panda_target.rs index 022f5a28e1d..388af78258c 100644 --- a/panda/plugins/gdb/src/panda_target.rs +++ b/panda/plugins/gdb/src/panda_target.rs @@ -1,13 +1,12 @@ -use crate::{monitor_commands, target_state::{STATE, BreakStatus}}; +use crate::{ + monitor_commands, + target_state::{BreakStatus, STATE}, +}; use gdbstub::{ - target::{Target, TargetResult, TargetError, ext}, - target::ext::base::singlethread::{ - SingleThreadOps, - StopReason, - ResumeAction, - }, arch::Arch, outputln, + target::ext::base::singlethread::{ResumeAction, SingleThreadOps, StopReason}, + target::{ext, Target, TargetError, TargetResult}, }; use panda::plugins::osi::OSI; @@ -17,31 +16,37 @@ use std::convert::TryInto; pub struct PandaTarget; #[cfg(feature = "x86_64")] -use gdbstub_arch::x86::{X86_64_SSE as X86_64, reg::{X86_64CoreRegs, X86SegmentRegs, F80}}; +use gdbstub_arch::x86::{ + reg::{X86SegmentRegs, X86_64CoreRegs, F80}, + X86_64_SSE as X86_64, +}; #[cfg(feature = "i386")] -use gdbstub_arch::x86::{X86_SSE as X86, reg::{X86CoreRegs, F80, X86SegmentRegs}}; +use gdbstub_arch::x86::{ + reg::{X86CoreRegs, X86SegmentRegs, F80}, + X86_SSE as X86, +}; #[cfg(feature = "arm")] -use gdbstub_arch::arm::{Armv4t, reg::ArmCoreRegs}; +use gdbstub_arch::arm::{reg::ArmCoreRegs, Armv4t}; //#[cfg(feature = "ppc")] //use gdbstub_arch::ppc::{PowerPcAltivec32 as PowerPc, reg::{PowerPcCommonRegs as PowerPcCoreRegs}}; #[cfg(any(feature = "mips", feature = "mipsel", feature = "mips64"))] -use gdbstub_arch::mips::{Mips, reg::MipsCoreRegs}; +use gdbstub_arch::mips::{reg::MipsCoreRegs, Mips}; #[cfg(not(any(feature = "aarch64", feature = "ppc")))] impl Target for PandaTarget { #[cfg(feature = "x86_64")] type Arch = X86_64; - + #[cfg(feature = "i386")] type Arch = X86; - + #[cfg(feature = "arm")] type Arch = Armv4t; - + #[cfg(feature = "ppc")] type Arch = PowerPc; @@ -51,9 +56,7 @@ impl Target for PandaTarget { type Error = (); fn base_ops(&mut self) -> ext::base::BaseOps { - ext::base::BaseOps::SingleThread( - self as _ - ) + ext::base::BaseOps::SingleThread(self as _) } fn breakpoints(&mut self) -> Option> { @@ -80,23 +83,19 @@ impl SingleThreadOps for PandaTarget { ResumeAction::Step => { STATE.start_single_stepping(); STATE.cont.signal(()); - Ok( - match STATE.brk.wait_for() { - BreakStatus::Break => StopReason::DoneStep, - BreakStatus::Exit => StopReason::Exited(0), - } - ) + Ok(match STATE.brk.wait_for() { + BreakStatus::Break => StopReason::DoneStep, + BreakStatus::Exit => StopReason::Exited(0), + }) } ResumeAction::Continue => { STATE.cont.signal(()); - Ok( - match STATE.brk.wait_for() { - BreakStatus::Break => StopReason::SwBreak, - BreakStatus::Exit => StopReason::Exited(0), - } - ) + Ok(match STATE.brk.wait_for() { + BreakStatus::Break => StopReason::SwBreak, + BreakStatus::Exit => StopReason::Exited(0), + }) } - _ => panic!("signals not supported") + _ => panic!("signals not supported"), } } @@ -104,13 +103,16 @@ impl SingleThreadOps for PandaTarget { &mut self, regs: &mut ::Registers, ) -> TargetResult<(), Self> { - let cpu = STATE.wait_for_cpu(); - #[cfg(feature = "x86_64")] { + #[cfg(feature = "x86_64")] + { let env = unsafe { &*(cpu.env_ptr as *const panda::sys::CPUX86State) }; - let segments: [u32; 6] = (&env.segs.iter().map(|seg| seg.base as u32) + let segments: [u32; 6] = (&env + .segs + .iter() + .map(|seg| seg.base as u32) .collect::>()[..6]) .try_into() .unwrap(); @@ -129,19 +131,27 @@ impl SingleThreadOps for PandaTarget { regs: (*env).regs.clone(), rip: STATE.get_pc(), segments, - st: (&env.fpregs.iter().map(fpreg_to_bytes).collect::>()[..8]).try_into().unwrap(), - xmm: (&env.xmm_regs.iter().map(zmm_to_xmm).collect::>()[..16]).try_into().unwrap(), + st: (&env.fpregs.iter().map(fpreg_to_bytes).collect::>()[..8]) + .try_into() + .unwrap(), + xmm: (&env.xmm_regs.iter().map(zmm_to_xmm).collect::>()[..16]) + .try_into() + .unwrap(), mxcsr: env.mxcsr, ..Default::default() }; } - - #[cfg(feature = "i386")] { + + #[cfg(feature = "i386")] + { let env = unsafe { &*(cpu.env_ptr as *const panda::sys::CPUX86State) }; - use panda::sys::{R_EAX, R_EBX, R_ECX, R_EDX, R_ESP, R_EBP, R_ESI, R_EDI}; + use panda::sys::{R_EAX, R_EBP, R_EBX, R_ECX, R_EDI, R_EDX, R_ESI, R_ESP}; - let segments: [u32; 6] = (&env.segs.iter().map(|seg| seg.base as u32) + let segments: [u32; 6] = (&env + .segs + .iter() + .map(|seg| seg.base as u32) .collect::>()[..6]) .try_into() .unwrap(); @@ -167,14 +177,19 @@ impl SingleThreadOps for PandaTarget { edi: env.regs[R_EDI as usize], eip: STATE.get_pc(), segments, - st: (&(*env).fpregs.iter().map(fpreg_to_bytes).collect::>()[..8]).try_into().unwrap(), - xmm: (&(*env).xmm_regs.iter().map(zmm_to_xmm).collect::>()[..8]).try_into().unwrap(), + st: (&(*env).fpregs.iter().map(fpreg_to_bytes).collect::>()[..8]) + .try_into() + .unwrap(), + xmm: (&(*env).xmm_regs.iter().map(zmm_to_xmm).collect::>()[..8]) + .try_into() + .unwrap(), mxcsr: (*env).mxcsr, ..Default::default() }; } - - #[cfg(feature = "arm")] { + + #[cfg(feature = "arm")] + { let env = unsafe { &*(cpu.env_ptr as *const panda::sys::CPUARMState) }; *regs = ArmCoreRegs { @@ -187,11 +202,11 @@ impl SingleThreadOps for PandaTarget { }; } - #[cfg(feature = "ppc")] { + #[cfg(feature = "ppc")] + {} - } - - #[cfg(any(feature = "mips", feature = "mipsel"))] { + #[cfg(any(feature = "mips", feature = "mipsel"))] + { let env = unsafe { &*(cpu.env_ptr as *const panda::sys::CPUMIPSState) }; regs.r = env.active_tc.gpr; @@ -213,7 +228,8 @@ impl SingleThreadOps for PandaTarget { ) -> TargetResult<(), Self> { let cpu = STATE.wait_for_cpu(); - #[cfg(feature = "x86_64")] { + #[cfg(feature = "x86_64")] + { let env = cpu.env_ptr as *mut panda::sys::CPUX86State; unsafe { @@ -222,9 +238,10 @@ impl SingleThreadOps for PandaTarget { (*env).mxcsr = regs.mxcsr; } } - #[cfg(feature = "arm")] { + #[cfg(feature = "arm")] + { let env = unsafe { &mut *(cpu.env_ptr as *mut panda::sys::CPUARMState) }; - + for i in 0..13 { env.regs[i] = regs.r[i]; } @@ -233,10 +250,11 @@ impl SingleThreadOps for PandaTarget { env.regs[15] = regs.pc; env.uncached_cpsr = regs.cpsr; } - #[cfg(feature = "i386")] { + #[cfg(feature = "i386")] + { let env = unsafe { &mut *(cpu.env_ptr as *mut panda::sys::CPUX86State) }; - use panda::sys::{R_EAX, R_EBX, R_ECX, R_EDX, R_ESP, R_EBP, R_ESI, R_EDI}; + use panda::sys::{R_EAX, R_EBP, R_EBX, R_ECX, R_EDI, R_EDX, R_ESI, R_ESP}; for &(i, val) in &[ (R_EAX, regs.eax), @@ -261,7 +279,7 @@ impl SingleThreadOps for PandaTarget { fn read_addrs( &mut self, addr: ::Usize, - out: &mut [u8] + out: &mut [u8], ) -> TargetResult<(), Self> { let cpu = STATE.wait_for_cpu(); @@ -278,11 +296,11 @@ impl SingleThreadOps for PandaTarget { addr: ::Usize, data: &[u8], ) -> TargetResult<(), Self> { - let cpu = STATE.wait_for_cpu(); + let cpu = STATE.wait_for_cpu(); - cpu.mem_write(addr, data); + cpu.mem_write(addr, data); - Ok(()) + Ok(()) } } @@ -298,7 +316,7 @@ impl ext::breakpoints::SwBreakpoint for PandaTarget { fn add_sw_breakpoint( &mut self, addr: ::Usize, - _kind: ::BreakpointKind + _kind: ::BreakpointKind, ) -> TargetResult { Ok(STATE.add_breakpoint(addr)) } @@ -306,7 +324,7 @@ impl ext::breakpoints::SwBreakpoint for PandaTarget { fn remove_sw_breakpoint( &mut self, addr: ::Usize, - _kind: ::BreakpointKind + _kind: ::BreakpointKind, ) -> TargetResult { Ok(STATE.remove_breakpoint(addr)) } @@ -316,7 +334,7 @@ impl ext::monitor_cmd::MonitorCmd for PandaTarget { fn handle_monitor_cmd( &mut self, cmd: &[u8], - mut out: ext::monitor_cmd::ConsoleOutput<'_> + mut out: ext::monitor_cmd::ConsoleOutput<'_>, ) -> Result<(), Self::Error> { if let Ok(cmd) = std::str::from_utf8(cmd) { let cpu = STATE.wait_for_cpu(); @@ -330,9 +348,11 @@ impl ext::monitor_cmd::MonitorCmd for PandaTarget { } impl ext::section_offsets::SectionOffsets for PandaTarget { - fn get_section_offsets(&mut self) -> Result::Usize>, Self::Error> { + fn get_section_offsets( + &mut self, + ) -> Result::Usize>, Self::Error> { let cpu = STATE.wait_for_cpu(); - let mut process = OSI.get_current_process(cpu); + let mut process = OSI.get_current_process(cpu).unwrap(); let mappings = OSI.get_mappings(cpu, &mut *process); if mappings.len() >= 3 { let text = &mappings[0]; @@ -351,14 +371,10 @@ impl ext::section_offsets::SectionOffsets for PandaTarget { #[cfg(any(feature = "x86_64", feature = "i386"))] fn fpreg_to_bytes(x: &panda::sys::FPReg) -> F80 { - unsafe { - std::mem::transmute_copy(x) - } + unsafe { std::mem::transmute_copy(x) } } #[cfg(any(feature = "x86_64", feature = "i386"))] fn zmm_to_xmm(x: &panda::sys::ZMMReg) -> u128 { - unsafe { - std::mem::transmute_copy(x) - } + unsafe { std::mem::transmute_copy(x) } } diff --git a/panda/plugins/rust_skeleton/Cargo.toml b/panda/plugins/rust_skeleton/Cargo.toml index 4b9c9aaaec1..6e64f666c28 100644 --- a/panda/plugins/rust_skeleton/Cargo.toml +++ b/panda/plugins/rust_skeleton/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" crate-type = ["cdylib"] [dependencies] -panda-re = { version = "0.46.0", default-features = false } +panda-re = { version = "0.47.0", default-features = false } [features] default = ["x86_64"] diff --git a/panda/plugins/rust_skeleton/README.md b/panda/plugins/rust_skeleton/README.md index 81a52bc976b..39b1336fef8 100644 --- a/panda/plugins/rust_skeleton/README.md +++ b/panda/plugins/rust_skeleton/README.md @@ -40,7 +40,7 @@ The dependencies section: ```toml [dependencies] -panda-re = { version = "0.5", default-features = false } +panda-re = { version = "0.47", default-features = false } ``` To add a new dependency, add a new line in the form `name = "version"`. diff --git a/panda/plugins/snake_hook/Cargo.toml b/panda/plugins/snake_hook/Cargo.toml index f26a690d00c..0643197758c 100644 --- a/panda/plugins/snake_hook/Cargo.toml +++ b/panda/plugins/snake_hook/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" crate-type = ["cdylib"] [dependencies] -panda-re = { version = "0.14.0", default-features = false } +panda-re = { version = "0.47.0", default-features = false } inline-python = { version = "0.12.0" } libc = "0.2.98" once_cell = "1"