casualx / external Goto Github PK
View Code? Open in Web Editor NEWWindows external process interaction, WIP
Windows external process interaction, WIP
I started converting my code to the most recent version of external and not gonna lie the switch to ur intptr crate is nothing but pain and suffering so far, my current issue is that in my case IntPtr<usize>
does not seem to implement Pod
error[E0277]: the trait bound `external::prelude::IntPtr<usize>: dataview::Pod` is not satisfied
--> src\main.rs:83:24
|
83 | self.read_as::<IntPtr<usize>>(idx, proc).and_then(|ptr| ptr.cast::<T>().read(proc))
| ^^^^^^^^^^^^^ the trait `dataview::Pod` is not implemented for `external::prelude::IntPtr<usize>`
|
= help: the following other types implement trait `dataview::Pod`:
isize
i8
i16
i32
i64
i128
usize
u8
and 15 others
Write an example of using the function that displays the virtual memory of the process, plz.
https://github.com/CasualX/external/blob/master/src/vm.rs#L349
So i came across a weird issue, my goal was to suspend/resume threads and since external doesnt have suspend/resume implemented on Thread i used the winapi crate and called SuspendThread
and ResumeThread
myself, issue is that into_inner() always gives me a wrong handle, here is some example code
fn suspend_process(proc_id: ProcessId) -> Result<()> {
let threads = EnumThreads::create().context("Failed to collect running threads")?;
let threads = threads.filter(|thread| thread.process_id() == proc_id);
threads.for_each(|thread_entry| {
if let Ok(thread) =
Thread::attach(thread_entry.thread_id(), ThreadRights::new().suspend_resume())
{
unsafe { SuspendThread(thread.into_inner()) };
}
});
Ok(())
}
fn resume_process(proc_id: ProcessId) -> Result<()> {
let threads = EnumThreads::create().context("Failed to collect running threads")?;
let threads = threads.filter(|thread| thread.process_id() == proc_id);
threads.for_each(|thread_entry| {
if let Ok(thread) =
Thread::attach(thread_entry.thread_id(), ThreadRights::new().suspend_resume())
{
let handle = thread.into_inner();
loop {
if matches!(unsafe { ResumeThread(handle) }, 0 | 0xFFFFFFFF) {
break;
}
}
}
});
Ok(())
}
when implemented on Thread directly tho using self.0 everything works perfectly fine
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.