Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6358579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:24:09+00:00 2026-05-24T23:24:09+00:00

I need to override a method defined by a kext to do my own

  • 0

I need to override a method defined by a kext to do my own processing and return my own value, so whenever the kext calls the method, it will get routed to mine. So what I want to do is to define this method in my own kernel extension, and then load it. The problem is that I don’t know how to swap the methods so mine gets called instead.

/* basically, I need to override the isPinDigital method of AppleHDAPathSet */
AppleHDAPathSet::isPinDigital(void) 
{
     /* I also need to be able to call the superclass' method */

     /* return my own value */
     return 0;
}

Is there an easy way to do this? I know that there is a way of doing it via VTables as all kernel extensions run in the same address space (I think it’s the only way, but I’m not sure on how to do it).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T23:24:12+00:00Added an answer on May 24, 2026 at 11:24 pm

    You can certainly achieve this via hacking the vtable, though I don’t have a specific idea of how you’d go about that. I know the C++ kext loading and unloading mechanism manages vtables and vtable versioning; the source should be available, so have a look at that.

    However, vtable patching should really be a last resort. Are you sure you can’t achieve this by subclassing AppleHDAPathSet? Assuming this isn’t an IOKit personality class, you’ll have to subclass that as well, and set your info.plist up such that your subclassed personality has a higher probe score than the base. Decide in your probe() method whether your hack to isPinDigital needs to be applied. Then override whatever method originally instantiates the AppleHDAPathSet object and make it create an instance of your subclassed version instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just need to override the show() method for the Toast class. I created
I'm working with DelayedJob and I need to override a method that I thought
In C# it is not possible to override a static method. Nevertheless I have
What's a sound approach to override the CompareTo() method in a custom class with
I'm looking to get the showGUI() method work, the compiler says this is not
Why do we need to explicitly define a method as virtual and then also
I need to define a method to compare two different objects of a same
If I have a class that implements ICustomTypeDescriptor I can override the GetProperties() method
I have the following mapping defined: protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.Entity<InsuranceProvider>() .Map(ins
Need a function that takes a character as a parameter and returns true if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.