Giter VIP home page Giter VIP logo

Comments (4)

kirb avatar kirb commented on August 16, 2024 1

This is by design. It’s not recommended to use MSFindSymbol() or dlsym() with NULL passed as the image argument, as looking up a symbol across the entire set of images loaded in the processes is slow. Unfortunately the initial design of %hookf encouraged this. Instead, define it yourself by passing the pointer into %init:

%hookf(void, afunction) {
  // …
}

%ctor {
  void *myLib = dlopen("/System/Library/PrivateFrameworks/Awesome.framework/Awesome", RTLD_NOLOAD);
  void *myFunc = dlsym(myLib, "afunction");
  %init(afunction = myFunc);
}

from logos.

dom-lgtm avatar dom-lgtm commented on August 16, 2024 1

Thanks @NSExceptional .

What about adding an optional:

%hooklib "/System/Library/PrivateFrameworks/Awesome.framework/Awesome"
%hookf ....
%end

Best of both world?

@kirb I write most of my tweaks without logos, but I love to have logos when I need to do a quick and dirty proof of concept or a throw away analysis tweak. Having to write the constructor defeats the purpose of %hookf as I may as well call MSHookFunction by hand at this point.

from logos.

NSExceptional avatar NSExceptional commented on August 16, 2024

@kirb I actually got the OK from @uroboro to revert this regression when I have time

from logos.

uroboro avatar uroboro commented on August 16, 2024

An idea that floated around when I originally introduced this feature was to specify the library along with the function name:

%hookf(void, "/System/Library/PrivateFrameworks/Awesome.framework/Awesome:aFunction") {
}

from logos.

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.