Jump to content
  • Advertisement
Sign in to follow this  
xilup

Finding out a class size(the class is inside a host process)

This topic is 3056 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am trying to modify Gothic 2 just fo fun. I am having the addresses of the classes, the constructors, deconstructors, but i need to know how to find out the size of a class(e.g. oCNpc).To find out the classes' address i am using IDA. The reason for this is that i want to create my own instances of that classes, but to do so i need to allocate some memory(size = sizeof(class)) mov the pointer to ECX then call the class' constructor. --xilup

Share this post


Link to post
Share on other sites
Advertisement
Put a breakpoint on the constructor. When it gets hit, hopefully it is the result of a dynamic allocation (malloc/new). Look up the stack to find the call to malloc, and check the argument, which should tell you the number of bytes.

Share this post


Link to post
Share on other sites
Quote:
Original post by cache_hit
Put a breakpoint on the constructor. When it gets hit, hopefully it is the result of a dynamic allocation (malloc/new). Look up the stack to find the call to malloc, and check the argument, which should tell you the number of bytes.


Perfect!Thank you, it worked!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!