refactor(target_arch): pass arch via feature flags instead#112
Open
kakoc wants to merge 1 commit intoheadcrab-rs:masterfrom
Open
refactor(target_arch): pass arch via feature flags instead#112kakoc wants to merge 1 commit intoheadcrab-rs:masterfrom
kakoc wants to merge 1 commit intoheadcrab-rs:masterfrom
Conversation
bjorn3
reviewed
Sep 11, 2020
| lazy_static::lazy_static! { | ||
| pub static ref PAGE_SIZE: usize = unsafe { libc::sysconf(libc::_SC_PAGESIZE) as usize }; | ||
| #[cfg(target_arch="x86_64")] | ||
| #[cfg(feature="x86_64")] |
Contributor
There was a problem hiding this comment.
Ptrace can only work with the local arch, so using target_arch makes more sense to me. Also enabling the x86_64 feature on other archs won't compile, as libc won't jave a u_debugreg field for the libc::user struct.
| @@ -1,5 +1,5 @@ | |||
| // FIXME make this work on other systems too. | |||
| #![cfg(all(target_arch = "x86_64", target_os = "linux"))] | |||
| #![cfg(all(feature = "x86_64", target_os = "linux"))] | |||
Contributor
There was a problem hiding this comment.
headcrab_inject directly uses the rip and rsp fields of libc::user_regs, so it won't compile for other archs.
Contributor
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to: #102
It's not clear to me: should the new
Archenum be used anywhere now?