Use Method of a class defined in a executable

Asked

Viewed 50 times

2

You guys all right? I am here implemented some features to a game server, I own the PDB file in which I can search the OFFSETS.

I was able to reference the global functions by OFFSET this way :

Arquivo .cpp
pXXX YYY = (pXXX) 0x00403B7F;

Arquivo .h
typedef <tipo_retorno_função>(*pXXX)(<parâmetros>);
extern pXXX YYY;

The problem happened at the time I was trying to reference a method of a class. From what I’ve been reading, it seems that this is a different way of doing it, but what I didn’t understand was: When I tried to reference the Class 1 methods the way I described they worked correctly, but when I did in Class 2 the executable simply gave "crash". One detail is that Class 1 has no constructor and Class 2 yes, all methods are public.

Can someone help me? Thank you.

1 answer

0

You can try to let this method you need to use in class 2 as Static, so you don’t need to instantiate the class to use it, just put the nameDaClasse. The c++ language treats different model classes and classes that represent programs, and it is not possible to instantiate them

  • I’m trying to call this method directly into the executable, I just have the offset. The modifications I’m implementing are in a DLL that hookei.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.