Fix the windows build
Signed-off-by: Dimitris Zervas <dzervas@dzervas.gr>
This commit is contained in:
parent
936080b4e8
commit
a706f1d890
@ -12,7 +12,7 @@ pub extern "C" fn attach(pid: u32) {
|
||||
{
|
||||
let frida_code = env!("FRIDA_CODE").replace("\\n", "\n");
|
||||
#[cfg(windows)]
|
||||
std::thread::spawn(move || frida_attach_pid(&frida_code, AttachMode::Pid(pid)));
|
||||
std::thread::spawn(move || frida_attach_with(&frida_code, AttachMode::Pid(pid)));
|
||||
#[cfg(not(windows))]
|
||||
frida_attach_with(&frida_code, AttachMode::Pid(pid));
|
||||
}
|
||||
|
@ -6,10 +6,8 @@ pub use injector::attach_self;
|
||||
|
||||
// During testing we compile a debug binary without `test`.
|
||||
// Enabling `ctor` during testing would hook the test runner and break it.
|
||||
#[cfg(all(unix, not(test)))]
|
||||
pub mod loader_unix;
|
||||
|
||||
#[cfg(all(windows, not(test)))]
|
||||
pub mod loader_windows;
|
||||
#[cfg(all(windows, not(test)))]
|
||||
pub use loader_windows::DllMain;
|
||||
|
@ -1,3 +1,4 @@
|
||||
#![cfg(all(unix, not(test)))]
|
||||
use ctor::ctor;
|
||||
|
||||
use crate::injector::attach_self;
|
||||
|
@ -1,6 +1,9 @@
|
||||
#![cfg(all(windows, not(test)))]
|
||||
|
||||
use std::ffi::c_void;
|
||||
use winapi::um::winnt::DLL_PROCESS_ATTACH;
|
||||
use winapi::um::libloaderapi::LoadLibraryA;
|
||||
use crate::attach_self;
|
||||
|
||||
// For some reason ctor doesn't work on Windows - it hangs the process
|
||||
// during DeviceManager::obtain. DllMain works fine though.
|
||||
|
Loading…
x
Reference in New Issue
Block a user