Typical techniques for this are either using stubs/drivers or execution from a debugger environment.
What are commonly used techniques during dynamic testing?
stubs/drivers or execution from a debugger environment