I'm not sure how the compiler handles singleton member functions exactly. Well, I suppose it's likely to be as we need it, otherwise you'd get crashes all the time? Still, just to be safe, it might make sense to double check with simple functions, similar to how the madCodeHook demos perform hooking. Do you get the same crahes then, too? Furthermore, it's always useful to test with a simple "passthrough" callback function which does nothing but "return original_function(original_parameters)", so we can find out whether it's the madCodeHook framework which might be causing the issue, or maybe any manipulation you do in your hook callback code.