Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sysinject hacks #1283

Draft
wants to merge 29 commits into
base: dev
Choose a base branch
from
Draft

Sysinject hacks #1283

wants to merge 29 commits into from

Conversation

ryandmaggio
Copy link
Collaborator

Everything should be in order for 32 bit arm and x86 support. I left in the broken x86-64 code incase we want to do that in the future, so we have something to work off of, but I can remove it for neatness if need be.

let abe_callback = Callback::new();
abe_callback.after_block_exec(move |cpu, _, _| {
if panda::current_asid(cpu) == injected_asid {
if !panda::in_kernel_mode(cpu) {
Copy link
Member

@lacraig2 lacraig2 Feb 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ASID//PC pair?```suggestion
if !panda::in_kernel_mode(cpu) {

`sysinject` allows for the injection of syscalls into the guest at arbitrary points.

The function `inject_syscall` takes 4 arguments
1) `cpu`, the cpu state. This is standard for panda plugins.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check formatting on github.

@lacraig2
Copy link
Member

Check on MIPS issues

@ryandmaggio ryandmaggio marked this pull request as draft February 24, 2023 19:01
@ryandmaggio
Copy link
Collaborator Author

  • add support for each syscall
  • edit inject_syscall to catch a flag for if the syscall returns
  • edit inject_syscall to be more discerning about when to do the callback
  • add more documentation


#[panda::init]
fn init(_: &mut PluginHandle) -> bool {
#[cfg(any(feature = "x86_64", feature = "aarch64", feature = "mips64", feature = "mipsl"))]{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mipsel?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work for mipsel?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Classic mipsel misspell, oops

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants