GithubHelp home page GithubHelp logo

Runtime profile support about dependencies HOT 4 OPEN

misuo avatar misuo commented on May 17, 2024 1
Runtime profile support

from dependencies.

Comments (4)

learn-more avatar learn-more commented on May 17, 2024

That is a huge task,
which involves writing a debugger to monitor module loads...

from dependencies.

lucasg avatar lucasg commented on May 17, 2024

Exactly. If one day I wanted to implement this feature, it would be a separate tool anyway.
In the meantime ProcMon, wtrace and a good breakpoint with Windbg can do the job.

from dependencies.

learn-more avatar learn-more commented on May 17, 2024

Loader snaps (gflags /i process.exe +sls) + a debugger or DbgView to view the output is even simpler,
and it also shows why a dll load fails (if it fails), as well as the reason why a dll is found.

from dependencies.

learn-more avatar learn-more commented on May 17, 2024

How dependencies handles this:

  • It starts the target process under a debugger (dependencies is the debugger)
  • It injects a dll in the target process
  • It redirects all LoadLibrary[Ex][A|W] and GetProcAddress imports from all dlls in the target process to this dll (this is done from the dependencies process)
  • The dll logs the result of these functions using OutputDebugString, which is captured in dependencies.

There are multiple ways to implement this, but these seem to be the most obvious:

  • Start a process under a debugger
  • Inject a dll (Either from the debugger, or as verifier plugin,see note 1)
  • Redirect the functions (either from the debugger, or from the dll itself, see note 2)

Note 1:
The downside of this method is that the dll should be in system32.
However this means we can leverage the verifier subsystem to hook the relevant functions (which makes point 2 no longer a concern)

Note 2:
Hooking the functions can be done from the debugger (host) process, which is slightly more complicated,
or from the injected dll itself. The original depends is doing it from the host process, but I do not know if there is a good reason for this.

When adding support for this feature, would it be a problem if there is a requirement to drop support dll's in system32? (requiring elevation)

from dependencies.

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.