Skip to content

Commit 569658d

Browse files
committed
Update all panda-rs plugins to latest version
1 parent 3787038 commit 569658d

File tree

13 files changed

+151
-178
lines changed

13 files changed

+151
-178
lines changed

panda/plugins/Cargo.lock

Lines changed: 9 additions & 67 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

panda/plugins/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[workspace]
2+
resolver = "2"
23
members = [
34
"gdb",
45
"rust_skeleton",

panda/plugins/cosi/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ crate-type = ["cdylib"]
99

1010
[dependencies]
1111
once_cell = "1.8.0"
12-
panda-re = { version = "0.46.0", default-features = false }
12+
panda-re = { version = "0.47.0", default-features = false }
1313
regex = "1.5.4"
1414
curl = "0.4.44"
1515
volatility_profile = { path = "./volatility_profile" }

panda/plugins/cosi_strace/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ edition = "2018"
88
crate-type = ["cdylib"]
99

1010
[dependencies]
11-
panda-re = { version = "0.45.0", default-features = false }
11+
panda-re = { version = "0.47.0", default-features = false }
1212
chumsky = "0.8"
1313
log = "0.4"
1414
once_cell = "1"

panda/plugins/gdb/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ edition = "2018"
88
crate-type = ["cdylib"]
99

1010
[dependencies]
11-
panda-re = { version = "0.14.0", default-features = false }
11+
panda-re = { version = "0.47.0", default-features = false }
1212
gdbstub = "0.5"
1313
lazy_static = "1.4.0"
1414
gdbstub_arch = "0.1.0"

panda/plugins/gdb/src/memory_map.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
use panda::prelude::*;
21
use panda::plugins::osi::OSI;
2+
use panda::prelude::*;
33

4-
use std::ffi::CStr;
54
use gdbstub::outputln;
5+
use std::ffi::CStr;
66

77
pub(crate) fn print(cpu: &mut CPUState) {
8-
let mut proc = OSI.get_current_process(cpu);
8+
let mut proc = OSI.get_current_process(cpu).unwrap();
99
let mappings = OSI.get_mappings(cpu, &mut *proc);
1010

1111
println!("Memory map:");
@@ -33,7 +33,7 @@ pub(crate) fn print(cpu: &mut CPUState) {
3333
}
3434

3535
pub(crate) fn print_to_gdb(cpu: &mut CPUState, mut out: impl std::fmt::Write) {
36-
let mut proc = OSI.get_current_process(cpu);
36+
let mut proc = OSI.get_current_process(cpu).unwrap();
3737
let mappings = OSI.get_mappings(cpu, &mut *proc);
3838

3939
outputln!(out);

panda/plugins/gdb/src/monitor_commands/mod.rs

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,42 +6,38 @@ use gdbstub::outputln;
66
mod parser;
77
use parser::{Command, TaintTarget};
88

9-
mod thread_info;
109
mod proc_info;
1110
mod proc_list;
11+
mod thread_info;
1212

1313
pub(crate) fn handle_command(cmd: &str, cpu: &mut CPUState, mut out: impl std::fmt::Write) {
1414
let cmd = cmd.trim();
1515
// this parsing is totally fine™
1616
match Command::parse(cmd) {
17-
Ok(Command::Taint(target, label)) => {
18-
match target {
19-
TaintTarget::Address(addr) => {
20-
let addr = panda::mem::virt_to_phys(cpu, addr);
21-
taint::label_ram(addr, label);
22-
outputln!(out, "Memory location {:#x?} tainted.", addr);
23-
}
24-
TaintTarget::Register(reg) => {
25-
taint::label_reg(reg, label);
26-
outputln!(out, "Register {} tainted.", reg.to_string());
27-
}
17+
Ok(Command::Taint(target, label)) => match target {
18+
TaintTarget::Address(addr) => {
19+
let addr = panda::mem::virt_to_phys(cpu, addr).unwrap();
20+
taint::label_ram(addr, label);
21+
outputln!(out, "Memory location {:#x?} tainted.", addr);
22+
}
23+
TaintTarget::Register(reg) => {
24+
taint::label_reg(reg, label);
25+
outputln!(out, "Register {} tainted.", reg.to_string());
2826
}
2927
},
30-
Ok(Command::CheckTaint(target)) => {
31-
match target {
32-
TaintTarget::Address(addr) => {
33-
let addr = panda::mem::virt_to_phys(cpu, addr);
34-
outputln!(out, "{:?}", taint::check_ram(addr));
35-
}
36-
TaintTarget::Register(reg) => {
37-
outputln!(out, "{:?}", taint::check_reg(reg));
38-
}
28+
Ok(Command::CheckTaint(target)) => match target {
29+
TaintTarget::Address(addr) => {
30+
let addr = panda::mem::virt_to_phys(cpu, addr).unwrap();
31+
outputln!(out, "{:?}", taint::check_ram(addr));
32+
}
33+
TaintTarget::Register(reg) => {
34+
outputln!(out, "{:?}", taint::check_reg(reg));
3935
}
4036
},
4137
Ok(Command::GetTaint(target)) => {
4238
match target {
4339
TaintTarget::Address(addr) => {
44-
let addr = panda::mem::virt_to_phys(cpu, addr);
40+
let addr = panda::mem::virt_to_phys(cpu, addr).unwrap();
4541
// TODO: fix segfault
4642
if taint::check_ram(addr) {
4743
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
5854
}
5955
}
6056
}
61-
},
57+
}
6258
Ok(Command::MemInfo) => crate::memory_map::print_to_gdb(cpu, out),
6359
Ok(Command::ThreadInfo) => thread_info::print(cpu, out),
6460
Ok(Command::ProcInfo) => proc_info::print(cpu, out),
@@ -93,10 +89,22 @@ fn print_help_text(mut out: impl std::fmt::Write) {
9389
outputln!(out);
9490
outputln!(out, "Commands:");
9591
outputln!(out, " meminfo - print out the current memory map");
96-
outputln!(out, " taint - apply taint to a given register/memory location");
97-
outputln!(out, " check_taint - check if a given register/memory location is tainted");
98-
outputln!(out, " get_taint - get the taint labels for a given register/memory location");
99-
outputln!(out, " threadinfo - get info about threads of the current process");
92+
outputln!(
93+
out,
94+
" taint - apply taint to a given register/memory location"
95+
);
96+
outputln!(
97+
out,
98+
" check_taint - check if a given register/memory location is tainted"
99+
);
100+
outputln!(
101+
out,
102+
" get_taint - get the taint labels for a given register/memory location"
103+
);
104+
outputln!(
105+
out,
106+
" threadinfo - get info about threads of the current process"
107+
);
100108
outputln!(out, " procinfo - get info about the current process");
101109
outputln!(out, " proclist - list all the currently running processes");
102110
}
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use panda::prelude::*;
21
use panda::plugins::osi::OSI;
2+
use panda::prelude::*;
33

44
use gdbstub::outputln;
55

66
pub(crate) fn print(cpu: &mut CPUState, mut out: impl std::fmt::Write) {
7-
let proc = OSI.get_current_process(cpu);
7+
let proc = OSI.get_current_process(cpu).unwrap();
88

99
outputln!(out);
1010
outputln!(out, "{}", proc.get_name());
@@ -13,6 +13,10 @@ pub(crate) fn print(cpu: &mut CPUState, mut out: impl std::fmt::Write) {
1313
outputln!(out, "ASID: {:#x?}", proc.asid);
1414
outputln!(out, "Parent PID: {}", proc.ppid);
1515
outputln!(out, "Creation time: {}", proc.create_time);
16-
outputln!(out, "PC in shared library: {}", OSI.in_shared_object(cpu, &*proc));
16+
outputln!(
17+
out,
18+
"PC in shared library: {}",
19+
OSI.in_shared_object(cpu, &*proc)
20+
);
1721
outputln!(out);
1822
}

panda/plugins/gdb/src/monitor_commands/proc_list.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
use panda::prelude::*;
21
use panda::plugins::osi::OSI;
2+
use panda::prelude::*;
33

44
use gdbstub::outputln;
5-
use tabwriter::{TabWriter, Alignment};
5+
use tabwriter::{Alignment, TabWriter};
66

77
use std::io::Write;
88

99
pub(crate) fn print(cpu: &mut CPUState, mut out: impl std::fmt::Write) {
1010
let procs = OSI.get_processes(cpu);
11-
let current_pid = OSI.get_current_process(cpu).pid;
11+
let current_pid = OSI.get_current_process(cpu).unwrap().pid;
1212

1313
outputln!(out);
1414

1515
let output = Vec::new();
16-
let mut output = TabWriter::new(output).padding(1).alignment(Alignment::Right);
16+
let mut output = TabWriter::new(output)
17+
.padding(1)
18+
.alignment(Alignment::Right);
1719

1820
let _ = writeln!(output, " \tPID\tASID\tParent\tCreate Time\tProcess Name");
1921
let _ = writeln!(output, " \t===\t====\t======\t===========\t============");

0 commit comments

Comments
 (0)