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
I need to override the connection in my new table adapters, as they are
I need to override styles for two EditText instances. I have two issues regarding
I need to override an abstract Block in Magento : app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Options/Abstract.php I need to
I need to override Backbone.sync to allow PUT the problem is i don't know
I need to inherit paramsPrepareParamsStack interceptor stack into mystack and need to override validation
I want to compress the viewstate. Therefore I need to override SavePageStateToPersistenceMedium wich belongs
I need to define a method to compare two different objects of a same
Here is my validate method - @Override public void validate() { errors = new

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.