Giter VIP home page Giter VIP logo

Comments (7)

steven-michaud avatar steven-michaud commented on May 12, 2024

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.

SamL98 avatar SamL98 commented on May 12, 2024

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.

steven-michaud avatar steven-michaud commented on May 12, 2024

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.

steven-michaud avatar steven-michaud commented on May 12, 2024

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.

SamL98 avatar SamL98 commented on May 12, 2024

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.

SamL98 avatar SamL98 commented on May 12, 2024

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.

steven-michaud avatar steven-michaud commented on May 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.