Comments (7)
What did you add to the following structure?
__attribute__((used)) static const hook_desc user_hooks[]
__attribute__((section("__DATA, __hook"))) =
{
}
It should have been something like:
PATCH_FUNCTION(sub_10010C230, /full/path/to/Spotify.app/Contents/MacOS/Spotify),
Otherwise your code looks fine, and should have worked. Your hook should work on any thread. Though it's conceivable that LogWithFormat() might not have worked, for some reason. Try putting in a NULL dereference and see what happens. Spotify should crash, of course.
from hookcase.
Thank you for the response. I wasn't quite sure what to do with the user_hooks. I added the PATCH_FUNCTION
but now I am receiving errors that Hooked_sub_10010C230
and sub_10010C230_caller
are undeclared when expanding the PATCH_FUNCTION
macro. I feel like there is a simple reason behind this but I can't seem to track it down. I will let you know and close the issue once I do.
from hookcase.
One other thing I didn't notice before: HC_INSERT_LIBRARY needs to be a full path.
As for your compile problem ... I have no idea at all :-(
from hookcase.
Yet one more thing: The HookCase extension displays useful error messages in the Console app, if the Console app is running before you try to use HC_INSERT_LIBRARY. They all begin with "HookCase", so you can filter on that.
from hookcase.
So this is embarrassing but the compiler errors were because I accidentally put the hook in the #if(0)
macro. I took it out and it compiled fine. I changed HC_INSERT_LIBRARY to the full path and added a null dereference in the hook but Spotify doesn't crash. I'll take a look the console to see if I see anything. Thanks again for your help.
from hookcase.
So it looks like the subroutine I was hooking isn't actually called? I hooked a subroutine that is always called in the entry point and I received the log message. It looks like the code was fine, my understanding of how Spotify deals with media control keys was the problem.
from hookcase.
Actually I've discovered a bug here -- just not the one you reported.
To work around it, use full paths both in HC_INSERT_LIBRARY and the executable. For example:
HC_INSERT_LIBRARY=/full/path/to/hook.dylib /full/path/to/Spotify.app/Contents/MacOS/Spotify
I'll open an issue on it when I understand it more fully.
from hookcase.
Related Issues (20)
- Kernel panic on 11.3.1 HOT 4
- HookCase doesn't (yet) support macOS 12 HOT 3
- macOS 12.1 (build 21C52) breaks HookCase HOT 2
- Error in "sudo kmutil load -p /usr/local/sbin/HookCase.kext" macOS Big Sur 11.6.1 HOT 3
- macOS 12.3 breaks HookCase HOT 1
- macOS 12.4 breaks HookCase HOT 4
- macOS 12.5 breaks HookCase HOT 1
- macOS 10.15.7 build 19H2026 breaks HookCase HOT 1
- not Found private symbol "_proc_lock" and "_proc_unlock" On Intel hardware for MacOS 12.5 HOT 1
- which part of the key code to remove the signature restriction about DYLD_INSERT_LIBRARIES HOT 2
- Loading hook library in 'open' no longer loads it in its children
- Interpose hooks largely broken on macOS 13 (Ventura) HOT 10
- Weirdness hooking calls to `open()` in terminal apps HOT 6
- Intermittent double fault kernel panics HOT 8
- Hooked_openat_dprotected_np function cause hookcase disabled HOT 4
- Some NSObject methods crash if used from constructor functions HOT 14
- HookCase can miss a process that was launched using execv() HOT 5
- Persistent double fault kernel panics, probably caused by OpenCore Legacy Patcher HOT 24
- macOS 13.3 breaks HookCase HOT 1
- macOS 14.4 breaks HookCase 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 hookcase.