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 1027693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:16:33+00:00 2026-05-16T12:16:33+00:00

Using EasyHook I have successfully hooked both exported functions and known vtable functions for

  • 0

Using EasyHook I have successfully hooked both exported functions and known vtable functions for various C++ classes. In all these cases target programs have used DLLs.

Provided I know the address of a function’s entry point, is it possible to do the same when a library has been linked into the target program as opposed to being a separate library?

  • 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-16T12:16:34+00:00Added an answer on May 16, 2026 at 12:16 pm

    It appears with EasyHook you can hook any subroutine whose address is calculable.

    In my case hooking static linked SSL_read and SSL_write in OpenSSL was as simple as identifying the offsets with my favourite debugger and then installing the hooks.

    // delegate for EasyHook:
    [UnmanagedFunctionPointer(CallingConvention.Cdecl, 
        SetLastError = true, CharSet = CharSet.Ansi)]
    delegate Int32 SLL_readDelegate(IntPtr SSL_ptr, IntPtr buffer, Int32 length);
    
    // import SSL_read (I actually did it manually, but this will work in most cases)
    /* proto from ssl_lib.c -> int SSL_read(SSL *s,void *buf,int num) */
    [DllImport("ssleay32.dll", SetLastError = true)]
    public static extern Int32 SSL_read(IntPtr ssl, IntPtr buffer, Int32 len);
    
    // the new routine
    static Int32 SSL_readCallback(IntPtr SSL_ptr, IntPtr buffer, Int32 length)
    {
        /* call the imported SSL_read */
        int ret = SSL_read(SSL_ptr, buffer, length);
        /* TODO: your code here, e.g:
         * string log_me = Marshal.PtrToString(buffer, ret);
         */
        return ret;
    }
    

    Now all that’s left is to install the hook:

    private LocalHook sslReadHook;
    
    public void Run(RemoteHooking.IContext InContext, String InArg1)
    {
        // ... initialization code omitted for brevity
    
        /* the value for ssl_read_addr is made up in this example
         * you'll need to study your target and how it's loaded(?) to 
         * identify the addresses you want to hook
         */
        int ssl_read_addr = 0x12345678; /* made up for examples sake */
        sslReadHook = LocalHook.Create(new IntPtr(ssl_read_addr),
            new SSL_readDelegate(SSL_readCallback), this);
    
        // ...
    }
    

    I should mention that in this example you’ll need libeay32.dll and ssleay32.dll as the latter depends on the former.

    Happy hooking!

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

Sidebar

Related Questions

I am desperately trying and failing to hook CallWndProc using EasyHook. Intptr addr =
Using the Redis info command, I am able to get all the stats of
I'm using EasyHook and SlimDX to overlay some graphics using SlimDX's Sprite and Texture
Using android 2.3.3, I have a background Service which has a socket connection. There's
Using MVC2 I have an AJAX form which is posting to a bound model.
using a binary search tree I need to add to a vector all int
Using Core Data, I have a fetch request to fetch the minimum of a
Using Java,I have to fetch multiple sets of values from an XML file to
Using MVVM. I have a DataTemplate which I am using to display an expander
using chrome and ff so far have made a nasty glitch when using scrollTo

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.