Good evening, fellow experts.
I'm fiddling around with something and right now I'm stuck.
I want to modify the behaviour of an application (Windows 7, 64bit). Therefore, I inject a DLL into the running process to spawn a new thread and then dynamically figure out the address of a certain function I intend to call.
To call it, I've got a function pointer typedef for comfort reasons. It looks like this:
typedef ReturnType (*certain_function)(void* this);
ReturnType is a class which I don't know. I need to pass the returned value of type ReturnType to another function.
typedef void (*another_function) (ReturnType);
ReturnType neither is a primitive type nor a pointer, it's a class I don't got the definition for.
I don't need to work with the class, hence I dont really need to know what it looks like.
My question is: Obviously, I've got to make my own defintion of ReturnType, like:
class ReturnType {
public:
uint8_t padding[?];
};
But how precise does it have to be? Can I just use a insanely large value for ? that definitly would offer enough memory for the class object, or does the size have to be exact? How is Return-by-Value/Call-by-Value done on ASM level? Complete object on the stack?