Comments (7)
External hooks require you to inject your hook function into the process's memory space beforehand. I generally don't recommend doing it, because it's very easy to get it wrong. Also, internal allows you to work with the target process with much more ease.
Ah, except this was using the internal method, with the DLL injected, so it should of worked it seems like without any issues.
I'm on Arch Linux and doing everything by cross-compiling the DLL via MSVC, then injecting it via a custom injector.
from libmem.
This seems to be a Windows problem. Looking into it.
from libmem.
What is the code of your hook function? You have to use C types instead of Rust times if you want to extract information from the parameters. Also, IIRC, some (not many TBH) Assault Cube functions have weird calling conventions, so you might have to do inline ASM.
from libmem.
Sorry for the late response.
I'm not currently using Assault Cube, switched to a different game to test and it's experiencing deadlocks when calling additional logic inside of the target function, which is being used for the hook.
Here's the game I'm currently using: https://www.swisstransfer.com/d/a2eb7459-6ebd-46ef-b3b0-3c45ffdcb422
Function Address: 0x004935d0
Parameters: *const i8, c_int, c_int
I've been hooking this function using retour-rs for several months, and it's been working just fine. But I need to go external for several other games, and decided to try and hook the function above and it just locks upon receiving calls.
The additional code I had in it wasn't anything special, it would deadlock from simply just having a for-loop in it and a println!(), then calling the original function after everything was done.
from libmem.
Oh, I just remembered. I actually have a working hook with Rust for AssaultCube on Linux (don't mind the messy code BTW, this was just a test):
https://github.com/rdbo/rustycube/blob/master/src/lib.rs#L57-L64
This is a hook for gl_drawframe
tested on Linux.
But I need to go external for several other games, and decided to try and hook the function above and it just locks upon receiving calls.
External hooks require you to inject your hook function into the process's memory space beforehand. I generally don't recommend doing it, because it's very easy to get it wrong. Also, internal allows you to work with the target process with much more ease.
from libmem.
Maybe this is a Windows problem? I'll have to check it out.
from libmem.
Related Issues (20)
- Update documentation URL HOT 1
- Mark some libmem APIs as unsafe in Rust HOT 1
- Can libmem be used in the PS5 environment? HOT 1
- Add thread creation time on lm_thread_t
- Consider using registry keys to get Windows boot time (getting rid of NtQuerySystemInformation, which is unstable) HOT 3
- Add fix for Flatpaks and others HOT 1
- vftable, vtable HOT 8
- C++ wrapper
- Better testing HOT 11
- Implement faster pattern scanning algorithm HOT 3
- I have encountered some trouble HOT 4
- Demangle C++ (and others) symbols HOT 2
- Hey buddy, I need to update to your latest API. Can you provide the latest header files and DLL files? HOT 5
- Remove duplicate check for whether file is PE, ELF, etc HOT 1
- LM_ReadMemoryEx in rust returns bool type instead of number of bytes HOT 2
- Bypass virtualization through `/proc/<PID>/root` on Linux HOT 1
- Make better dependency management HOT 11
- [Linux] Retrieve modules from `/proc/<pid>/map_files` instead of `/proc/<pid>/maps` HOT 3
- Replace manual injection method with kubo's cross-platform cross-architecture injection library HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libmem.