I'm generating assembly that calls it. Look at some C++ code in a disassembler.
Type: Posts; User: genter
I'm generating assembly that calls it. Look at some C++ code in a disassembler.
For those interested, heres quite an ugly hack that does what I need:
inline void *get_address (int num, ...) {
va_list args;
va_start (args, num);
return va_arg (args, void*);
}
I'm basically generating assembly at runtime, that is then immediately ran. At the lowest level, a c++ function has one additional arguement, a pointer to this instance of the object. The pointer...
I'm obviously not too familiar with c++, I'm really coming from a C/assembly background, and use gcc.
I'm dealing with a class thats as simple as the one above, and doesn't really deal with...
No that doesn't work, but I am on amd64. A pointer is still the same size as unsigned long, however, on both architectures, I'm pretty sure.
Thats what I was afraid of. And I was using printf because I know C very well, and I wrote this quickly, and printf was just easier. Anyway I thought of a hack that will work, I think.
I have a pointer to a function in a class, and am trying to cast it to (void*) to pass it to a function.
#include <stdio.h>
class blah {
public:
int store;
int something...