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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:58:18+00:00 2026-05-23T09:58:18+00:00

I have this hook function that works fine on x86. Thanks to Bo Persson.

  • 0

I have this hook function that works fine on x86. Thanks to Bo Persson.

void __fastcall Hook(Class* ThisInECX, int UnknownEDX, OtherClass* P1, void* P2, void* P3)
{
    static void* OriginalFunctionPointer = GetProcAddress(GetModuleHandleA("Some.dll"), "[...]");
    static auto OriginalFunction = ((void(__fastcall*)(Class* ThisInECX, int UnknownEDX, OtherClass* P1, void* P2, void* P3))OriginalFunctionPointer);

    OriginalFunction(ThisInECX, UnknownEDX, P1, P2, P3);
}

Now I’m trying to port it to x64. What I found and understood from a few snippets is that:
I had another variable “int UnknownRDX” at front but without it at atleast called the OriginalFunction correctly.
My real variables (P1 etc) seem to be somehow offsetted (or my problem is something different).
I actually need to know if this declaration is right so I can look for the problem at even worse positions.

void Hook(Class* This, int Unknown0, int Unknown1, OtherClass* P1, void* P2, void* P3)
{
    static void* OriginalFunctionPointer = GetProcAddress(GetModuleHandleA("Some64.dll"), "[...]");
    static auto OriginalFunction = ((void(*)(Class* This, int Unknown0, int Unknown1, OtherClass* P1, void* P2, void* P3))OriginalFunctionPointer);

    // Using P1 here is fine on x86 but not on x64

    OriginalFunction(This, Unknown0, Unknown1, P1, P2, P3)
}
  • 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-23T09:58:19+00:00Added an answer on May 23, 2026 at 9:58 am

    There is only one calling convention on x64, so you can ditch that from the signature. What’s likely going wrong is that you’re trying to load the x86 version of a procedure from an x64 function.

    Edit: Oh wait, you posted that question about x86/x64 hooking before, right? I’m pretty confident that’s not the problem here.

    What I would say is that previously, your code depended on calling-convention specific hacks, but on x64 there is only one calling convention.

    http://msdn.microsoft.com/en-us/library/ms235286.aspx

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

Sidebar

Related Questions

I have this function: static void Func1<T>(T x, T y) { dynamic result =
I have this: map<string,int> a; int b; And i'd like to make this: switch(b)
I have this: $(document).on(click,#imgCancel,function(){ $(#tbl_zones td).click(function(){ editTables(#tbl_zones td,this) }) }) I'm trying to make
I have this bit of code: function addEmail() { email = $(#email).val(); atime =
I have this script that I found which allows me to have userside Ajax
Have this query: SELECT HOUR( DATE ) AS hr, COUNT( * ) AS cnt
Have this self-made slider: http://jsfiddle.net/wyc3P/4/ What it does: takes min and max values in
I have this simple code to count punctuation in a string. ie there's 2
I have this code: <%= @r2_blog_posts = Refinery::Blog::Post.recent(2) %> <%= link_to(@r2_blog_posts.first) do %> <%=
I have this code : static dynamic Mean (dynamic x, dynamic y) { return

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.