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

  • Home
  • SEARCH
  • 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 1052373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:04:58+00:00 2026-05-16T17:04:58+00:00

I have a hack program; it injects some functions into a target process to

  • 0

I have a hack program; it injects some functions into a target process to control it. The program is written in C++ with inline assembly.

class GameProcMain {
 // this just a class
};

GameProcMain* mainproc; // there is no problem I can do =(GameProcMain*)0xC1EA90

Now I want to define a class function (which set ecx to class pointer) instead of writing assembly.

PPLYDATA GetNearblyMob(__Vector3* cordinate) {
    __asm {
    mov ecx, 0xC1EA90
    enter code here
    push cordinate
    mov edi, 0x4A8010
    call edi
    }
}

I want to define it and call it like.

PPLYDATA (DLPL::*GetNearblyMob)(__Vector3* cordinate);

mainproc->GetNearblyMob(ADDR_CHRB->kordinat)

When I try GetNearblyMob=(PPLYDATA (DLPL::*)(__Vector3*)) 0x4A8010;

It says something like error: invalid type conversion: "int" to "PPLYDATA (DLPL::*)(int, int)"

but I can do this to set the pointer:

void initializeHack() {
__asm {
LEA edi, GetNearblyMob
MOV eax, 0x4A8010
MOV [edi], eax
}
}

Now I want to learn “how I can set GetNearblyMob without using assembly and legitimately in C++”.

  • 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-16T17:04:59+00:00Added an answer on May 16, 2026 at 5:04 pm

    The problem is that member functions automatically get an extra parameter for the this pointer. Sometimes you can cast between member and non-member functions, but I don’t see the need to cast anything.

    Typically it’s easier to reverse-engineer into C functions than into C++. C typically has a more straightforward ABI, so you can keep the data structures straight as you work them out.

    So, I would recommend

    PPLYDATA (*GetNearblyMob)(DLPL *main_obj, __Vector3* cordinate) = 0x12345UL;
    

    and then define your own function

    class DLPL {
        GetNearblyMob( __Vector3* cordinate ) {
            return ::GetNearblyMob( this, cordinate );
        }
        // ... other program functions
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've inherited a 10K-line program written in 8051 assembly language that requires some changes.
have written this little class, which generates a UUID every time an object of
In my program, I have a class A which is extended by B ,
I have some code that prints the amount of memory used by the program.
I have some text configuration file that need to be read by my program.
I have written some code based on a specification from my boss. A requirement
I have a class which inherits QAbstractTableModel, and holds some complex structs in a
I have a wizard class that gets used a lot in my program. Unfortunately,
I have hack I need to employ under these conditions: It's the last page
I have tried this approach/hack: http://blog.blackwhale.at/2009/06/uibuttons-in-uinavigationbar/ The problem is this leaves a faint seam.

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.